From f437e0415e3004b153a8c6904ac307f955f6fc3f Mon Sep 17 00:00:00 2001 From: rishav-karanjit Date: Thu, 9 Jan 2025 10:28:31 -0800 Subject: [PATCH] Add generated code --- .../to_dafny.go | 400 +- .../to_native.go | 462 +- .../to_dafny.go | 3006 +-- .../to_native.go | 3998 ++-- .../types.go | 546 +- .../to_dafny.go | 400 +- .../to_native.go | 462 +- .../to_dafny.go | 3006 +-- .../to_native.go | 3998 ++-- .../types.go | 546 +- .../to_dafny.go | 1166 +- .../to_native.go | 1152 +- .../to_dafny.go | 1166 +- .../to_native.go | 1152 +- .../to_dafny.go | 9520 ++++----- .../to_native.go | 15154 +++++++------- .../TestsFromDafny-go/DynamoDBwrapped/shim.go | 531 + .../to_dafny.go | 11687 +++++++++++ .../to_native.go | 16302 ++++++++++++++++ .../to_dafny.go | 4382 ++--- .../to_native.go | 6228 +++--- .../go/TestsFromDafny-go/KMSwrapped/shim.go | 486 + .../to_dafny.go | 6402 ++++++ .../to_native.go | 8851 +++++++++ .../to_dafny.go | 666 +- .../to_native.go | 904 +- .../types.go | 20 +- .../to_dafny.go | 666 +- .../to_native.go | 904 +- .../types.go | 20 +- smithy-dafny | 2 +- 31 files changed, 74222 insertions(+), 29963 deletions(-) create mode 100644 ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/DynamoDBwrapped/shim.go create mode 100644 ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go create mode 100644 ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go create mode 100644 ComAmazonawsKms/runtimes/go/TestsFromDafny-go/KMSwrapped/shim.go create mode 100644 ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go create mode 100644 ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_native.go diff --git a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go index bace59ea4..780f86144 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go @@ -18,33 +18,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func GetKeyStoreInfoOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput) AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - - return func() AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - - return AwsCryptographyKeyStoreTypes.Companion_GetKeyStoreInfoOutput_.Create_GetKeyStoreInfoOutput_(aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(nativeOutput.KeyStoreId), aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(nativeOutput.KeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(nativeOutput.LogicalKeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(nativeOutput.GrantTokens), aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(nativeOutput.KmsConfiguration)) - }() - -} - -func CreateKeyStoreInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput) AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - - return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - - return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreInput_.Create_CreateKeyStoreInput_() - }() - -} - -func CreateKeyStoreOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput) AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - - return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - - return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreOutput_.Create_CreateKeyStoreOutput_(aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_ToDafny(nativeOutput.TableArn)) - }() - -} - func CreateKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.CreateKeyInput) AwsCryptographyKeyStoreTypes.CreateKeyInput { return func() AwsCryptographyKeyStoreTypes.CreateKeyInput { @@ -63,20 +36,20 @@ func CreateKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygenerated } -func VersionKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.VersionKeyInput) AwsCryptographyKeyStoreTypes.VersionKeyInput { +func CreateKeyStoreInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput) AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - return func() AwsCryptographyKeyStoreTypes.VersionKeyInput { + return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - return AwsCryptographyKeyStoreTypes.Companion_VersionKeyInput_.Create_VersionKeyInput_(aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreInput_.Create_CreateKeyStoreInput_() }() } -func VersionKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput) AwsCryptographyKeyStoreTypes.VersionKeyOutput { +func CreateKeyStoreOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput) AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - return func() AwsCryptographyKeyStoreTypes.VersionKeyOutput { + return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - return AwsCryptographyKeyStoreTypes.Companion_VersionKeyOutput_.Create_VersionKeyOutput_() + return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreOutput_.Create_CreateKeyStoreOutput_(aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_ToDafny(nativeOutput.TableArn)) }() } @@ -99,6 +72,24 @@ func GetActiveBranchKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithy } +func GetBeaconKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput) AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { + + return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { + + return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyInput_.Create_GetBeaconKeyInput_(aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + }() + +} + +func GetBeaconKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput) AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { + + return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { + + return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyOutput_.Create_GetBeaconKeyOutput_(aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(nativeOutput.BeaconKeyMaterials)) + }() + +} + func GetBranchKeyVersionInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.GetBranchKeyVersionInput) AwsCryptographyKeyStoreTypes.GetBranchKeyVersionInput { return func() AwsCryptographyKeyStoreTypes.GetBranchKeyVersionInput { @@ -117,20 +108,29 @@ func GetBranchKeyVersionOutput_ToDafny(nativeOutput awscryptographykeystoresmith } -func GetBeaconKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput) AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { +func GetKeyStoreInfoOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput) AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { + return func() AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyInput_.Create_GetBeaconKeyInput_(aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + return AwsCryptographyKeyStoreTypes.Companion_GetKeyStoreInfoOutput_.Create_GetKeyStoreInfoOutput_(aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(nativeOutput.KeyStoreId), aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(nativeOutput.KeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(nativeOutput.LogicalKeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(nativeOutput.GrantTokens), aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(nativeOutput.KmsConfiguration)) }() } -func GetBeaconKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput) AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { +func VersionKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.VersionKeyInput) AwsCryptographyKeyStoreTypes.VersionKeyInput { - return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { + return func() AwsCryptographyKeyStoreTypes.VersionKeyInput { - return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyOutput_.Create_GetBeaconKeyOutput_(aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(nativeOutput.BeaconKeyMaterials)) + return AwsCryptographyKeyStoreTypes.Companion_VersionKeyInput_.Create_VersionKeyInput_(aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + }() + +} + +func VersionKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput) AwsCryptographyKeyStoreTypes.VersionKeyOutput { + + return func() AwsCryptographyKeyStoreTypes.VersionKeyOutput { + + return AwsCryptographyKeyStoreTypes.Companion_VersionKeyOutput_.Create_VersionKeyOutput_() }() } @@ -204,37 +204,7 @@ func KeyStoreConfig_ToDafny(nativeInput awscryptographykeystoresmithygeneratedty } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(input awscryptographykeystoresmithygeneratedtypes.KMSConfiguration) AwsCryptographyKeyStoreTypes.KMSConfiguration { - return func() AwsCryptographyKeyStoreTypes.KMSConfiguration { - - switch input.(type) { - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsMRKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_discovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.Discovery)) - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_mrDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.MRDiscovery)) - - default: - panic("Unhandled union type") - } - }() -} - -func aws_cryptography_keyStore_KeyStoreException_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_keyStore_KeyStoreConfig_id_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -243,36 +213,6 @@ func aws_cryptography_keyStore_KeyStoreConfig_id_ToDafny(input *string) Wrappers }() } -func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { - return func() Wrappers.Option { - if (input) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) - }() -} - -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input awscryptographykeystoresmithygeneratedtypes.Discovery) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_Discovery_.Create_Discovery_()) - }() -} - func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() @@ -283,16 +223,22 @@ func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_ToDafny(input ma }() } -func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) +func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOf(func() []interface{} { @@ -307,7 +253,7 @@ func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny }() } -func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) @@ -328,6 +274,35 @@ func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_ToDaf }() } +func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + + return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) + }() +} + +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) + }() +} + func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { return func() dafny.Map { fieldValue := dafny.NewMapBuilder() @@ -338,38 +313,47 @@ func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(inpu }() } -func aws_cryptography_keyStore_MRDiscovery_region_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { - return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { +func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_ToDafny(input *dynamodb.Client) Wrappers.Option { - return func() Wrappers.Option { - if (input) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(&DynamoDBwrapped.Shim{Client: input}) +func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { + return func() AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { + + return AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys)) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_keyStore_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) } - return dafny.SeqOf(fieldValue...) + return fieldValue.ToMap() }() } @@ -386,31 +370,24 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input []byte }() } -func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input string) Wrappers.Option { +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) - }() -} - -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) + fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -423,67 +400,87 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte }() } -func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GrantTokenList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + + return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) + }() +} + +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_keyStore_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GrantTokenList_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(input awscryptographykeystoresmithygeneratedtypes.KMSConfiguration) AwsCryptographyKeyStoreTypes.KMSConfiguration { + return func() AwsCryptographyKeyStoreTypes.KMSConfiguration { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + switch input.(type) { + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsMRKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_discovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.Discovery)) + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_mrDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.MRDiscovery)) + + default: + panic("Unhandled union type") + } }() } @@ -494,6 +491,20 @@ func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_ToDafny(input string) }() } +func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input string) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) + }() +} + +func aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input awscryptographykeystoresmithygeneratedtypes.Discovery) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_Discovery_.Create_Discovery_()) + }() +} + func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input awscryptographykeystoresmithygeneratedtypes.MRDiscovery) Wrappers.Option { return func() Wrappers.Option { @@ -501,29 +512,28 @@ func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input awscry }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_MRDiscovery_region_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { - return func() AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { +func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_KeyStoreException_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) @@ -553,40 +563,19 @@ func aws_cryptography_keyStore_KeyStoreConfig_kmsConfiguration_ToDafny(input aws }() } -func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) - }() -} - -func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { +func aws_cryptography_keyStore_KeyStoreConfig_id_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) - }() -} - -func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } @@ -604,9 +593,20 @@ func aws_cryptography_keyStore_KeyStoreConfig_grantTokens_ToDafny(input []string }() } -func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { - return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { +func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_ToDafny(input *dynamodb.Client) Wrappers.Option { + return func() Wrappers.Option { + if (input) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(&DynamoDBwrapped.Shim{Client: input}) + }() +} - return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) +func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { + return func() Wrappers.Option { + if (input) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) }() } diff --git a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go index 8c3df67aa..dd7a94639 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go @@ -15,29 +15,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func GetKeyStoreInfoOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput) awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput { - - return awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput{KeyStoreId: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(dafnyOutput.Dtor_keyStoreId()), - KeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(dafnyOutput.Dtor_keyStoreName()), - LogicalKeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(dafnyOutput.Dtor_logicalKeyStoreName()), - GrantTokens: aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(dafnyOutput.Dtor_grantTokens()), - KmsConfiguration: aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(dafnyOutput.Dtor_kmsConfiguration()), - } - -} - -func CreateKeyStoreInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.CreateKeyStoreInput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput { - - return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput{} - -} - -func CreateKeyStoreOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput { - - return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput{TableArn: aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(dafnyOutput.Dtor_tableArn())} - -} - func CreateKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.CreateKeyInput) awscryptographykeystoresmithygeneratedtypes.CreateKeyInput { return awscryptographykeystoresmithygeneratedtypes.CreateKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier().UnwrapOr(nil)), @@ -52,15 +29,15 @@ func CreateKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.CreateKe } -func VersionKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.VersionKeyInput) awscryptographykeystoresmithygeneratedtypes.VersionKeyInput { +func CreateKeyStoreInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.CreateKeyStoreInput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput { - return awscryptographykeystoresmithygeneratedtypes.VersionKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput{} } -func VersionKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.VersionKeyOutput) awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput { +func CreateKeyStoreOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput { - return awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput{} + return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput{TableArn: aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(dafnyOutput.Dtor_tableArn())} } @@ -76,6 +53,18 @@ func GetActiveBranchKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes } +func GetBeaconKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.GetBeaconKeyInput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput { + + return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + +} + +func GetBeaconKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput { + + return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput{BeaconKeyMaterials: aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(dafnyOutput.Dtor_beaconKeyMaterials())} + +} + func GetBranchKeyVersionInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.GetBranchKeyVersionInput) awscryptographykeystoresmithygeneratedtypes.GetBranchKeyVersionInput { return awscryptographykeystoresmithygeneratedtypes.GetBranchKeyVersionInput{BranchKeyIdentifier: aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier()), @@ -90,15 +79,26 @@ func GetBranchKeyVersionOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreType } -func GetBeaconKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.GetBeaconKeyInput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput { +func GetKeyStoreInfoOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput) awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput { - return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + return awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput{KeyStoreId: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(dafnyOutput.Dtor_keyStoreId()), + KeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(dafnyOutput.Dtor_keyStoreName()), + LogicalKeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(dafnyOutput.Dtor_logicalKeyStoreName()), + GrantTokens: aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(dafnyOutput.Dtor_grantTokens()), + KmsConfiguration: aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(dafnyOutput.Dtor_kmsConfiguration()), + } } -func GetBeaconKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput { +func VersionKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.VersionKeyInput) awscryptographykeystoresmithygeneratedtypes.VersionKeyInput { - return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput{BeaconKeyMaterials: aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(dafnyOutput.Dtor_beaconKeyMaterials())} + return awscryptographykeystoresmithygeneratedtypes.VersionKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + +} + +func VersionKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.VersionKeyOutput) awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput { + + return awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput{} } @@ -174,51 +174,7 @@ func KeyStoreConfig_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.KeyStoreC } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.KMSConfiguration { - var union awscryptographykeystoresmithygeneratedtypes.KMSConfiguration - - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsKeyArn() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsKeyArn()) - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn{ - Value: (aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsMRKeyArn() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsMRKeyArn()) - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn{ - Value: (aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_discovery() { - - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery{ - Value: (aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_discovery())), - } - } - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_mrDiscovery() { - - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery{ - Value: (aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_mrDiscovery())), - } - } - - return union - -} -func aws_cryptography_keyStore_KeyStoreException_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_keyStore_KeyStoreConfig_id_FromDafny(input interface{}) *string { +func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -234,15 +190,22 @@ func aws_cryptography_keyStore_KeyStoreConfig_id_FromDafny(input interface{}) *s } }() } -func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") +func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil } - return shim.Client + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m } -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -250,12 +213,18 @@ func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_From if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -263,46 +232,31 @@ func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_FromDaf if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.Discovery { - return awscryptographykeystoresmithygeneratedtypes.Discovery{} -} -func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_FromDafny(input interface{}) *string { - return func() *string { +func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_FromDafny(input interface{}) string { + return func() string { var s string - if input == nil { - return nil - } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return s } else { s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -310,18 +264,12 @@ func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{} if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -334,7 +282,14 @@ func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(i } }() } -func aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), + BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), + EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), + BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), + } +} +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -347,7 +302,7 @@ func aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(input int } }() } -func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -355,7 +310,13 @@ func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_FromD if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() @@ -375,7 +336,23 @@ func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(in return m } -func aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -388,31 +365,40 @@ func aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input interface{}) s } }() } -func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), - BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), - EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), - BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), +func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), + EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), + BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), + HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), } } -func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_FromDafny(input interface{}) *dynamodb.Client { - shim, ok := input.(*DynamoDBwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_keyStore_GrantTokenList_member_FromDafny(val)) + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m + } func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input interface{}) []byte { return func() []byte { @@ -430,21 +416,8 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input inte } }() } -func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { + var m map[string][]byte = make(map[string][]byte) if input == nil { return nil } @@ -453,12 +426,12 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(in if !ok { break } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } -func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -471,7 +444,7 @@ func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_FromDafny(inpu } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -487,7 +460,7 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input inte } }() } -func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -500,7 +473,7 @@ func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_FromDafny(input inter } }() } -func aws_cryptography_keyStore_GrantTokenList_member_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -513,7 +486,14 @@ func aws_cryptography_keyStore_GrantTokenList_member_FromDafny(input interface{} } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), + BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), + EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), + BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), + } +} +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -526,7 +506,7 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny( } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -539,7 +519,7 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny( } }() } -func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -552,7 +532,18 @@ func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) strin } }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_keyStore_GrantTokenList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_keyStore_GrantTokenList_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -565,7 +556,38 @@ func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(inpu } }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.KMSConfiguration { + var union awscryptographykeystoresmithygeneratedtypes.KMSConfiguration + + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsKeyArn() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsKeyArn()) + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn{ + Value: (aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsMRKeyArn() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsMRKeyArn()) + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn{ + Value: (aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_discovery() { + + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery{ + Value: (aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_discovery())), + } + } + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_mrDiscovery() { + + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery{ + Value: (aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_mrDiscovery())), + } + } + + return union + +} +func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -578,7 +600,7 @@ func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(input } }() } -func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -586,18 +608,18 @@ func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.Discovery { + return awscryptographykeystoresmithygeneratedtypes.Discovery{} +} +func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.MRDiscovery { + return awscryptographykeystoresmithygeneratedtypes.MRDiscovery{Region: aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input.(AwsCryptographyKeyStoreTypes.MRDiscovery).Dtor_region())} +} +func aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -610,10 +632,7 @@ func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(input interf } }() } -func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.MRDiscovery { - return awscryptographykeystoresmithygeneratedtypes.MRDiscovery{Region: aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input.(AwsCryptographyKeyStoreTypes.MRDiscovery).Dtor_region())} -} -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -621,25 +640,25 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(inp if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), - EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), - BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), - HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), - } +func aws_cryptography_keyStore_KeyStoreException_message_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -683,23 +702,7 @@ func aws_cryptography_keyStore_KeyStoreConfig_kmsConfiguration_FromDafny(input i return union } -func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -712,28 +715,16 @@ func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(inp } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { - var m map[string][]byte = make(map[string][]byte) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_FromDafny(input interface{}) string { - return func() string { +func aws_cryptography_keyStore_KeyStoreConfig_id_FromDafny(input interface{}) *string { + return func() *string { var s string + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } @@ -754,10 +745,19 @@ func aws_cryptography_keyStore_KeyStoreConfig_grantTokens_FromDafny(input interf } return fieldValue } -func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), - BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), - EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), - BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), +func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_FromDafny(input interface{}) *dynamodb.Client { + shim, ok := input.(*DynamoDBwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") } + return shim.Client + } diff --git a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go index b3773db60..3b020a46b 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go @@ -24,15 +24,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func CreateAwsKmsKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { - - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsKeyringInput_.Create_CreateAwsKmsKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) - }() - -} - func CreateAwsKmsDiscoveryKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput { return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput { @@ -42,20 +33,6 @@ func CreateAwsKmsDiscoveryKeyringInput_ToDafny(nativeInput awscryptographymateri } -func CreateAwsKmsMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { - - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMultiKeyringInput_.Create_CreateAwsKmsMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { - if (nativeInput.ClientSupplier) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) - }(), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) - }() - -} - func CreateAwsKmsDiscoveryMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput { return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput { @@ -70,25 +47,34 @@ func CreateAwsKmsDiscoveryMultiKeyringInput_ToDafny(nativeInput awscryptographym } -func CreateAwsKmsMrkKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { +func CreateAwsKmsEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkKeyringInput_.Create_CreateAwsKmsMrkKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsEcdhKeyringInput_.Create_CreateAwsKmsEcdhKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(nativeInput.KeyAgreementScheme), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(nativeInput.CurveSpec), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) }() } -func CreateAwsKmsMrkMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { +func CreateAwsKmsHierarchicalKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkMultiKeyringInput_.Create_CreateAwsKmsMrkMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { - if (nativeInput.ClientSupplier) == nil { + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsHierarchicalKeyringInput_.Create_CreateAwsKmsHierarchicalKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(nativeInput.BranchKeyId), func() Wrappers.Option { + if (nativeInput.BranchKeyIdSupplier) == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) - }(), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + return Wrappers.Companion_Option_.Create_Some_(BranchKeyIdSupplier_ToDafny(nativeInput.BranchKeyIdSupplier)) + }(), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(nativeInput.KeyStore), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(nativeInput.TtlSeconds), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(nativeInput.Cache), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(nativeInput.PartitionId)) + }() + +} + +func CreateAwsKmsKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsKeyringInput_.Create_CreateAwsKmsKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) }() } @@ -116,16 +102,39 @@ func CreateAwsKmsMrkDiscoveryMultiKeyringInput_ToDafny(nativeInput awscryptograp } -func CreateAwsKmsHierarchicalKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { +func CreateAwsKmsMrkKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsHierarchicalKeyringInput_.Create_CreateAwsKmsHierarchicalKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(nativeInput.BranchKeyId), func() Wrappers.Option { - if (nativeInput.BranchKeyIdSupplier) == nil { + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkKeyringInput_.Create_CreateAwsKmsMrkKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + }() + +} + +func CreateAwsKmsMrkMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkMultiKeyringInput_.Create_CreateAwsKmsMrkMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { + if (nativeInput.ClientSupplier) == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(BranchKeyIdSupplier_ToDafny(nativeInput.BranchKeyIdSupplier)) - }(), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(nativeInput.KeyStore), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(nativeInput.TtlSeconds), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(nativeInput.Cache), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(nativeInput.PartitionId)) + return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) + }(), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + }() + +} + +func CreateAwsKmsMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMultiKeyringInput_.Create_CreateAwsKmsMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { + if (nativeInput.ClientSupplier) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) + }(), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) }() } @@ -139,11 +148,29 @@ func CreateAwsKmsRsaKeyringInput_ToDafny(nativeInput awscryptographymaterialprov } -func CreateAwsKmsEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { +func CreateCryptographicMaterialsCacheInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput) AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsEcdhKeyringInput_.Create_CreateAwsKmsEcdhKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(nativeInput.KeyAgreementScheme), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(nativeInput.CurveSpec), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + return AwsCryptographyMaterialProvidersTypes.Companion_CreateCryptographicMaterialsCacheInput_.Create_CreateCryptographicMaterialsCacheInput_(aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(nativeInput.Cache)) + }() + +} + +func CreateDefaultClientSupplierInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultClientSupplierInput_.Create_CreateDefaultClientSupplierInput_() + }() + +} + +func CreateDefaultCryptographicMaterialsManagerInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultCryptographicMaterialsManagerInput_.Create_CreateDefaultCryptographicMaterialsManagerInput_(Keyring_ToDafny(nativeInput.Keyring)) }() } @@ -171,15 +198,6 @@ func CreateRawAesKeyringInput_ToDafny(nativeInput awscryptographymaterialprovide } -func CreateRawRsaKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - - return func() AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_CreateRawRsaKeyringInput_.Create_CreateRawRsaKeyringInput_(aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(nativeInput.KeyNamespace), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(nativeInput.KeyName), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(nativeInput.PaddingScheme), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(nativeInput.PrivateKey)) - }() - -} - func CreateRawEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput { return func() AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput { @@ -189,11 +207,11 @@ func CreateRawEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialprovid } -func CreateDefaultCryptographicMaterialsManagerInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { +func CreateRawRsaKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultCryptographicMaterialsManagerInput_.Create_CreateDefaultCryptographicMaterialsManagerInput_(Keyring_ToDafny(nativeInput.Keyring)) + return AwsCryptographyMaterialProvidersTypes.Companion_CreateRawRsaKeyringInput_.Create_CreateRawRsaKeyringInput_(aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(nativeInput.KeyNamespace), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(nativeInput.KeyName), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(nativeInput.PaddingScheme), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(nativeInput.PrivateKey)) }() } @@ -217,38 +235,35 @@ func CreateRequiredEncryptionContextCMMInput_ToDafny(nativeInput awscryptography } -func CreateCryptographicMaterialsCacheInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput) AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { +func DecryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateCryptographicMaterialsCacheInput_.Create_CreateCryptographicMaterialsCacheInput_(aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(nativeInput.Cache)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(nativeInput.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(nativeInput.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(nativeInput.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(nativeInput.SymmetricSigningKey)) }() } -func CreateDefaultClientSupplierInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { +func EncryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultClientSupplierInput_.Create_CreateDefaultClientSupplierInput_() + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(nativeInput.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(nativeInput.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(nativeInput.SymmetricSigningKeys)) }() } -func InitializeEncryptionMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput) AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { - - return func() AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { +func GetAlgorithmSuiteInfoInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput) dafny.Sequence { - return AwsCryptographyMaterialProvidersTypes.Companion_InitializeEncryptionMaterialsInput_.Create_InitializeEncryptionMaterialsInput_(aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(nativeInput.VerificationKey)) - }() + return Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(nativeInput.BinaryId) } -func EncryptionMaterials_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { +func AlgorithmSuiteInfo_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(nativeOutput.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(nativeOutput.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(nativeOutput.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeOutput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(nativeOutput.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(nativeOutput.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(nativeOutput.SymmetricSigningKeys)) + return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(nativeOutput.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(nativeOutput.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(nativeOutput.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(nativeOutput.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(nativeOutput.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(nativeOutput.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(nativeOutput.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(nativeOutput.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(nativeOutput.EdkWrapping)) }() } @@ -262,62 +277,47 @@ func InitializeDecryptionMaterialsInput_ToDafny(nativeInput awscryptographymater } -func DecryptionMaterials_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(nativeOutput.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(nativeOutput.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeOutput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(nativeOutput.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(nativeOutput.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(nativeOutput.SymmetricSigningKey)) - }() - -} - -func ValidEncryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { +func InitializeEncryptionMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput) AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { + return func() AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidEncryptionMaterialsTransitionInput_.Create_ValidEncryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) + return AwsCryptographyMaterialProvidersTypes.Companion_InitializeEncryptionMaterialsInput_.Create_InitializeEncryptionMaterialsInput_(aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(nativeInput.VerificationKey)) }() } -func ValidDecryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { +func ValidateCommitmentPolicyOnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { + return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidDecryptionMaterialsTransitionInput_.Create_ValidDecryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnDecryptInput_.Create_ValidateCommitmentPolicyOnDecryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) }() } -func GetAlgorithmSuiteInfoInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput) dafny.Sequence { - - return Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(nativeInput.BinaryId) - -} - -func AlgorithmSuiteInfo_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { +func ValidateCommitmentPolicyOnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { - return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(nativeOutput.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(nativeOutput.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(nativeOutput.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(nativeOutput.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(nativeOutput.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(nativeOutput.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(nativeOutput.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(nativeOutput.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(nativeOutput.EdkWrapping)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnEncryptInput_.Create_ValidateCommitmentPolicyOnEncryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) }() } -func ValidateCommitmentPolicyOnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { +func ValidDecryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { + return func() AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnEncryptInput_.Create_ValidateCommitmentPolicyOnEncryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidDecryptionMaterialsTransitionInput_.Create_ValidDecryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) }() } -func ValidateCommitmentPolicyOnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { +func ValidEncryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { + return func() AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnDecryptInput_.Create_ValidateCommitmentPolicyOnDecryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidEncryptionMaterialsTransitionInput_.Create_ValidEncryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) }() } @@ -367,47 +367,38 @@ func ClientSupplier_ToDafny(nativeResource awscryptographymaterialproviderssmith } -func OnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput) AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - - return func() AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptInput_.Create_OnEncryptInput_(aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(nativeInput.Materials)) - }() - -} - -func OnEncryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput) AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { +func DeleteCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput) AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { - return func() AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { + return func() AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { - return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptOutput_.Create_OnEncryptOutput_(aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(nativeOutput.Materials)) + return AwsCryptographyMaterialProvidersTypes.Companion_DeleteCacheEntryInput_.Create_DeleteCacheEntryInput_(aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(nativeInput.Identifier)) }() } -func Keyring_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) AwsCryptographyMaterialProvidersTypes.IKeyring { - val, ok := nativeResource.(*Keyring) +func CryptographicMaterialsCache_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache { + val, ok := nativeResource.(*CryptographicMaterialsCache) if ok { return val.Impl } - return Keyring{&KeyringNativeWrapper{Impl: nativeResource}}.Impl + return CryptographicMaterialsCache{&CryptographicMaterialsCacheNativeWrapper{Impl: nativeResource}}.Impl } -func OnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput) AwsCryptographyMaterialProvidersTypes.OnDecryptInput { +func GetCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { - return func() AwsCryptographyMaterialProvidersTypes.OnDecryptInput { + return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { - return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptInput_.Create_OnDecryptInput_(aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(nativeInput.Materials), aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys)) + return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryInput_.Create_GetCacheEntryInput_(aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) }() } -func OnDecryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput) AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { +func GetCacheEntryOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { - return func() AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { + return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { - return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptOutput_.Create_OnDecryptOutput_(aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(nativeOutput.Materials)) + return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryOutput_.Create_GetCacheEntryOutput_(aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(nativeOutput.Materials), aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(nativeOutput.CreationTime), aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(nativeOutput.ExpiryTime), aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(nativeOutput.MessagesUsed), aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(nativeOutput.BytesUsed)) }() } @@ -421,50 +412,41 @@ func PutCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmit } -func CryptographicMaterialsCache_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache { - val, ok := nativeResource.(*CryptographicMaterialsCache) - if ok { - return val.Impl - } - return CryptographicMaterialsCache{&CryptographicMaterialsCacheNativeWrapper{Impl: nativeResource}}.Impl - -} - -func GetCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { +func UpdateUsageMetadataInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput) AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { - return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { + return func() AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { - return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryInput_.Create_GetCacheEntryInput_(aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) + return AwsCryptographyMaterialProvidersTypes.Companion_UpdateUsageMetadataInput_.Create_UpdateUsageMetadataInput_(aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) }() } -func GetCacheEntryOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { +func DecryptMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { - return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { + return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { - return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryOutput_.Create_GetCacheEntryOutput_(aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(nativeOutput.Materials), aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(nativeOutput.CreationTime), aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(nativeOutput.ExpiryTime), aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(nativeOutput.MessagesUsed), aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(nativeOutput.BytesUsed)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsInput_.Create_DecryptMaterialsInput_(aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(nativeInput.ReproducedEncryptionContext)) }() } -func UpdateUsageMetadataInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput) AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { +func DecryptMaterialsOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { - return func() AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { + return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { - return AwsCryptographyMaterialProvidersTypes.Companion_UpdateUsageMetadataInput_.Create_UpdateUsageMetadataInput_(aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsOutput_.Create_DecryptMaterialsOutput_(aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(nativeOutput.DecryptionMaterials)) }() } -func DeleteCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput) AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { +func CryptographicMaterialsManager_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager { + val, ok := nativeResource.(*CryptographicMaterialsManager) + if ok { + return val.Impl + } + return CryptographicMaterialsManager{&CryptographicMaterialsManagerNativeWrapper{Impl: nativeResource}}.Impl - return func() AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_DeleteCacheEntryInput_.Create_DeleteCacheEntryInput_(aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(nativeInput.Identifier)) - }() - -} +} func GetEncryptionMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput) AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsInput { @@ -484,93 +466,111 @@ func GetEncryptionMaterialsOutput_ToDafny(nativeOutput awscryptographymaterialpr } -func CryptographicMaterialsManager_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager { - val, ok := nativeResource.(*CryptographicMaterialsManager) +func OnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput) AwsCryptographyMaterialProvidersTypes.OnDecryptInput { + + return func() AwsCryptographyMaterialProvidersTypes.OnDecryptInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptInput_.Create_OnDecryptInput_(aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(nativeInput.Materials), aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys)) + }() + +} + +func OnDecryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput) AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { + + return func() AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { + + return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptOutput_.Create_OnDecryptOutput_(aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(nativeOutput.Materials)) + }() + +} + +func Keyring_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) AwsCryptographyMaterialProvidersTypes.IKeyring { + val, ok := nativeResource.(*Keyring) if ok { return val.Impl } - return CryptographicMaterialsManager{&CryptographicMaterialsManagerNativeWrapper{Impl: nativeResource}}.Impl + return Keyring{&KeyringNativeWrapper{Impl: nativeResource}}.Impl } -func DecryptMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { +func OnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput) AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { + return func() AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsInput_.Create_DecryptMaterialsInput_(aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(nativeInput.ReproducedEncryptionContext)) + return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptInput_.Create_OnEncryptInput_(aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(nativeInput.Materials)) }() } -func DecryptMaterialsOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { +func OnEncryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput) AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { - return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { + return func() AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsOutput_.Create_DecryptMaterialsOutput_(aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(nativeOutput.DecryptionMaterials)) + return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptOutput_.Create_OnEncryptOutput_(aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(nativeOutput.Materials)) }() } -func InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt) AwsCryptographyMaterialProvidersTypes.Error { +func AwsCryptographicMaterialProvidersException_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnDecrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_AwsCryptographicMaterialProvidersException_(aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(nativeInput.Message)) }() } -func InvalidEncryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { +func EntryAlreadyExists_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterials_(aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryAlreadyExists_(aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(nativeInput.Message)) }() } -func InvalidAlgorithmSuiteInfoOnEncrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt) AwsCryptographyMaterialProvidersTypes.Error { +func EntryDoesNotExist_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnEncrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryDoesNotExist_(aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(nativeInput.Message)) }() } -func InvalidEncryptionMaterialsTransition_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition) AwsCryptographyMaterialProvidersTypes.Error { +func InFlightTTLExceeded_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterialsTransition_(aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InFlightTTLExceeded_(aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(nativeInput.Message)) }() } -func InFlightTTLExceeded_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidAlgorithmSuiteInfo_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InFlightTTLExceeded_(aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfo_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(nativeInput.Message)) }() } -func EntryAlreadyExists_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryAlreadyExists_(aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnDecrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(nativeInput.Message)) }() } -func AwsCryptographicMaterialProvidersException_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidAlgorithmSuiteInfoOnEncrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_AwsCryptographicMaterialProvidersException_(aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnEncrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(nativeInput.Message)) }() } -func InvalidAlgorithmSuiteInfo_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidDecryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfo_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidDecryptionMaterials_(aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(nativeInput.Message)) }() } @@ -583,18 +583,18 @@ func InvalidDecryptionMaterialsTransition_ToDafny(nativeInput awscryptographymat } -func EntryDoesNotExist_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidEncryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryDoesNotExist_(aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterials_(aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(nativeInput.Message)) }() } -func InvalidDecryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidEncryptionMaterialsTransition_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidDecryptionMaterials_(aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterialsTransition_(aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(nativeInput.Message)) }() } @@ -613,38 +613,38 @@ func OpaqueError_Input_ToDafny(nativeInput awscryptographymaterialproviderssmith func Error_ToDafny(err error) AwsCryptographyMaterialProvidersTypes.Error { switch err.(type) { // Service Errors - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials: - return InvalidEncryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials)) - - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo: - return InvalidAlgorithmSuiteInfo_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo)) - - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition: - return InvalidEncryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition)) - - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt: - return InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt)) + case awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException: + return AwsCryptographicMaterialProvidersException_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException)) case awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists: return EntryAlreadyExists_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists)) - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition: - return InvalidDecryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition)) + case awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist: + return EntryDoesNotExist_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist)) case awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded: return InFlightTTLExceeded_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded)) - case awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist: - return EntryDoesNotExist_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist)) + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo: + return InvalidAlgorithmSuiteInfo_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo)) - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials: - return InvalidDecryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials)) + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt: + return InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt)) case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt: return InvalidAlgorithmSuiteInfoOnEncrypt_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt)) - case awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException: - return AwsCryptographicMaterialProvidersException_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException)) + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials: + return InvalidDecryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials)) + + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition: + return InvalidDecryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition)) + + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials: + return InvalidEncryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials)) + + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition: + return InvalidEncryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition)) //DependentErrors case awscryptographyprimitivessmithygeneratedtypes.AwsCryptographicPrimitivesBaseException: @@ -696,161 +696,154 @@ func MaterialProvidersConfig_ToDafny(nativeInput awscryptographymaterialprovider } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} + +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault: - var inputToConversion = aws_cryptography_materialProviders_CacheType_Default_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo: - var inputToConversion = aws_cryptography_materialProviders_CacheType_No_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded: - var inputToConversion = aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded: - var inputToConversion = aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking: - var inputToConversion = aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared: - var inputToConversion = func() Wrappers.Option { - if (input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(CryptographicMaterialsCache_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value)) - }() - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))) - - default: - panic("Unhandled union type") - } + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA: - var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_ECDSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ECDSA)) - case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - default: - panic("Unhandled union type") + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.HKDF) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_HKDF_.Create_HKDF_(aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input.Hmac), aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input.SaltLength), aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input.InputKeyLength), aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input.OutputKeyLength))) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { +func aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) + element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_RegionList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_RawPrivateKeyToStaticPublicKeyInput_.Create_RawPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input.SenderStaticPrivateKey), aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_ToDafny(input *int64) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPublicKeyDiscoveryInput_.Create_KmsPublicKeyDiscoveryInput_(aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input.RecipientKmsIdentifier))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) }() } -func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(input *int64) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) - }() -} +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { + return func() AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery: + var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey: + var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPublicKeyDiscoveryInput_.Create_KmsPublicKeyDiscoveryInput_(aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input.RecipientKmsIdentifier))) + }() +} + +func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPrivateKeyToStaticPublicKeyInput_.Create_KmsPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input.SenderKmsIdentifier), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + }() +} + +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -863,67 +856,100 @@ func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDa }() } -func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return input + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} + +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) AwsCryptographyMaterialProvidersTypes.CacheType { - return func() AwsCryptographyMaterialProvidersTypes.CacheType { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(input *awscryptographykeystoresmithygenerated.Client) AwsCryptographyKeyStoreTypes.IKeyStoreClient { + return input.DafnyClient +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(input int64) int64 { + return func() int64 { + + return input + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } switch input.(type) { case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault: var inputToConversion = aws_cryptography_materialProviders_CacheType_Default_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo: var inputToConversion = aws_cryptography_materialProviders_CacheType_No_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded: var inputToConversion = aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded: var inputToConversion = aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking: var inputToConversion = aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared: var inputToConversion = func() Wrappers.Option { if (input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value) == nil { @@ -931,7 +957,7 @@ func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_c } return Wrappers.Companion_Option_.Create_Some_(CryptographicMaterialsCache_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value)) }() - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))) default: panic("Unhandled union type") @@ -939,68 +965,65 @@ func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_c }() } -func aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input int32) int32 { +func aws_cryptography_materialProviders_CacheType_Default_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DefaultCache_.Create_DefaultCache_(aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input.EntryCapacity))) + }() +} + +func aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { - return func() AwsCryptographyMaterialProvidersTypes.Encrypt { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: - var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) +func aws_cryptography_materialProviders_CacheType_No_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.NoCache) Wrappers.Option { + return func() Wrappers.Option { - default: - panic("Unhandled union type") - } + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_NoCache_.Create_NoCache_()) }() } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache) Wrappers.Option { + return func() Wrappers.Option { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_SingleThreadedCache_.Create_SingleThreadedCache_(aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) }() } -func Aws_cryptography_materialProviders_GetClientOutput_client_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} +func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { +func aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache) Wrappers.Option { + return func() Wrappers.Option { - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_MultiThreadedCache_.Create_MultiThreadedCache_(aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) + }() +} - default: - panic("Unhandled union type") - } +func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_ToDafny(input *int32) Wrappers.Option { +func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1009,277 +1032,277 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_ToDafny(inp }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_StormTrackingCache_.Create_StormTrackingCache_(aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize), aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input.GracePeriod), aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input.GraceInterval), aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input.FanOut), aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input.InFlightTTL), aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input.SleepMilli), aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input.TimeUnits))) }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} -} +func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input int32) int32 { + return func() int32 { -func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return input }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input int32) int32 { + return func() int32 { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return input }() } -func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) +func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input int32) int32 { + return func() int32 { - default: - panic("Unhandled union type") - } + return input }() } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg) AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { - return func() AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { - var index int for _, enumVal := range input.Values() { index++ - if enumVal == input { + if enumVal == *input { break } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits)) }() } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId))) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + }() +} - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} - return input +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input int32) int32 { - return func() int32 { - - return input +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { - - return input +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) @@ -1300,57 +1323,98 @@ func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantToken }() } -func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { - - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { break } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) }() } -func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { + return func() Wrappers.Option { + if (input) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) + }() +} - return input +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { +func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) AwsCryptographyMaterialProvidersTypes.CacheType { + return func() AwsCryptographyMaterialProvidersTypes.CacheType { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC: - var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_HMAC_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) - case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault: + var inputToConversion = aws_cryptography_materialProviders_CacheType_Default_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo: + var inputToConversion = aws_cryptography_materialProviders_CacheType_No_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded: + var inputToConversion = aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded: + var inputToConversion = aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking: + var inputToConversion = aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared: + var inputToConversion = func() Wrappers.Option { + if (input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(CryptographicMaterialsCache_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value)) + }() + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache)) default: panic("Unhandled union type") @@ -1358,6 +1422,18 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_To }() } +func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) dafny.Sequence { + return func() dafny.Sequence { + + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := Keyring_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { @@ -1365,18 +1441,28 @@ func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_To }() } -func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil } - return fieldValue.ToMap() + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { - return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg) AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { + return func() AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { var index int for _, enumVal := range input.Values() { @@ -1386,75 +1472,78 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_T } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) + return enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) }() } -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { + return func() AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { + + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery: + var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_PublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey: + var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_RawPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey: + var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_EphemeralPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput)) + + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput) Wrappers.Option { return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_PublicKeyDiscoveryInput_.Create_PublicKeyDiscoveryInput_(aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input.RecipientStaticPrivateKey))) + }() +} + +func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) - }() -} - -func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput) Wrappers.Option { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_PublicKeyDiscoveryInput_.Create_PublicKeyDiscoveryInput_(aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input.RecipientStaticPrivateKey))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_RawPrivateKeyToStaticPublicKeyInput_.Create_RawPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input.SenderStaticPrivateKey), aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) - - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1467,34 +1556,28 @@ func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(i }() } -func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput) Wrappers.Option { + return func() Wrappers.Option { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EphemeralPrivateKeyToStaticPublicKeyInput_.Create_EphemeralPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int for _, enumVal := range input.Values() { @@ -1504,34 +1587,33 @@ func aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input awscryptograph } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { + return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { var index int for _, enumVal := range input.Values() { @@ -1541,52 +1623,87 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input awscr } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) - }() -} - -func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(input int64) int64 { - return func() int64 { - - return input + return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { - return func() AwsCryptographyMaterialProvidersTypes.Encrypt { +func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + + return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) + }() +} + +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: - var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) default: panic("Unhandled union type") @@ -1594,68 +1711,77 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} -func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { - return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { +func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId) Wrappers.Option { return func() Wrappers.Option { - if (input) == nil { - return Wrappers.Companion_Option_.Create_None_() + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { + return func() AwsCryptographyMaterialProvidersTypes.Encrypt { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: + var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) default: panic("Unhandled union type") @@ -1663,41 +1789,47 @@ func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKey }() } -func aws_cryptography_materialProviders_CacheType_Default_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache) Wrappers.Option { +func aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DefaultCache_.Create_DefaultCache_(aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input.EntryCapacity))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength))) }() } -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { + return func() int32 { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return input }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} +func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) default: panic("Unhandled union type") @@ -1705,15 +1837,15 @@ func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPo }() } -func aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache) Wrappers.Option { +func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.HKDF) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_MultiThreadedCache_.Create_MultiThreadedCache_(aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_HKDF_.Create_HKDF_(aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input.Hmac), aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input.SaltLength), aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input.InputKeyLength), aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input.OutputKeyLength))) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int for _, enumVal := range input.Values() { @@ -1723,102 +1855,82 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input awsc } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input int32) int32 { + return func() int32 { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DIRECT__KEY__WRAPPING_.Create_DIRECT__KEY__WRAPPING_()) + return input }() } -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + return input }() } -func aws_cryptography_materialProviders_GetClientInput_region_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IDENTITY_.Create_IDENTITY_()) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { + return func() Wrappers.Option { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) }() } -func aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { -func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input int32) int32 { - return func() int32 { + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) - return input + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA: + var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_ECDSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ECDSA)) + case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) default: panic("Unhandled union type") @@ -1826,292 +1938,278 @@ func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_c }() } -func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ECDSA) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_ECDSA_.Create_ECDSA_(aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input.Curve))) }() } -func aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { +func aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) }() } -func aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { + return func() Wrappers.Option { - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) }() } -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC: + var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_HMAC_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) + case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) Wrappers.Option { + return func() Wrappers.Option { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break } - return f - }()...) + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_ToDafny(input int64) int64 { - return func() int64 { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm) AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { - return input - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: + var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_DIRECT__KEY__WRAPPING_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DIRECT__KEY__WRAPPING)) + case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping: + var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_IntermediateKeyWrapping_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping)) -func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING) Wrappers.Option { + return func() Wrappers.Option { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DIRECT__KEY__WRAPPING_.Create_DIRECT__KEY__WRAPPING_()) }() } -func aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache) Wrappers.Option { +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_SingleThreadedCache_.Create_SingleThreadedCache_(aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IntermediateKeyWrapping_.Create_IntermediateKeyWrapping_(aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input.KeyEncryptionKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input.MacKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input.PdkEncryptAlgorithm))) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} -} - -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return input - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) -func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { + return func() AwsCryptographyMaterialProvidersTypes.Encrypt { - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: + var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) -func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy) Wrappers.Option { - return func() Wrappers.Option { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBECommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } +func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } +func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) - }() -} - -func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ECDSA) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_ECDSA_.Create_ECDSA_(aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input.Curve))) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return dafny.SeqOfChars([]dafny.Char(input)...) + return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) }() } -func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) +func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } @@ -2127,165 +2225,120 @@ func aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_To }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { + return func() AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptedDataKey_.Create_EncryptedDataKey_(aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input.KeyProviderId), aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input.KeyProviderInfo), aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input.Ciphertext)) }() } -func aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys))) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) - }() -} - -func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { - return func() AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery: - var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput)) - case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey: - var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput)) - - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Materials) AwsCryptographyMaterialProvidersTypes.Materials { - return func() AwsCryptographyMaterialProvidersTypes.Materials { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption: - var inputToConversion = aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Encryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials)) - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption: - var inputToConversion = aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Decryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials)) - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey: - var inputToConversion = aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BranchKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BranchKeyMaterials)) - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey: - var inputToConversion = aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BeaconKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials)) +func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - default: - panic("Unhandled union type") + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits) Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == *input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { - +func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input [][]byte) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + element := aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + var v []interface{} + if input == nil { + return nil } - return fieldValue.ToMap() - }() -} - -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) - - default: - panic("Unhandled union type") + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2298,7 +2351,24 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_ToDafny(in }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { return func() dafny.Map { fieldValue := dafny.NewMapBuilder() for key, val := range input { @@ -2308,102 +2378,101 @@ func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encry }() } -func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - return input + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { - return func() AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptedDataKey_.Create_EncryptedDataKey_(aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input.KeyProviderId), aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input.KeyProviderInfo), aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input.Ciphertext)) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - return input + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } for _, e := range input { v = append(v, e) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) - }() -} - -func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) - }() -} - -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) - }() -} - -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } for _, e := range input { v = append(v, e) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(input *awscryptographykeystoresmithygenerated.Client) AwsCryptographyKeyStoreTypes.IKeyStoreClient { - return input.DafnyClient -} +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { switch input.(type) { @@ -2420,28 +2489,30 @@ func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_T }() } -func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} +func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy) Wrappers.Option { + return func() Wrappers.Option { -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2451,30 +2522,27 @@ func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_T } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBECommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) }() } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { - return func() AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery: - var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_PublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput)) - case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey: - var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_RawPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput)) - case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey: - var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_EphemeralPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) default: panic("Unhandled union type") @@ -2482,79 +2550,93 @@ func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementSc }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(input int64) int64 { - return func() int64 { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return input + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + }() +} - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + }() +} + +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + }() +} + +func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(input int64) int64 { - return func() int64 { +func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_RegionList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_GetClientInput_region_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { +func Aws_cryptography_materialProviders_GetClientOutput_client_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { return &KMSwrapped.Shim{Client: input} } -func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func aws_cryptography_materialProviders_CacheType_No_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.NoCache) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_NoCache_.Create_NoCache_()) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2567,58 +2649,67 @@ func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInpu }() } -func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) +func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { +func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Materials) AwsCryptographyMaterialProvidersTypes.Materials { + return func() AwsCryptographyMaterialProvidersTypes.Materials { - return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption: + var inputToConversion = aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Encryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials)) + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption: + var inputToConversion = aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Decryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials)) + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey: + var inputToConversion = aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BranchKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BranchKeyMaterials)) + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey: + var inputToConversion = aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BeaconKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) Wrappers.Option { + return func() Wrappers.Option { - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys))) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { +func aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) Wrappers.Option { return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey))) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey))) }() } -func aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey))) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOf(func() []interface{} { @@ -2633,41 +2724,47 @@ func aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(input stri }() } -func aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) +func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_StormTrackingCache_.Create_StormTrackingCache_(aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize), aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input.GracePeriod), aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input.GraceInterval), aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input.FanOut), aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input.InFlightTTL), aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input.SleepMilli), aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input.TimeUnits))) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2680,181 +2777,102 @@ func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(inpu }() } -func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) Wrappers.Option { +func aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength))) - }() -} - -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys))) }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) - - default: - panic("Unhandled union type") +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) - }() -} - -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_ToDafny(input int64) int64 { - return func() int64 { - - return input + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var v []interface{} + if input == nil { + return nil } - return dafny.SeqOf(fieldValue...) - }() -} - -func aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) - }() -} - -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) - - default: - panic("Unhandled union type") + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(input int64) int64 { + return func() int64 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(input int64) int64 { + return func() int64 { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return input }() } -func aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input int32) int32 { +func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys))) - }() -} +func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(input int32) int32 { + return func() int32 { -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return input }() } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2890,28 +2908,39 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_materials_ToDafny(inp }() } -func aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_ToDafny(input int64) int64 { + return func() int64 { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey))) + return input }() } -func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_ToDafny(input int64) int64 { + return func() int64 { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IDENTITY_.Create_IDENTITY_()) + return input }() } -func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} - return input +func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2924,35 +2953,14 @@ func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequ }() } -func aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) - }() -} +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(input int32) int32 { + return func() int32 { -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return input }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { +func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { switch input.(type) { @@ -2969,53 +2977,82 @@ func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algor }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { +func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + }() +} + +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { return func() dafny.Map { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm) AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: - var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_DIRECT__KEY__WRAPPING_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DIRECT__KEY__WRAPPING)) - case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping: - var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_IntermediateKeyWrapping_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) default: panic("Unhandled union type") @@ -3023,19 +3060,18 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(i }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId))) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId))) default: panic("Unhandled union type") @@ -3043,185 +3079,149 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(in }() } -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping) Wrappers.Option { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IntermediateKeyWrapping_.Create_IntermediateKeyWrapping_(aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input.KeyEncryptionKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input.MacKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input.PdkEncryptAlgorithm))) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) +func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) }() } -func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) }() } -func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) dafny.Sequence { +func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { return func() dafny.Sequence { var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := Keyring_ToDafny(val) + element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EphemeralPrivateKeyToStaticPublicKeyInput_.Create_EphemeralPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) }() } -func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input [][]byte) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) +func aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} +func aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() } -func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPrivateKeyToStaticPublicKeyInput_.Create_KmsPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input.SenderKmsIdentifier), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { +func aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} - default: - panic("Unhandled union type") - } +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) +func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } diff --git a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go index e4189bc5c..2e1a47aa8 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go @@ -21,15 +21,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func CreateAwsKmsKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), - KmsClient: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), - } - -} - func CreateAwsKmsDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput{KmsClient: aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), @@ -39,21 +30,6 @@ func CreateAwsKmsDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMater } -func CreateAwsKmsMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), - KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), - ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { - if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { - return nil - } - return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) - }(), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), - } - -} - func CreateAwsKmsDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput{Regions: aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(dafnyInput.Dtor_regions()), @@ -69,26 +45,38 @@ func CreateAwsKmsDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptography } -func CreateAwsKmsMrkKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput { +func CreateAwsKmsEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), - KmsClient: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), + CurveSpec: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), + KmsClient: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } -func CreateAwsKmsMrkMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput { +func CreateAwsKmsHierarchicalKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), - KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), - ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { - if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput{BranchKeyId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(dafnyInput.Dtor_branchKeyId().UnwrapOr(nil)), + BranchKeyIdSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { + if dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil) == nil { return nil } - return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) + return BranchKeyIdSupplier_FromDafny(dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier)) }(), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + KeyStore: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(dafnyInput.Dtor_keyStore()), + TtlSeconds: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(dafnyInput.Dtor_ttlSeconds()), + Cache: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(dafnyInput.Dtor_cache().UnwrapOr(nil)), + PartitionId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(dafnyInput.Dtor_partitionId().UnwrapOr(nil)), + } + +} + +func CreateAwsKmsKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), + KmsClient: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } @@ -118,19 +106,41 @@ func CreateAwsKmsMrkDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptogra } -func CreateAwsKmsHierarchicalKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput { +func CreateAwsKmsMrkKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput{BranchKeyId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(dafnyInput.Dtor_branchKeyId().UnwrapOr(nil)), - BranchKeyIdSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { - if dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil) == nil { + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), + KmsClient: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + } + +} + +func CreateAwsKmsMrkMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), + KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), + ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { + if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { return nil } - return BranchKeyIdSupplier_FromDafny(dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier)) + return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) }(), - KeyStore: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(dafnyInput.Dtor_keyStore()), - TtlSeconds: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(dafnyInput.Dtor_ttlSeconds()), - Cache: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(dafnyInput.Dtor_cache().UnwrapOr(nil)), - PartitionId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(dafnyInput.Dtor_partitionId().UnwrapOr(nil)), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + } + +} + +func CreateAwsKmsMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), + KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), + ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { + if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { + return nil + } + return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) + }(), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } @@ -146,13 +156,21 @@ func CreateAwsKmsRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialPro } -func CreateAwsKmsEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput { +func CreateCryptographicMaterialsCacheInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), - CurveSpec: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), - KmsClient: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), - } + return awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput{Cache: aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(dafnyInput.Dtor_cache())} + +} + +func CreateDefaultClientSupplierInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput{} + +} + +func CreateDefaultCryptographicMaterialsManagerInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput{Keyring: Keyring_FromDafny(dafnyInput.Dtor_keyring())} } @@ -179,17 +197,6 @@ func CreateRawAesKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvid } -func CreateRawRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput{KeyNamespace: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), - KeyName: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), - PaddingScheme: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(dafnyInput.Dtor_paddingScheme()), - PublicKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), - PrivateKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey().UnwrapOr(nil)), - } - -} - func CreateRawEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput{KeyAgreementScheme: aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), @@ -198,9 +205,14 @@ func CreateRawEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvi } -func CreateDefaultCryptographicMaterialsManagerInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput { +func CreateRawRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput{Keyring: Keyring_FromDafny(dafnyInput.Dtor_keyring())} + return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput{KeyNamespace: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), + KeyName: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), + PaddingScheme: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(dafnyInput.Dtor_paddingScheme()), + PublicKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), + PrivateKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey().UnwrapOr(nil)), + } } @@ -223,38 +235,48 @@ func CreateRequiredEncryptionContextCMMInput_FromDafny(dafnyInput AwsCryptograph } -func CreateCryptographicMaterialsCacheInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput { +func DecryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput{Cache: aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(dafnyInput.Dtor_cache())} + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(dafnyInput.Dtor_symmetricSigningKey().UnwrapOr(nil)), + } } -func CreateDefaultClientSupplierInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput { +func EncryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.EncryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput{} + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(dafnyInput.Dtor_symmetricSigningKeys().UnwrapOr(nil)), + } } -func InitializeEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput { +func GetAlgorithmSuiteInfoInput_FromDafny(dafnyInput dafny.Sequence) awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput { - return awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), - EncryptionContext: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), - SigningKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), - } + return awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput{BinaryId: Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(dafnyInput)} } -func EncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.EncryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { +func AlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(dafnyOutput.Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(dafnyOutput.Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(dafnyOutput.Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyOutput.Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(dafnyOutput.Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(dafnyOutput.Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(dafnyOutput.Dtor_symmetricSigningKeys().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(dafnyOutput.Dtor_id()), + BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(dafnyOutput.Dtor_binaryId()), + MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(dafnyOutput.Dtor_messageVersion()), + Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(dafnyOutput.Dtor_encrypt()), + Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(dafnyOutput.Dtor_kdf()), + Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(dafnyOutput.Dtor_commitment()), + Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(dafnyOutput.Dtor_signature()), + SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(dafnyOutput.Dtor_symmetricSignature()), + EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(dafnyOutput.Dtor_edkWrapping()), } } @@ -268,67 +290,45 @@ func InitializeDecryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMate } -func DecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(dafnyOutput.Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(dafnyOutput.Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyOutput.Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(dafnyOutput.Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(dafnyOutput.Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(dafnyOutput.Dtor_symmetricSigningKey().UnwrapOr(nil)), - } - -} - -func ValidEncryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput { +func InitializeEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), - Stop: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), + return awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), + EncryptionContext: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), + SigningKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), } } -func ValidDecryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput { +func ValidateCommitmentPolicyOnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), - Stop: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), + CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), } } -func GetAlgorithmSuiteInfoInput_FromDafny(dafnyInput dafny.Sequence) awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput{BinaryId: Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(dafnyInput)} - -} - -func AlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { +func ValidateCommitmentPolicyOnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput { - return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(dafnyOutput.Dtor_id()), - BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(dafnyOutput.Dtor_binaryId()), - MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(dafnyOutput.Dtor_messageVersion()), - Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(dafnyOutput.Dtor_encrypt()), - Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(dafnyOutput.Dtor_kdf()), - Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(dafnyOutput.Dtor_commitment()), - Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(dafnyOutput.Dtor_signature()), - SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(dafnyOutput.Dtor_symmetricSignature()), - EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(dafnyOutput.Dtor_edkWrapping()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), + CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), } } -func ValidateCommitmentPolicyOnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput { +func ValidDecryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), - CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), + Stop: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), } } -func ValidateCommitmentPolicyOnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput { +func ValidEncryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), - CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), + Stop: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), } } @@ -369,38 +369,37 @@ func ClientSupplier_FromDafny(dafnyResource AwsCryptographyMaterialProvidersType return &ClientSupplier{dafnyResource} } -func OnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput{Materials: aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(dafnyInput.Dtor_materials())} - -} - -func OnEncryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnEncryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput { +func DeleteCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput { - return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput{Materials: aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} + return awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput{Identifier: aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier())} } -func Keyring_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IKeyring) awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { - val, ok := dafnyResource.(*KeyringNativeWrapper) +func CryptographicMaterialsCache_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache { + val, ok := dafnyResource.(*CryptographicMaterialsCacheNativeWrapper) if ok { return val.Impl } - return &Keyring{dafnyResource} + return &CryptographicMaterialsCache{dafnyResource} } -func OnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput { +func GetCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput { - return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput{Materials: aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(dafnyInput.Dtor_materials()), - EncryptedDataKeys: aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), + return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput{Identifier: aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), + BytesUsed: aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), } } -func OnDecryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnDecryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput { +func GetCacheEntryOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput { - return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput{Materials: aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} + return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput{Materials: aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(dafnyOutput.Dtor_materials()), + CreationTime: aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(dafnyOutput.Dtor_creationTime()), + ExpiryTime: aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(dafnyOutput.Dtor_expiryTime()), + MessagesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(dafnyOutput.Dtor_messagesUsed()), + BytesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(dafnyOutput.Dtor_bytesUsed()), + } } @@ -416,46 +415,38 @@ func PutCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTyp } -func CryptographicMaterialsCache_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache { - val, ok := dafnyResource.(*CryptographicMaterialsCacheNativeWrapper) - if ok { - return val.Impl +func UpdateUsageMetadataInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput) awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput{Identifier: aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), + BytesUsed: aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed()), } - return &CryptographicMaterialsCache{dafnyResource} } -func GetCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput { +func DecryptMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput { - return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput{Identifier: aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), - BytesUsed: aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), + CommitmentPolicy: aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), + EncryptedDataKeys: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), + EncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + ReproducedEncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(dafnyInput.Dtor_reproducedEncryptionContext().UnwrapOr(nil)), } } -func GetCacheEntryOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput { +func DecryptMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput { - return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput{Materials: aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(dafnyOutput.Dtor_materials()), - CreationTime: aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(dafnyOutput.Dtor_creationTime()), - ExpiryTime: aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(dafnyOutput.Dtor_expiryTime()), - MessagesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(dafnyOutput.Dtor_messagesUsed()), - BytesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(dafnyOutput.Dtor_bytesUsed()), - } + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput{DecryptionMaterials: aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(dafnyOutput.Dtor_decryptionMaterials())} } -func UpdateUsageMetadataInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput) awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput{Identifier: aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), - BytesUsed: aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed()), +func CryptographicMaterialsManager_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { + val, ok := dafnyResource.(*CryptographicMaterialsManagerNativeWrapper) + if ok { + return val.Impl } -} - -func DeleteCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput{Identifier: aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier())} - + return &CryptographicMaterialsManager{dafnyResource} } func GetEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput { @@ -475,49 +466,53 @@ func GetEncryptionMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialP } -func CryptographicMaterialsManager_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { - val, ok := dafnyResource.(*CryptographicMaterialsManagerNativeWrapper) - if ok { - return val.Impl +func OnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput{Materials: aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(dafnyInput.Dtor_materials()), + EncryptedDataKeys: aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), } - return &CryptographicMaterialsManager{dafnyResource} } -func DecryptMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput { +func OnDecryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnDecryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), - CommitmentPolicy: aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), - EncryptedDataKeys: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), - EncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), - ReproducedEncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(dafnyInput.Dtor_reproducedEncryptionContext().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput{Materials: aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} + +} + +func Keyring_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IKeyring) awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { + val, ok := dafnyResource.(*KeyringNativeWrapper) + if ok { + return val.Impl } + return &Keyring{dafnyResource} } -func DecryptMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput { +func OnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput{DecryptionMaterials: aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(dafnyOutput.Dtor_decryptionMaterials())} + return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput{Materials: aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(dafnyInput.Dtor_materials())} } -func InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(dafnyOutput.Dtor_message())} +func OnEncryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnEncryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput { + + return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput{Materials: aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} } -func InvalidEncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} +func AwsCryptographicMaterialProvidersException_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException { + return awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException{Message: aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(dafnyOutput.Dtor_message())} +func EntryAlreadyExists_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists { + return awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists{Message: aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidEncryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} +func EntryDoesNotExist_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist { + return awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist{Message: aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(dafnyOutput.Dtor_message())} } @@ -526,18 +521,23 @@ func InFlightTTLExceeded_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersT } -func EntryAlreadyExists_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists { - return awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists{Message: aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidAlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(dafnyOutput.Dtor_message())} } -func AwsCryptographicMaterialProvidersException_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException { - return awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException{Message: aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidAlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(dafnyOutput.Dtor_message())} + +} + +func InvalidDecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials{Message: aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} } @@ -546,13 +546,13 @@ func InvalidDecryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyM } -func EntryDoesNotExist_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist { - return awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist{Message: aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidEncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidDecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials{Message: aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidEncryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} } @@ -590,48 +590,48 @@ func OpaqueError_Output_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTy func Error_FromDafny(err AwsCryptographyMaterialProvidersTypes.Error) error { // Service Errors - if err.Is_InvalidEncryptionMaterials() { - return InvalidEncryptionMaterials_FromDafny(err) - } - - if err.Is_InvalidAlgorithmSuiteInfo() { - return InvalidAlgorithmSuiteInfo_FromDafny(err) - } - - if err.Is_InvalidEncryptionMaterialsTransition() { - return InvalidEncryptionMaterialsTransition_FromDafny(err) - } - - if err.Is_InvalidAlgorithmSuiteInfoOnDecrypt() { - return InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(err) + if err.Is_AwsCryptographicMaterialProvidersException() { + return AwsCryptographicMaterialProvidersException_FromDafny(err) } if err.Is_EntryAlreadyExists() { return EntryAlreadyExists_FromDafny(err) } - if err.Is_InvalidDecryptionMaterialsTransition() { - return InvalidDecryptionMaterialsTransition_FromDafny(err) + if err.Is_EntryDoesNotExist() { + return EntryDoesNotExist_FromDafny(err) } if err.Is_InFlightTTLExceeded() { return InFlightTTLExceeded_FromDafny(err) } - if err.Is_EntryDoesNotExist() { - return EntryDoesNotExist_FromDafny(err) + if err.Is_InvalidAlgorithmSuiteInfo() { + return InvalidAlgorithmSuiteInfo_FromDafny(err) } - if err.Is_InvalidDecryptionMaterials() { - return InvalidDecryptionMaterials_FromDafny(err) + if err.Is_InvalidAlgorithmSuiteInfoOnDecrypt() { + return InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(err) } if err.Is_InvalidAlgorithmSuiteInfoOnEncrypt() { return InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(err) } - if err.Is_AwsCryptographicMaterialProvidersException() { - return AwsCryptographicMaterialProvidersException_FromDafny(err) + if err.Is_InvalidDecryptionMaterials() { + return InvalidDecryptionMaterials_FromDafny(err) + } + + if err.Is_InvalidDecryptionMaterialsTransition() { + return InvalidDecryptionMaterialsTransition_FromDafny(err) + } + + if err.Is_InvalidEncryptionMaterials() { + return InvalidEncryptionMaterials_FromDafny(err) + } + + if err.Is_InvalidEncryptionMaterialsTransition() { + return InvalidEncryptionMaterialsTransition_FromDafny(err) } //DependentErrors @@ -664,157 +664,174 @@ func MaterialProvidersConfig_FromDafny(dafnyOutput AwsCryptographyMaterialProvid } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { - var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { if input == nil { return nil } - - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ - Value: (aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), - } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ - Value: (aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), +} +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ - Value: (aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), + return fieldValue +} +func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ - Value: (aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), + }() +} +func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } + }() +} +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ - Value: (aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ - Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), + return fieldValue +} +func aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) } - - return union - + return fieldValue } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_ECDSA() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA{ - Value: (aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_ECDSA())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_None())), - } - } - - return union - -} -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } +func aws_cryptography_materialProviders_RegionList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) } } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b }() } -func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.HKDF { - return awscryptographymaterialproviderssmithygeneratedtypes.HKDF{Hmac: aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_hmac()), - SaltLength: aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_saltLength()), - InputKeyLength: aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_inputKeyLength()), - OutputKeyLength: aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_outputKeyLength()), +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil } -} -func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), - BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), - MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), - Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), - Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), - Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), - Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), - SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), - EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } -func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput { - return awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput{SenderStaticPrivateKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_senderStaticPrivateKey()), - RecipientPublicKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { + var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations + + if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ + Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), + } } -} -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(input interface{}) *int64 { - return func() *int64 { - var b int64 - if input == nil { - return nil + if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ + Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), } - b = input.(int64) - return &b - }() + } + + return union + } func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput { return awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput{RecipientKmsIdentifier: aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput).Dtor_recipientKmsIdentifier())} } -func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int64 { - return func() *int64 { - var b int64 - if input == nil { - return nil +func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - b = input.(int64) - return &b }() } -func aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { - return awscryptographymaterialproviderssmithygeneratedtypes.None{} +func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput { + return awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput{SenderKmsIdentifier: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderKmsIdentifier()), + SenderPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderPublicKey().UnwrapOr(nil)), + RecipientPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), + } } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -827,7 +844,7 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny( } }() } -func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -843,7 +860,7 @@ func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_From } }() } -func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -859,40 +876,82 @@ func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny } }() } -func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] }() } -func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { - return func() *int32 { - var b int32 - if input == nil { - return nil - } - b = input.(int32) - return &b +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(input interface{}) *awscryptographykeystoresmithygenerated.Client { + value, ok := input.(AwsCryptographyKeyStoreTypes.IKeyStoreClient) + if !ok { + panic("invalid type found.") + } + return &awscryptographykeystoresmithygenerated.Client{value} + +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(input interface{}) int64 { + return func() int64 { + var b = input.(int64) + return b }() + } -func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType + if input == nil { + return nil + } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { @@ -934,84 +993,78 @@ func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_c return union } -func aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input interface{}) int32 { +func aws_cryptography_materialProviders_CacheType_Default_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache { + return awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache{EntryCapacity: aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DefaultCache).Dtor_entryCapacity())} +} +func aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { - var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt - - if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ - Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), - } - } - - return union - +func aws_cryptography_materialProviders_CacheType_No_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.NoCache { + return awscryptographymaterialproviderssmithygeneratedtypes.NoCache{} } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), +func aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache { + return awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache{EntryCapacity: aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryCapacity()), + EntryPruningTailSize: aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), } } -func Aws_cryptography_materialProviders_GetClientOutput_client_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - +func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(input interface{}) *string { - return func() *string { - var s string +func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { + return func() *int32 { + var b int32 if input == nil { return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + b = input.(int32) + return &b }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), - } +func aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache { + return awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache{EntryCapacity: aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryCapacity()), + EntryPruningTailSize: aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), +} +func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { + return func() *int32 { + var b int32 + if input == nil { + return nil } + b = input.(int32) + return &b + }() +} +func aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache { + return awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache{EntryCapacity: aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryCapacity()), + EntryPruningTailSize: aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), + GracePeriod: aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_gracePeriod()), + GraceInterval: aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_graceInterval()), + FanOut: aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_fanOut()), + InFlightTTL: aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_inFlightTTL()), + SleepMilli: aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_sleepMilli()), + TimeUnits: aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_timeUnits().UnwrapOr(nil)), } - - return union - } -func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int32 { +func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { @@ -1021,47 +1074,95 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(i return &b }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { + return func() *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { + var u awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits + if input == nil { + return nil + } + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.TimeUnits) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits).Equals(inputEnum) { + break + } + } + } + + return &u.Values()[index] + }() +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -1075,81 +1176,69 @@ func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ } return fieldValue } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil + } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } -func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - return m - + return fieldValue } -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) } - return m - + return fieldValue } -func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } - - return union - } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -1159,29 +1248,11 @@ func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { - return func() awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { - var u awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1194,39 +1265,59 @@ func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDaf } }() } -func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client - } +} +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } - }() + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + } + return fieldValue } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { - return func() string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(input interface{}) *string { + return func() *string { var s string + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1239,54 +1330,81 @@ func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_mes } }() } -func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { - return func() string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(input interface{}) *string { + return func() *string { var s string + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { if input == nil { return nil } - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + return fieldValue +} +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - - return union - -} -func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() + return fieldValue } -func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1317,32 +1435,15 @@ func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAl return u.Values()[index] }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -1356,75 +1457,74 @@ func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_gra } return fieldValue } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil +func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { + var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType + + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ + Value: (aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), + } } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ + Value: (aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - return fieldValue + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ + Value: (aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ + Value: (aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ + Value: (aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ + Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), + } + } + + return union + } -func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) +func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.IKeyring, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + fieldValue = append(fieldValue, Keyring_FromDafny(val.(AwsCryptographyMaterialProvidersTypes.IKeyring))) } return fieldValue } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_HMAC() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_HMAC()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC{ - Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_None())), +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - } - - return union - + }() } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1437,31 +1537,32 @@ func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_Fr } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { + return func() awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { + var u awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { + if enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg).Equals(inputEnum) { break } } @@ -1470,7 +1571,35 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_F return u.Values()[index] }() } -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { + var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations + + if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ + Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ + Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ + Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), + } + } + + return union + +} +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput { + return awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput{RecipientStaticPrivateKey: aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput).Dtor_recipientStaticPrivateKey())} +} +func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1486,7 +1615,12 @@ func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDaf } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput { + return awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput{SenderStaticPrivateKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_senderStaticPrivateKey()), + RecipientPublicKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), + } +} +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1502,42 +1636,26 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input inte } }() } -func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput { - return awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput{RecipientStaticPrivateKey: aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput).Dtor_recipientStaticPrivateKey())} -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput { + return awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput{RecipientPublicKey: aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey())} } -func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1553,41 +1671,16 @@ func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny } }() } -func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { break } } @@ -1596,7 +1689,7 @@ func aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) return u.Values()[index] }() } -func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1604,27 +1697,34 @@ func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { - return func() awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { - var u awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId) +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId).Equals(inputEnum) { + if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { break } } @@ -1633,97 +1733,50 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input int return u.Values()[index] }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(input interface{}) int64 { - return func() int64 { - var b = input.(int64) - return b +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() - } -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { - return awscryptographymaterialproviderssmithygeneratedtypes.None{} -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { - var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt - - if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ - Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), - } - } - - return union - -} -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { - if input == nil { - return nil - } +func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1731,93 +1784,48 @@ func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_reg if !ok { return s } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), - } - } + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint - return union + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) -} -func aws_cryptography_materialProviders_CacheType_Default_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache { - return awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache{EntryCapacity: aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DefaultCache).Dtor_entryCapacity())} -} -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), - } -} -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") +func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { + return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), + BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), + MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), + Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), + Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), + Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), + Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), + SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), + EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), } - return shim.Client - } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } -func aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache { - return awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache{EntryCapacity: aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryCapacity()), - EntryPruningTailSize: aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), - } -} func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId @@ -1836,42 +1844,25 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(input in return u.Values()[index] }() } -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING { - return awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING{} -} -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - - } - } - }() -} -func aws_cryptography_materialProviders_GetClientInput_region_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) +func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { + return func() awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { + var u awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1887,69 +1878,447 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input inte } }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input interface{}) int32 { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { + var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ + Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), } } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + + return union + +} +func aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { + return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), + TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), + IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + } +} +func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.HKDF { + return awscryptographymaterialproviderssmithygeneratedtypes.HKDF{Hmac: aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_hmac()), + SaltLength: aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_saltLength()), + InputKeyLength: aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_inputKeyLength()), + OutputKeyLength: aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_outputKeyLength()), + } +} +func aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY { + return awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY{} +} +func aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { + return awscryptographymaterialproviderssmithygeneratedtypes.None{} +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_ECDSA() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA{ + Value: (aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_ECDSA())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ECDSA { + return awscryptographymaterialproviderssmithygeneratedtypes.ECDSA{Curve: aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.ECDSA).Dtor_curve())} +} +func aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { + return awscryptographymaterialproviderssmithygeneratedtypes.None{} +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_HMAC() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_HMAC()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC{ + Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { + return awscryptographymaterialproviderssmithygeneratedtypes.None{} +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_DIRECT__KEY__WRAPPING() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING{ + Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_DIRECT__KEY__WRAPPING())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_IntermediateKeyWrapping() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping{ + Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_IntermediateKeyWrapping())), + } + } + + return union + +} +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING { + return awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING{} +} +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping { + return awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping{KeyEncryptionKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_keyEncryptionKeyKdf()), + MacKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_macKeyKdf()), + PdkEncryptAlgorithm: aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_pdkEncryptAlgorithm()), + } +} +func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { + var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt + + if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ + Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), + } + } + + return union + +} +func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + +} +func aws_cryptography_materialProviders_EncryptionContext_key_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + + } + } + }() +} +func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { + return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), + BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), + MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), + Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), + Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), + Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), + Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), + SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), + EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), } - - return union - } -func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(input interface{}) map[string]string { +func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil @@ -1964,17 +2333,24 @@ func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_Fr return m } -func aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), +func aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) } + return fieldValue } -func aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey{KeyProviderId: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderId()), + KeyProviderInfo: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderInfo()), + Ciphertext: aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_ciphertext()), + } +} +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1982,102 +2358,229 @@ func aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(inpu if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } + return fieldValue } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input interface{}) [][]byte { + if input == nil { + return nil + } + fieldValue := make([][]byte, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + +} +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - }() + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } -} -func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(input interface{}) int64 { - return func() int64 { - var b = input.(int64) - return b - }() + return m } -func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache { - return awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache{EntryCapacity: aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryCapacity()), - EntryPruningTailSize: aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), - } -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2093,20 +2596,7 @@ func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ } }() } -func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2122,33 +2612,60 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(in } }() } -func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - }() + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + } -func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { + return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { + var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } func aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy { @@ -2169,7 +2686,45 @@ func aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(input int return u.Values()[index] }() } -func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), @@ -2178,43 +2733,16 @@ func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMateria SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() } -func aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), @@ -2224,42 +2752,32 @@ func aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(inpu SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ECDSA { - return awscryptographymaterialproviderssmithygeneratedtypes.ECDSA{Curve: aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.ECDSA).Dtor_curve())} +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue -} -func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { - return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { - var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy).Equals(inputEnum) { - break - } - } - } + return m - return u.Values()[index] - }() } -func aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2272,7 +2790,7 @@ func aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(in } }() } -func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_GetClientInput_region_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2280,47 +2798,20 @@ func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{} if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), - EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), - BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), - HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), +func Aws_cryptography_materialProviders_GetClientOutput_client_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") } + return shim.Client + } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2336,37 +2827,31 @@ func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_Fr } }() } -func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { - var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations - - if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ - Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ - Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), +func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int64 { + return func() *int64 { + var b int64 + if input == nil { + return nil } - } - - return union - + b = input.(int64) + return &b + }() } func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { var union awscryptographymaterialproviderssmithygeneratedtypes.Materials @@ -2399,47 +2884,33 @@ func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny( return union } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), +func aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { - return func() *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { - var u awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits - if input == nil { - return nil - } - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.TimeUnits) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits).Equals(inputEnum) { - break - } - } - } - - return &u.Values()[index] - }() +func aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) +func aws_cryptography_materialProviders_Materials_BranchKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), + BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), + EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), + BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), } - return fieldValue } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2452,57 +2923,26 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDaf } }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy - - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { +func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil @@ -2512,24 +2952,31 @@ func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encry if !ok { break } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } -func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey{KeyProviderId: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderId()), - KeyProviderInfo: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderInfo()), - Ciphertext: aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_ciphertext()), - } +func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + + } + } + }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2537,18 +2984,18 @@ func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_messa if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2564,35 +3011,42 @@ func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_send } }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), +func aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), + EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), + BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), + HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), - } +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m + } -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2608,48 +3062,22 @@ func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_reci } }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(input interface{}) *awscryptographykeystoresmithygenerated.Client { - value, ok := input.(AwsCryptographyKeyStoreTypes.IKeyStoreClient) - if !ok { - panic("invalid type found.") - } - return &awscryptographykeystoresmithygenerated.Client{value} - -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { + var m map[string][]byte = make(map[string][]byte) if input == nil { return nil } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy - - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } + m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - - return union + return m } -func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2662,7 +3090,7 @@ func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromD } }() } -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2678,118 +3106,104 @@ func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_reci } }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } +func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(input interface{}) int64 { + return func() int64 { + var b = input.(int64) + return b + }() + +} +func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(input interface{}) int64 { + return func() int64 { + var b = input.(int64) + return b + }() + +} +func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - - return u.Values()[index] }() } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { - var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations +func aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { + var union awscryptographymaterialproviderssmithygeneratedtypes.Materials - if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ - Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ + Value: (aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), } } - if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ - Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ + Value: (aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), } } - if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ - Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ + Value: (aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ + Value: (aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), } } return union } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(input interface{}) int64 { +func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(input interface{}) int64 { +func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } -func aws_cryptography_materialProviders_RegionList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(input interface{}) *int32 { + return func() *int32 { + var b int32 + if input == nil { + return nil } - }() -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - + b = input.(int32) + return &b + }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(input interface{}) *int32 { +func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { @@ -2799,10 +3213,7 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafn return &b }() } -func aws_cryptography_materialProviders_CacheType_No_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.NoCache { - return awscryptographymaterialproviderssmithygeneratedtypes.NoCache{} -} -func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2818,48 +3229,63 @@ func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInpu } }() } -func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + + return union } -func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), - BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), - MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), - Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), - Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), - Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), - Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), - SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), - EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), +func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } } + + return union + } -func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } - }() + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) + } + return fieldValue } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { - var m map[string][]byte = make(map[string][]byte) +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } @@ -2868,12 +3294,12 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input inter if !ok { break } - m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { +func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil @@ -2888,7 +3314,7 @@ func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionCo return m } -func aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { +func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), @@ -2897,179 +3323,73 @@ func aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input int SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_EncryptionContext_key_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - - } - } - }() -} -func aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache { - return awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache{EntryCapacity: aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryCapacity()), - EntryPruningTailSize: aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), - GracePeriod: aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_gracePeriod()), - GraceInterval: aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_graceInterval()), - FanOut: aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_fanOut()), - InFlightTTL: aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_inFlightTTL()), - SleepMilli: aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_sleepMilli()), - TimeUnits: aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_timeUnits().UnwrapOr(nil)), +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil } -} -func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { - return func() *int32 { - var b int32 - if input == nil { - return nil + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } - b = input.(int32) - return &b - }() -} -func aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { - return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), - TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), - IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m + } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - }() -} -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), } - }() -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + return union - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } +} +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + if input == nil { + return nil } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), - } -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(input interface{}) *string { - return func() *string { - var s string +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(input interface{}) *int64 { + return func() *int64 { + var b int64 if input == nil { return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + b = input.(int64) + return &b }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -3079,76 +3399,40 @@ func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_ if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(input interface{}) int64 { - return func() int64 { - var b = input.(int64) - return b - }() - +func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() +func aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) +func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { - return awscryptographymaterialproviderssmithygeneratedtypes.None{} -} -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} func aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), @@ -3158,13 +3442,7 @@ func aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(inpu SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { +func aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), @@ -3174,100 +3452,43 @@ func aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input int SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) +func aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } - return fieldValue } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { - var union awscryptographymaterialproviderssmithygeneratedtypes.Materials - - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ - Value: (aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ - Value: (aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ - Value: (aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ - Value: (aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), - } - } - - return union - -} -func aws_cryptography_materialProviders_Materials_BranchKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), - BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), - EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), - BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), - } -} -func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY { - return awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY{} -} -func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -3275,53 +3496,25 @@ func aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } - }() -} -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - + }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -3334,7 +3527,7 @@ func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_messa } }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -3347,261 +3540,68 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_Fr } }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_DIRECT__KEY__WRAPPING() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING{ - Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_DIRECT__KEY__WRAPPING())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_IntermediateKeyWrapping() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping{ - Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_IntermediateKeyWrapping())), - } - } - - return union - -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), - } - } - - return union - -} -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping { - return awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping{KeyEncryptionKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_keyEncryptionKeyKdf()), - MacKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_macKeyKdf()), - PdkEncryptAlgorithm: aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_pdkEncryptAlgorithm()), - } -} -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { - return func() *int32 { - var b int32 - if input == nil { - return nil - } - b = input.(int32) - return &b - }() -} -func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.IKeyring, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, Keyring_FromDafny(val.(AwsCryptographyMaterialProvidersTypes.IKeyring))) - } - return fieldValue -} -func aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } +func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) } } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput { - return awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput{RecipientPublicKey: aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey())} -} -func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input interface{}) [][]byte { - if input == nil { - return nil - } - fieldValue := make([][]byte, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput { - return awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput{SenderKmsIdentifier: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderKmsIdentifier()), - SenderPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderPublicKey().UnwrapOr(nil)), - RecipientPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), - } -} -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) - } - return fieldValue -} diff --git a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go index 7e773c27d..3e4955344 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go @@ -98,22 +98,6 @@ func (input IntermediateKeyWrapping) Validate() error { return nil } -func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_Validate() error { - if input.PdkEncryptAlgorithm == nil { - return nil - } - switch unionType := input.PdkEncryptAlgorithm.(type) { - case *EncryptMemberAES_GCM: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) - } - - return nil -} func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_Validate() error { if input.KeyEncryptionKeyKdf == nil { return nil @@ -162,6 +146,22 @@ func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_Intermed return nil } +func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_Validate() error { + if input.PdkEncryptAlgorithm == nil { + return nil + } + switch unionType := input.PdkEncryptAlgorithm.(type) { + case *EncryptMemberAES_GCM: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) + } + + return nil +} type ECDSA struct { Curve awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm @@ -239,16 +239,20 @@ func (input AlgorithmSuiteInfo) Validate() error { return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_Validate() error { - if input.Signature == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_Validate() error { + if input.Commitment == nil { return nil } - switch unionType := input.Signature.(type) { - case *SignatureAlgorithmMemberECDSA: + switch unionType := input.Commitment.(type) { + case *DerivationAlgorithmMemberHKDF: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } - case *SignatureAlgorithmMemberNone: + case *DerivationAlgorithmMemberIDENTITY: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + case *DerivationAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -259,20 +263,16 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_Validate() error { - if input.Commitment == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_Validate() error { + if input.EdkWrapping == nil { return nil } - switch unionType := input.Commitment.(type) { - case *DerivationAlgorithmMemberHKDF: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - case *DerivationAlgorithmMemberIDENTITY: + switch unionType := input.EdkWrapping.(type) { + case *EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } - case *DerivationAlgorithmMemberNone: + case *EdkWrappingAlgorithmMemberIntermediateKeyWrapping: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -283,13 +283,12 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_Validate() error { - if input.SymmetricSignature == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_Validate() error { + if input.Encrypt == nil { return nil } - switch unionType := input.SymmetricSignature.(type) { - case *SymmetricSignatureAlgorithmMemberHMAC: - case *SymmetricSignatureAlgorithmMemberNone: + switch unionType := input.Encrypt.(type) { + case *EncryptMemberAES_GCM: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -314,12 +313,20 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_Validate() error { - if input.Encrypt == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_Validate() error { + if input.Kdf == nil { return nil } - switch unionType := input.Encrypt.(type) { - case *EncryptMemberAES_GCM: + switch unionType := input.Kdf.(type) { + case *DerivationAlgorithmMemberHKDF: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + case *DerivationAlgorithmMemberIDENTITY: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + case *DerivationAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -330,16 +337,16 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_Validate() error { - if input.EdkWrapping == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_Validate() error { + if input.Signature == nil { return nil } - switch unionType := input.EdkWrapping.(type) { - case *EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: + switch unionType := input.Signature.(type) { + case *SignatureAlgorithmMemberECDSA: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } - case *EdkWrappingAlgorithmMemberIntermediateKeyWrapping: + case *SignatureAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -350,20 +357,13 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_Validate() error { - if input.Kdf == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_Validate() error { + if input.SymmetricSignature == nil { return nil } - switch unionType := input.Kdf.(type) { - case *DerivationAlgorithmMemberHKDF: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - case *DerivationAlgorithmMemberIDENTITY: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - case *DerivationAlgorithmMemberNone: + switch unionType := input.SymmetricSignature.(type) { + case *SymmetricSignatureAlgorithmMemberHMAC: + case *SymmetricSignatureAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -1168,14 +1168,16 @@ func (input DecryptMaterialsInput) Validate() error { return nil } -func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_Validate() error { - for key, value := range input.ReproducedEncryptionContext { - if !utf8.ValidString(key) { - return fmt.Errorf("Invalid UTF bytes %s ", key) - } - if !utf8.ValidString(value) { - return fmt.Errorf("Invalid UTF bytes %s ", value) - } +func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_Validate() error { + if input.AlgorithmSuiteId == nil { + return nil + } + switch unionType := input.AlgorithmSuiteId.(type) { + case *AlgorithmSuiteIdMemberESDK: + case *AlgorithmSuiteIdMemberDBE: + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) } return nil @@ -1215,16 +1217,14 @@ func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMat return nil } -func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_Validate() error { - if input.AlgorithmSuiteId == nil { - return nil - } - switch unionType := input.AlgorithmSuiteId.(type) { - case *AlgorithmSuiteIdMemberESDK: - case *AlgorithmSuiteIdMemberDBE: - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) +func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_Validate() error { + for key, value := range input.ReproducedEncryptionContext { + if !utf8.ValidString(key) { + return fmt.Errorf("Invalid UTF bytes %s ", key) + } + if !utf8.ValidString(value) { + return fmt.Errorf("Invalid UTF bytes %s ", value) + } } return nil @@ -1264,15 +1264,6 @@ func (input DecryptionMaterials) Validate() error { return nil } -func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_Validate() error { - for _, item := range input.RequiredEncryptionContextKeys { - if !utf8.ValidString(item) { - return fmt.Errorf("Invalid UTF bytes %s ", item) - } - } - - return nil -} func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_Validate() error { for key, value := range input.EncryptionContext { if !utf8.ValidString(key) { @@ -1285,6 +1276,15 @@ func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMa return nil } +func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_Validate() error { + for _, item := range input.RequiredEncryptionContextKeys { + if !utf8.ValidString(item) { + return fmt.Errorf("Invalid UTF bytes %s ", item) + } + } + + return nil +} type DecryptMaterialsOutput struct { DecryptionMaterials DecryptionMaterials @@ -1333,11 +1333,16 @@ func (input GetEncryptionMaterialsInput) Validate() error { return nil } -func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() error { - for _, item := range input.RequiredEncryptionContextKeys { - if !utf8.ValidString(item) { - return fmt.Errorf("Invalid UTF bytes %s ", item) - } +func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_Validate() error { + if input.CommitmentPolicy == nil { + return nil + } + switch unionType := input.CommitmentPolicy.(type) { + case *CommitmentPolicyMemberESDK: + case *CommitmentPolicyMemberDBE: + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) } return nil @@ -1354,20 +1359,6 @@ func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetE return nil } -func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_Validate() error { - if input.CommitmentPolicy == nil { - return nil - } - switch unionType := input.CommitmentPolicy.(type) { - case *CommitmentPolicyMemberESDK: - case *CommitmentPolicyMemberDBE: - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) - } - - return nil -} func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_Validate() error { if input.AlgorithmSuiteId == nil { return nil @@ -1382,6 +1373,15 @@ func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetE return nil } +func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() error { + for _, item := range input.RequiredEncryptionContextKeys { + if !utf8.ValidString(item) { + return fmt.Errorf("Invalid UTF bytes %s ", item) + } + } + + return nil +} type EncryptionMaterials struct { AlgorithmSuite AlgorithmSuiteInfo @@ -1425,6 +1425,15 @@ func (input EncryptionMaterials) Validate() error { return nil } +func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_Validate() error { + for _, item := range input.EncryptedDataKeys { + if item.Validate() != nil { + return item.Validate() + } + } + + return nil +} func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_Validate() error { for key, value := range input.EncryptionContext { if !utf8.ValidString(key) { @@ -1437,15 +1446,6 @@ func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMa return nil } -func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_Validate() error { - for _, item := range input.EncryptedDataKeys { - if item.Validate() != nil { - return item.Validate() - } - } - - return nil -} func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_Validate() error { for _, item := range input.RequiredEncryptionContextKeys { if !utf8.ValidString(item) { @@ -1704,13 +1704,13 @@ func (input ValidateCommitmentPolicyOnDecryptInput) Validate() error { return nil } -func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_Validate() error { - if input.CommitmentPolicy == nil { +func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_Validate() error { + if input.Algorithm == nil { return nil } - switch unionType := input.CommitmentPolicy.(type) { - case *CommitmentPolicyMemberESDK: - case *CommitmentPolicyMemberDBE: + switch unionType := input.Algorithm.(type) { + case *AlgorithmSuiteIdMemberESDK: + case *AlgorithmSuiteIdMemberDBE: // Default case should not be reached. default: panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) @@ -1718,13 +1718,13 @@ func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialPro return nil } -func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_Validate() error { - if input.Algorithm == nil { +func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_Validate() error { + if input.CommitmentPolicy == nil { return nil } - switch unionType := input.Algorithm.(type) { - case *AlgorithmSuiteIdMemberESDK: - case *AlgorithmSuiteIdMemberDBE: + switch unionType := input.CommitmentPolicy.(type) { + case *CommitmentPolicyMemberESDK: + case *CommitmentPolicyMemberDBE: // Default case should not be reached. default: panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) @@ -1756,20 +1756,6 @@ func (input ValidateCommitmentPolicyOnEncryptInput) Validate() error { return nil } -func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_Validate() error { - if input.CommitmentPolicy == nil { - return nil - } - switch unionType := input.CommitmentPolicy.(type) { - case *CommitmentPolicyMemberESDK: - case *CommitmentPolicyMemberDBE: - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) - } - - return nil -} func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_Validate() error { if input.Algorithm == nil { return nil @@ -1784,6 +1770,20 @@ func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialPro return nil } +func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_Validate() error { + if input.CommitmentPolicy == nil { + return nil + } + switch unionType := input.CommitmentPolicy.(type) { + case *CommitmentPolicyMemberESDK: + case *CommitmentPolicyMemberDBE: + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) + } + + return nil +} type ValidDecryptionMaterialsTransitionInput struct { Start DecryptionMaterials @@ -2040,25 +2040,6 @@ func (input MaterialProvidersConfig) Validate() error { return nil } -// KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey -// KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery -type KmsEcdhStaticConfigurations interface { - isKmsEcdhStaticConfigurations() -} - -type KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey struct { - Value KmsPrivateKeyToStaticPublicKeyInput -} - -func (*KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey) isKmsEcdhStaticConfigurations() { -} - -type KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery struct { - Value KmsPublicKeyDiscoveryInput -} - -func (*KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery) isKmsEcdhStaticConfigurations() {} - // AlgorithmSuiteIdMemberDBE // AlgorithmSuiteIdMemberESDK type AlgorithmSuiteId interface { @@ -2077,71 +2058,6 @@ type AlgorithmSuiteIdMemberESDK struct { func (*AlgorithmSuiteIdMemberESDK) isAlgorithmSuiteId() {} -// KeyAgreementSchemeMemberStaticConfiguration -type KeyAgreementScheme interface { - isKeyAgreementScheme() -} - -type KeyAgreementSchemeMemberStaticConfiguration struct { - Value StaticConfigurations -} - -func (*KeyAgreementSchemeMemberStaticConfiguration) isKeyAgreementScheme() {} - -// SignatureAlgorithmMemberECDSA -// SignatureAlgorithmMemberNone -type SignatureAlgorithm interface { - isSignatureAlgorithm() -} - -type SignatureAlgorithmMemberECDSA struct { - Value ECDSA -} - -func (*SignatureAlgorithmMemberECDSA) isSignatureAlgorithm() {} - -type SignatureAlgorithmMemberNone struct { - Value None -} - -func (*SignatureAlgorithmMemberNone) isSignatureAlgorithm() {} - -// StaticConfigurationsMemberAWS_KMS_ECDH -// StaticConfigurationsMemberRAW_ECDH -type StaticConfigurations interface { - isStaticConfigurations() -} - -type StaticConfigurationsMemberAWS_KMS_ECDH struct { - Value KmsEcdhStaticConfigurations -} - -func (*StaticConfigurationsMemberAWS_KMS_ECDH) isStaticConfigurations() {} - -type StaticConfigurationsMemberRAW_ECDH struct { - Value RawEcdhStaticConfigurations -} - -func (*StaticConfigurationsMemberRAW_ECDH) isStaticConfigurations() {} - -// SymmetricSignatureAlgorithmMemberHMAC -// SymmetricSignatureAlgorithmMemberNone -type SymmetricSignatureAlgorithm interface { - isSymmetricSignatureAlgorithm() -} - -type SymmetricSignatureAlgorithmMemberHMAC struct { - Value awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm -} - -func (*SymmetricSignatureAlgorithmMemberHMAC) isSymmetricSignatureAlgorithm() {} - -type SymmetricSignatureAlgorithmMemberNone struct { - Value None -} - -func (*SymmetricSignatureAlgorithmMemberNone) isSymmetricSignatureAlgorithm() {} - // CacheTypeMemberDefault // CacheTypeMemberMultiThreaded // CacheTypeMemberNo @@ -2188,6 +2104,67 @@ type CacheTypeMemberStormTracking struct { func (*CacheTypeMemberStormTracking) isCacheType() {} +// CommitmentPolicyMemberDBE +// CommitmentPolicyMemberESDK +type CommitmentPolicy interface { + isCommitmentPolicy() +} + +type CommitmentPolicyMemberDBE struct { + Value DBECommitmentPolicy +} + +func (*CommitmentPolicyMemberDBE) isCommitmentPolicy() {} + +type CommitmentPolicyMemberESDK struct { + Value ESDKCommitmentPolicy +} + +func (*CommitmentPolicyMemberESDK) isCommitmentPolicy() {} + +// DerivationAlgorithmMemberHKDF +// DerivationAlgorithmMemberIDENTITY +// DerivationAlgorithmMemberNone +type DerivationAlgorithm interface { + isDerivationAlgorithm() +} + +type DerivationAlgorithmMemberHKDF struct { + Value HKDF +} + +func (*DerivationAlgorithmMemberHKDF) isDerivationAlgorithm() {} + +type DerivationAlgorithmMemberIDENTITY struct { + Value IDENTITY +} + +func (*DerivationAlgorithmMemberIDENTITY) isDerivationAlgorithm() {} + +type DerivationAlgorithmMemberNone struct { + Value None +} + +func (*DerivationAlgorithmMemberNone) isDerivationAlgorithm() {} + +// EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING +// EdkWrappingAlgorithmMemberIntermediateKeyWrapping +type EdkWrappingAlgorithm interface { + isEdkWrappingAlgorithm() +} + +type EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING struct { + Value DIRECT_KEY_WRAPPING +} + +func (*EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING) isEdkWrappingAlgorithm() {} + +type EdkWrappingAlgorithmMemberIntermediateKeyWrapping struct { + Value IntermediateKeyWrapping +} + +func (*EdkWrappingAlgorithmMemberIntermediateKeyWrapping) isEdkWrappingAlgorithm() {} + // EncryptMemberAES_GCM type Encrypt interface { isEncrypt() @@ -2199,33 +2176,36 @@ type EncryptMemberAES_GCM struct { func (*EncryptMemberAES_GCM) isEncrypt() {} -// RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey -// RawEcdhStaticConfigurationsMemberPublicKeyDiscovery -// RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey -type RawEcdhStaticConfigurations interface { - isRawEcdhStaticConfigurations() +// KeyAgreementSchemeMemberStaticConfiguration +type KeyAgreementScheme interface { + isKeyAgreementScheme() } -type RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey struct { - Value EphemeralPrivateKeyToStaticPublicKeyInput +type KeyAgreementSchemeMemberStaticConfiguration struct { + Value StaticConfigurations } -func (*RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { -} +func (*KeyAgreementSchemeMemberStaticConfiguration) isKeyAgreementScheme() {} -type RawEcdhStaticConfigurationsMemberPublicKeyDiscovery struct { - Value PublicKeyDiscoveryInput +// KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey +// KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery +type KmsEcdhStaticConfigurations interface { + isKmsEcdhStaticConfigurations() } -func (*RawEcdhStaticConfigurationsMemberPublicKeyDiscovery) isRawEcdhStaticConfigurations() {} +type KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey struct { + Value KmsPrivateKeyToStaticPublicKeyInput +} -type RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey struct { - Value RawPrivateKeyToStaticPublicKeyInput +func (*KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey) isKmsEcdhStaticConfigurations() { } -func (*RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { +type KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery struct { + Value KmsPublicKeyDiscoveryInput } +func (*KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery) isKmsEcdhStaticConfigurations() {} + // MaterialsMemberBeaconKey // MaterialsMemberBranchKey // MaterialsMemberDecryption @@ -2258,66 +2238,86 @@ type MaterialsMemberEncryption struct { func (*MaterialsMemberEncryption) isMaterials() {} -// DerivationAlgorithmMemberHKDF -// DerivationAlgorithmMemberIDENTITY -// DerivationAlgorithmMemberNone -type DerivationAlgorithm interface { - isDerivationAlgorithm() +// RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey +// RawEcdhStaticConfigurationsMemberPublicKeyDiscovery +// RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey +type RawEcdhStaticConfigurations interface { + isRawEcdhStaticConfigurations() } -type DerivationAlgorithmMemberHKDF struct { - Value HKDF +type RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey struct { + Value EphemeralPrivateKeyToStaticPublicKeyInput } -func (*DerivationAlgorithmMemberHKDF) isDerivationAlgorithm() {} +func (*RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { +} -type DerivationAlgorithmMemberIDENTITY struct { - Value IDENTITY +type RawEcdhStaticConfigurationsMemberPublicKeyDiscovery struct { + Value PublicKeyDiscoveryInput } -func (*DerivationAlgorithmMemberIDENTITY) isDerivationAlgorithm() {} +func (*RawEcdhStaticConfigurationsMemberPublicKeyDiscovery) isRawEcdhStaticConfigurations() {} -type DerivationAlgorithmMemberNone struct { +type RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey struct { + Value RawPrivateKeyToStaticPublicKeyInput +} + +func (*RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { +} + +// SignatureAlgorithmMemberECDSA +// SignatureAlgorithmMemberNone +type SignatureAlgorithm interface { + isSignatureAlgorithm() +} + +type SignatureAlgorithmMemberECDSA struct { + Value ECDSA +} + +func (*SignatureAlgorithmMemberECDSA) isSignatureAlgorithm() {} + +type SignatureAlgorithmMemberNone struct { Value None } -func (*DerivationAlgorithmMemberNone) isDerivationAlgorithm() {} +func (*SignatureAlgorithmMemberNone) isSignatureAlgorithm() {} -// EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING -// EdkWrappingAlgorithmMemberIntermediateKeyWrapping -type EdkWrappingAlgorithm interface { - isEdkWrappingAlgorithm() +// StaticConfigurationsMemberAWS_KMS_ECDH +// StaticConfigurationsMemberRAW_ECDH +type StaticConfigurations interface { + isStaticConfigurations() } -type EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING struct { - Value DIRECT_KEY_WRAPPING +type StaticConfigurationsMemberAWS_KMS_ECDH struct { + Value KmsEcdhStaticConfigurations } -func (*EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING) isEdkWrappingAlgorithm() {} +func (*StaticConfigurationsMemberAWS_KMS_ECDH) isStaticConfigurations() {} -type EdkWrappingAlgorithmMemberIntermediateKeyWrapping struct { - Value IntermediateKeyWrapping +type StaticConfigurationsMemberRAW_ECDH struct { + Value RawEcdhStaticConfigurations } -func (*EdkWrappingAlgorithmMemberIntermediateKeyWrapping) isEdkWrappingAlgorithm() {} +func (*StaticConfigurationsMemberRAW_ECDH) isStaticConfigurations() {} -// CommitmentPolicyMemberDBE -// CommitmentPolicyMemberESDK -type CommitmentPolicy interface { - isCommitmentPolicy() +// SymmetricSignatureAlgorithmMemberHMAC +// SymmetricSignatureAlgorithmMemberNone +type SymmetricSignatureAlgorithm interface { + isSymmetricSignatureAlgorithm() } -type CommitmentPolicyMemberDBE struct { - Value DBECommitmentPolicy +type SymmetricSignatureAlgorithmMemberHMAC struct { + Value awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm } -func (*CommitmentPolicyMemberDBE) isCommitmentPolicy() {} +func (*SymmetricSignatureAlgorithmMemberHMAC) isSymmetricSignatureAlgorithm() {} -type CommitmentPolicyMemberESDK struct { - Value ESDKCommitmentPolicy +type SymmetricSignatureAlgorithmMemberNone struct { + Value None } -func (*CommitmentPolicyMemberESDK) isCommitmentPolicy() {} +func (*SymmetricSignatureAlgorithmMemberNone) isSymmetricSignatureAlgorithm() {} type AwsCryptographicMaterialProvidersBaseException interface { // This is a dummy method to allow type assertion since Go empty interfaces @@ -2334,12 +2334,6 @@ type IClientSupplier interface { GetClient(GetClientInput) (kms.Client, error) } -type IKeyring interface { - OnEncrypt(OnEncryptInput) (*OnEncryptOutput, error) - - OnDecrypt(OnDecryptInput) (*OnDecryptOutput, error) -} - type ICryptographicMaterialsCache interface { PutCacheEntry(PutCacheEntryInput) error @@ -2355,3 +2349,9 @@ type ICryptographicMaterialsManager interface { DecryptMaterials(DecryptMaterialsInput) (*DecryptMaterialsOutput, error) } + +type IKeyring interface { + OnEncrypt(OnEncryptInput) (*OnEncryptOutput, error) + + OnDecrypt(OnDecryptInput) (*OnDecryptOutput, error) +} diff --git a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go index bace59ea4..780f86144 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_dafny.go @@ -18,33 +18,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func GetKeyStoreInfoOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput) AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - - return func() AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - - return AwsCryptographyKeyStoreTypes.Companion_GetKeyStoreInfoOutput_.Create_GetKeyStoreInfoOutput_(aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(nativeOutput.KeyStoreId), aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(nativeOutput.KeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(nativeOutput.LogicalKeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(nativeOutput.GrantTokens), aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(nativeOutput.KmsConfiguration)) - }() - -} - -func CreateKeyStoreInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput) AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - - return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - - return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreInput_.Create_CreateKeyStoreInput_() - }() - -} - -func CreateKeyStoreOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput) AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - - return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - - return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreOutput_.Create_CreateKeyStoreOutput_(aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_ToDafny(nativeOutput.TableArn)) - }() - -} - func CreateKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.CreateKeyInput) AwsCryptographyKeyStoreTypes.CreateKeyInput { return func() AwsCryptographyKeyStoreTypes.CreateKeyInput { @@ -63,20 +36,20 @@ func CreateKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygenerated } -func VersionKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.VersionKeyInput) AwsCryptographyKeyStoreTypes.VersionKeyInput { +func CreateKeyStoreInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput) AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - return func() AwsCryptographyKeyStoreTypes.VersionKeyInput { + return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreInput { - return AwsCryptographyKeyStoreTypes.Companion_VersionKeyInput_.Create_VersionKeyInput_(aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreInput_.Create_CreateKeyStoreInput_() }() } -func VersionKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput) AwsCryptographyKeyStoreTypes.VersionKeyOutput { +func CreateKeyStoreOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput) AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - return func() AwsCryptographyKeyStoreTypes.VersionKeyOutput { + return func() AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput { - return AwsCryptographyKeyStoreTypes.Companion_VersionKeyOutput_.Create_VersionKeyOutput_() + return AwsCryptographyKeyStoreTypes.Companion_CreateKeyStoreOutput_.Create_CreateKeyStoreOutput_(aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_ToDafny(nativeOutput.TableArn)) }() } @@ -99,6 +72,24 @@ func GetActiveBranchKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithy } +func GetBeaconKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput) AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { + + return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { + + return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyInput_.Create_GetBeaconKeyInput_(aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + }() + +} + +func GetBeaconKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput) AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { + + return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { + + return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyOutput_.Create_GetBeaconKeyOutput_(aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(nativeOutput.BeaconKeyMaterials)) + }() + +} + func GetBranchKeyVersionInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.GetBranchKeyVersionInput) AwsCryptographyKeyStoreTypes.GetBranchKeyVersionInput { return func() AwsCryptographyKeyStoreTypes.GetBranchKeyVersionInput { @@ -117,20 +108,29 @@ func GetBranchKeyVersionOutput_ToDafny(nativeOutput awscryptographykeystoresmith } -func GetBeaconKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput) AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { +func GetKeyStoreInfoOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput) AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyInput { + return func() AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput { - return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyInput_.Create_GetBeaconKeyInput_(aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + return AwsCryptographyKeyStoreTypes.Companion_GetKeyStoreInfoOutput_.Create_GetKeyStoreInfoOutput_(aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(nativeOutput.KeyStoreId), aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(nativeOutput.KeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(nativeOutput.LogicalKeyStoreName), aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(nativeOutput.GrantTokens), aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(nativeOutput.KmsConfiguration)) }() } -func GetBeaconKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput) AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { +func VersionKeyInput_ToDafny(nativeInput awscryptographykeystoresmithygeneratedtypes.VersionKeyInput) AwsCryptographyKeyStoreTypes.VersionKeyInput { - return func() AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput { + return func() AwsCryptographyKeyStoreTypes.VersionKeyInput { - return AwsCryptographyKeyStoreTypes.Companion_GetBeaconKeyOutput_.Create_GetBeaconKeyOutput_(aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(nativeOutput.BeaconKeyMaterials)) + return AwsCryptographyKeyStoreTypes.Companion_VersionKeyInput_.Create_VersionKeyInput_(aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(nativeInput.BranchKeyIdentifier)) + }() + +} + +func VersionKeyOutput_ToDafny(nativeOutput awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput) AwsCryptographyKeyStoreTypes.VersionKeyOutput { + + return func() AwsCryptographyKeyStoreTypes.VersionKeyOutput { + + return AwsCryptographyKeyStoreTypes.Companion_VersionKeyOutput_.Create_VersionKeyOutput_() }() } @@ -204,37 +204,7 @@ func KeyStoreConfig_ToDafny(nativeInput awscryptographykeystoresmithygeneratedty } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(input awscryptographykeystoresmithygeneratedtypes.KMSConfiguration) AwsCryptographyKeyStoreTypes.KMSConfiguration { - return func() AwsCryptographyKeyStoreTypes.KMSConfiguration { - - switch input.(type) { - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsMRKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_discovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.Discovery)) - case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery: - var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery).Value) - return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_mrDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.MRDiscovery)) - - default: - panic("Unhandled union type") - } - }() -} - -func aws_cryptography_keyStore_KeyStoreException_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_keyStore_KeyStoreConfig_id_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -243,36 +213,6 @@ func aws_cryptography_keyStore_KeyStoreConfig_id_ToDafny(input *string) Wrappers }() } -func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { - return func() Wrappers.Option { - if (input) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) - }() -} - -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input awscryptographykeystoresmithygeneratedtypes.Discovery) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_Discovery_.Create_Discovery_()) - }() -} - func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() @@ -283,16 +223,22 @@ func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_ToDafny(input ma }() } -func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) +func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOf(func() []interface{} { @@ -307,7 +253,7 @@ func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny }() } -func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) @@ -328,6 +274,35 @@ func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_ToDaf }() } +func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + + return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) + }() +} + +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) + }() +} + func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { return func() dafny.Map { fieldValue := dafny.NewMapBuilder() @@ -338,38 +313,47 @@ func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(inpu }() } -func aws_cryptography_keyStore_MRDiscovery_region_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { - return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { +func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_ToDafny(input *dynamodb.Client) Wrappers.Option { - return func() Wrappers.Option { - if (input) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(&DynamoDBwrapped.Shim{Client: input}) +func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { + return func() AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { + + return AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys)) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_keyStore_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) } - return dafny.SeqOf(fieldValue...) + return fieldValue.ToMap() }() } @@ -386,31 +370,24 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input []byte }() } -func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input string) Wrappers.Option { +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) - }() -} - -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) + fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -423,67 +400,87 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte }() } -func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GrantTokenList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { + + return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) + }() +} + +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_keyStore_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_GrantTokenList_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_ToDafny(input awscryptographykeystoresmithygeneratedtypes.KMSConfiguration) AwsCryptographyKeyStoreTypes.KMSConfiguration { + return func() AwsCryptographyKeyStoreTypes.KMSConfiguration { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + switch input.(type) { + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_kmsMRKeyArn_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_discovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.Discovery)) + case *awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery: + var inputToConversion = aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input.(*awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery).Value) + return AwsCryptographyKeyStoreTypes.CompanionStruct_KMSConfiguration_{}.Create_mrDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.MRDiscovery)) + + default: + panic("Unhandled union type") + } }() } @@ -494,6 +491,20 @@ func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_ToDafny(input string) }() } +func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_ToDafny(input string) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) + }() +} + +func aws_cryptography_keyStore_KMSConfiguration_discovery_ToDafny(input awscryptographykeystoresmithygeneratedtypes.Discovery) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_Discovery_.Create_Discovery_()) + }() +} + func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input awscryptographykeystoresmithygeneratedtypes.MRDiscovery) Wrappers.Option { return func() Wrappers.Option { @@ -501,29 +512,28 @@ func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_ToDafny(input awscry }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_MRDiscovery_region_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { - return func() AwsCryptographyKeyStoreTypes.BeaconKeyMaterials { +func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_KeyStoreException_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) @@ -553,40 +563,19 @@ func aws_cryptography_keyStore_KeyStoreConfig_kmsConfiguration_ToDafny(input aws }() } -func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) - }() -} - -func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { +func aws_cryptography_keyStore_KeyStoreConfig_id_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) - }() -} - -func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } @@ -604,9 +593,20 @@ func aws_cryptography_keyStore_KeyStoreConfig_grantTokens_ToDafny(input []string }() } -func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) AwsCryptographyKeyStoreTypes.BranchKeyMaterials { - return func() AwsCryptographyKeyStoreTypes.BranchKeyMaterials { +func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_ToDafny(input *dynamodb.Client) Wrappers.Option { + return func() Wrappers.Option { + if (input) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(&DynamoDBwrapped.Shim{Client: input}) + }() +} - return AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey)) +func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { + return func() Wrappers.Option { + if (input) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) }() } diff --git a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go index 8c3df67aa..dd7a94639 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographykeystoresmithygenerated/to_native.go @@ -15,29 +15,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func GetKeyStoreInfoOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput) awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput { - - return awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput{KeyStoreId: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(dafnyOutput.Dtor_keyStoreId()), - KeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(dafnyOutput.Dtor_keyStoreName()), - LogicalKeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(dafnyOutput.Dtor_logicalKeyStoreName()), - GrantTokens: aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(dafnyOutput.Dtor_grantTokens()), - KmsConfiguration: aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(dafnyOutput.Dtor_kmsConfiguration()), - } - -} - -func CreateKeyStoreInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.CreateKeyStoreInput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput { - - return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput{} - -} - -func CreateKeyStoreOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput { - - return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput{TableArn: aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(dafnyOutput.Dtor_tableArn())} - -} - func CreateKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.CreateKeyInput) awscryptographykeystoresmithygeneratedtypes.CreateKeyInput { return awscryptographykeystoresmithygeneratedtypes.CreateKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier().UnwrapOr(nil)), @@ -52,15 +29,15 @@ func CreateKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.CreateKe } -func VersionKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.VersionKeyInput) awscryptographykeystoresmithygeneratedtypes.VersionKeyInput { +func CreateKeyStoreInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.CreateKeyStoreInput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput { - return awscryptographykeystoresmithygeneratedtypes.VersionKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreInput{} } -func VersionKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.VersionKeyOutput) awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput { +func CreateKeyStoreOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.CreateKeyStoreOutput) awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput { - return awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput{} + return awscryptographykeystoresmithygeneratedtypes.CreateKeyStoreOutput{TableArn: aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(dafnyOutput.Dtor_tableArn())} } @@ -76,6 +53,18 @@ func GetActiveBranchKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes } +func GetBeaconKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.GetBeaconKeyInput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput { + + return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + +} + +func GetBeaconKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput { + + return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput{BeaconKeyMaterials: aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(dafnyOutput.Dtor_beaconKeyMaterials())} + +} + func GetBranchKeyVersionInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.GetBranchKeyVersionInput) awscryptographykeystoresmithygeneratedtypes.GetBranchKeyVersionInput { return awscryptographykeystoresmithygeneratedtypes.GetBranchKeyVersionInput{BranchKeyIdentifier: aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier()), @@ -90,15 +79,26 @@ func GetBranchKeyVersionOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreType } -func GetBeaconKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.GetBeaconKeyInput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput { +func GetKeyStoreInfoOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetKeyStoreInfoOutput) awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput { - return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + return awscryptographykeystoresmithygeneratedtypes.GetKeyStoreInfoOutput{KeyStoreId: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(dafnyOutput.Dtor_keyStoreId()), + KeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(dafnyOutput.Dtor_keyStoreName()), + LogicalKeyStoreName: aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(dafnyOutput.Dtor_logicalKeyStoreName()), + GrantTokens: aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(dafnyOutput.Dtor_grantTokens()), + KmsConfiguration: aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(dafnyOutput.Dtor_kmsConfiguration()), + } } -func GetBeaconKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.GetBeaconKeyOutput) awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput { +func VersionKeyInput_FromDafny(dafnyInput AwsCryptographyKeyStoreTypes.VersionKeyInput) awscryptographykeystoresmithygeneratedtypes.VersionKeyInput { - return awscryptographykeystoresmithygeneratedtypes.GetBeaconKeyOutput{BeaconKeyMaterials: aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(dafnyOutput.Dtor_beaconKeyMaterials())} + return awscryptographykeystoresmithygeneratedtypes.VersionKeyInput{BranchKeyIdentifier: aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(dafnyInput.Dtor_branchKeyIdentifier())} + +} + +func VersionKeyOutput_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.VersionKeyOutput) awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput { + + return awscryptographykeystoresmithygeneratedtypes.VersionKeyOutput{} } @@ -174,51 +174,7 @@ func KeyStoreConfig_FromDafny(dafnyOutput AwsCryptographyKeyStoreTypes.KeyStoreC } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.KMSConfiguration { - var union awscryptographykeystoresmithygeneratedtypes.KMSConfiguration - - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsKeyArn() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsKeyArn()) - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn{ - Value: (aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsMRKeyArn() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsMRKeyArn()) - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn{ - Value: (aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_discovery() { - - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery{ - Value: (aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_discovery())), - } - } - if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_mrDiscovery() { - - union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery{ - Value: (aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_mrDiscovery())), - } - } - - return union - -} -func aws_cryptography_keyStore_KeyStoreException_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_keyStore_KeyStoreConfig_id_FromDafny(input interface{}) *string { +func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -234,15 +190,22 @@ func aws_cryptography_keyStore_KeyStoreConfig_id_FromDafny(input interface{}) *s } }() } -func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") +func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil } - return shim.Client + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m } -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -250,12 +213,18 @@ func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_From if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -263,46 +232,31 @@ func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_FromDaf if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.Discovery { - return awscryptographykeystoresmithygeneratedtypes.Discovery{} -} -func aws_cryptography_keyStore_CreateKeyInput_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_keyStore_CreateKeyInput_branchKeyIdentifier_FromDafny(input interface{}) *string { - return func() *string { +func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_FromDafny(input interface{}) string { + return func() string { var s string - if input == nil { - return nil - } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return s } else { s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -310,18 +264,12 @@ func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{} if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -334,7 +282,14 @@ func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(i } }() } -func aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), + BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), + EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), + BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), + } +} +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -347,7 +302,7 @@ func aws_cryptography_keyStore_CreateKeyStoreOutput_tableArn_FromDafny(input int } }() } -func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -355,7 +310,13 @@ func aws_cryptography_keyStore_GetActiveBranchKeyInput_branchKeyIdentifier_FromD if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() @@ -375,7 +336,23 @@ func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(in return m } -func aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_keyStore_GetBeaconKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -388,31 +365,40 @@ func aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input interface{}) s } }() } -func aws_cryptography_keyStore_GetActiveBranchKeyOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), - BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), - EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), - BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), +func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), + EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), + BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), + HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), } } -func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_FromDafny(input interface{}) *dynamodb.Client { - shim, ok := input.(*DynamoDBwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_keyStore_GrantTokenList_member_FromDafny(val)) + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m + } func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input interface{}) []byte { return func() []byte { @@ -430,21 +416,8 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input inte } }() } -func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { + var m map[string][]byte = make(map[string][]byte) if input == nil { return nil } @@ -453,12 +426,12 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(in if !ok { break } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } -func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -471,7 +444,7 @@ func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_FromDafny(inpu } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -487,7 +460,7 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input inte } }() } -func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -500,7 +473,7 @@ func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_FromDafny(input inter } }() } -func aws_cryptography_keyStore_GrantTokenList_member_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetBranchKeyVersionInput_branchKeyVersion_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -513,7 +486,14 @@ func aws_cryptography_keyStore_GrantTokenList_member_FromDafny(input interface{} } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), + BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), + EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), + BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), + } +} +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -526,7 +506,7 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny( } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -539,7 +519,7 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny( } }() } -func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -552,7 +532,18 @@ func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) strin } }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_grantTokens_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_keyStore_GrantTokenList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_keyStore_GrantTokenList_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -565,7 +556,38 @@ func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreName_FromDafny(inpu } }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_GetKeyStoreInfoOutput_kmsConfiguration_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.KMSConfiguration { + var union awscryptographykeystoresmithygeneratedtypes.KMSConfiguration + + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsKeyArn() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsKeyArn()) + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsKeyArn{ + Value: (aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_kmsMRKeyArn() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_kmsMRKeyArn()) + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberkmsMRKeyArn{ + Value: (aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_discovery() { + + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMemberdiscovery{ + Value: (aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_discovery())), + } + } + if (input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Is_mrDiscovery() { + + union = &awscryptographykeystoresmithygeneratedtypes.KMSConfigurationMembermrDiscovery{ + Value: (aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny((input.(AwsCryptographyKeyStoreTypes.KMSConfiguration)).Dtor_mrDiscovery())), + } + } + + return union + +} +func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -578,7 +600,7 @@ func aws_cryptography_keyStore_GetKeyStoreInfoOutput_keyStoreId_FromDafny(input } }() } -func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KMSConfiguration_kmsMRKeyArn_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -586,18 +608,18 @@ func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KMSConfiguration_discovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.Discovery { + return awscryptographykeystoresmithygeneratedtypes.Discovery{} +} +func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.MRDiscovery { + return awscryptographykeystoresmithygeneratedtypes.MRDiscovery{Region: aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input.(AwsCryptographyKeyStoreTypes.MRDiscovery).Dtor_region())} +} +func aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -610,10 +632,7 @@ func aws_cryptography_keyStore_KMSConfiguration_kmsKeyArn_FromDafny(input interf } }() } -func aws_cryptography_keyStore_KMSConfiguration_mrDiscovery_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.MRDiscovery { - return awscryptographykeystoresmithygeneratedtypes.MRDiscovery{Region: aws_cryptography_keyStore_MRDiscovery_region_FromDafny(input.(AwsCryptographyKeyStoreTypes.MRDiscovery).Dtor_region())} -} -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -621,25 +640,25 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(inp if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_GetBeaconKeyOutput_beaconKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), - EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), - BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), - HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), - } +func aws_cryptography_keyStore_KeyStoreException_message_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } -func aws_cryptography_keyStore_GetKeyStoreInfoOutput_logicalKeyStoreName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KeyStoreConfig_ddbTableName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -683,23 +702,7 @@ func aws_cryptography_keyStore_KeyStoreConfig_kmsConfiguration_FromDafny(input i return union } -func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_KeyStoreConfig_logicalKeyStoreName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -712,28 +715,16 @@ func aws_cryptography_keyStore_VersionKeyInput_branchKeyIdentifier_FromDafny(inp } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { - var m map[string][]byte = make(map[string][]byte) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_keyStore_CreateKeyOutput_branchKeyIdentifier_FromDafny(input interface{}) string { - return func() string { +func aws_cryptography_keyStore_KeyStoreConfig_id_FromDafny(input interface{}) *string { + return func() *string { var s string + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } @@ -754,10 +745,19 @@ func aws_cryptography_keyStore_KeyStoreConfig_grantTokens_FromDafny(input interf } return fieldValue } -func aws_cryptography_keyStore_GetBranchKeyVersionOutput_branchKeyMaterials_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), - BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), - EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), - BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), +func aws_cryptography_keyStore_KeyStoreConfig_ddbClient_FromDafny(input interface{}) *dynamodb.Client { + shim, ok := input.(*DynamoDBwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_keyStore_KeyStoreConfig_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") } + return shim.Client + } diff --git a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go index b3773db60..3b020a46b 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_dafny.go @@ -24,15 +24,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func CreateAwsKmsKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { - - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsKeyringInput_.Create_CreateAwsKmsKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) - }() - -} - func CreateAwsKmsDiscoveryKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput { return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput { @@ -42,20 +33,6 @@ func CreateAwsKmsDiscoveryKeyringInput_ToDafny(nativeInput awscryptographymateri } -func CreateAwsKmsMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { - - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMultiKeyringInput_.Create_CreateAwsKmsMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { - if (nativeInput.ClientSupplier) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) - }(), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) - }() - -} - func CreateAwsKmsDiscoveryMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput { return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput { @@ -70,25 +47,34 @@ func CreateAwsKmsDiscoveryMultiKeyringInput_ToDafny(nativeInput awscryptographym } -func CreateAwsKmsMrkKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { +func CreateAwsKmsEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkKeyringInput_.Create_CreateAwsKmsMrkKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsEcdhKeyringInput_.Create_CreateAwsKmsEcdhKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(nativeInput.KeyAgreementScheme), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(nativeInput.CurveSpec), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) }() } -func CreateAwsKmsMrkMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { +func CreateAwsKmsHierarchicalKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkMultiKeyringInput_.Create_CreateAwsKmsMrkMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { - if (nativeInput.ClientSupplier) == nil { + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsHierarchicalKeyringInput_.Create_CreateAwsKmsHierarchicalKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(nativeInput.BranchKeyId), func() Wrappers.Option { + if (nativeInput.BranchKeyIdSupplier) == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) - }(), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + return Wrappers.Companion_Option_.Create_Some_(BranchKeyIdSupplier_ToDafny(nativeInput.BranchKeyIdSupplier)) + }(), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(nativeInput.KeyStore), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(nativeInput.TtlSeconds), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(nativeInput.Cache), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(nativeInput.PartitionId)) + }() + +} + +func CreateAwsKmsKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsKeyringInput_.Create_CreateAwsKmsKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) }() } @@ -116,16 +102,39 @@ func CreateAwsKmsMrkDiscoveryMultiKeyringInput_ToDafny(nativeInput awscryptograp } -func CreateAwsKmsHierarchicalKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { +func CreateAwsKmsMrkKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsHierarchicalKeyringInput_.Create_CreateAwsKmsHierarchicalKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(nativeInput.BranchKeyId), func() Wrappers.Option { - if (nativeInput.BranchKeyIdSupplier) == nil { + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkKeyringInput_.Create_CreateAwsKmsMrkKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(nativeInput.KmsKeyId), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + }() + +} + +func CreateAwsKmsMrkMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMrkMultiKeyringInput_.Create_CreateAwsKmsMrkMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { + if (nativeInput.ClientSupplier) == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(BranchKeyIdSupplier_ToDafny(nativeInput.BranchKeyIdSupplier)) - }(), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(nativeInput.KeyStore), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(nativeInput.TtlSeconds), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(nativeInput.Cache), aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(nativeInput.PartitionId)) + return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) + }(), aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + }() + +} + +func CreateAwsKmsMultiKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsMultiKeyringInput_.Create_CreateAwsKmsMultiKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(nativeInput.Generator), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(nativeInput.KmsKeyIds), func() Wrappers.Option { + if (nativeInput.ClientSupplier) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ClientSupplier_ToDafny(nativeInput.ClientSupplier)) + }(), aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) }() } @@ -139,11 +148,29 @@ func CreateAwsKmsRsaKeyringInput_ToDafny(nativeInput awscryptographymaterialprov } -func CreateAwsKmsEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { +func CreateCryptographicMaterialsCacheInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput) AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateAwsKmsEcdhKeyringInput_.Create_CreateAwsKmsEcdhKeyringInput_(aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(nativeInput.KeyAgreementScheme), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(nativeInput.CurveSpec), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(nativeInput.KmsClient), aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(nativeInput.GrantTokens)) + return AwsCryptographyMaterialProvidersTypes.Companion_CreateCryptographicMaterialsCacheInput_.Create_CreateCryptographicMaterialsCacheInput_(aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(nativeInput.Cache)) + }() + +} + +func CreateDefaultClientSupplierInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultClientSupplierInput_.Create_CreateDefaultClientSupplierInput_() + }() + +} + +func CreateDefaultCryptographicMaterialsManagerInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { + + return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultCryptographicMaterialsManagerInput_.Create_CreateDefaultCryptographicMaterialsManagerInput_(Keyring_ToDafny(nativeInput.Keyring)) }() } @@ -171,15 +198,6 @@ func CreateRawAesKeyringInput_ToDafny(nativeInput awscryptographymaterialprovide } -func CreateRawRsaKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - - return func() AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_CreateRawRsaKeyringInput_.Create_CreateRawRsaKeyringInput_(aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(nativeInput.KeyNamespace), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(nativeInput.KeyName), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(nativeInput.PaddingScheme), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(nativeInput.PrivateKey)) - }() - -} - func CreateRawEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput { return func() AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput { @@ -189,11 +207,11 @@ func CreateRawEcdhKeyringInput_ToDafny(nativeInput awscryptographymaterialprovid } -func CreateDefaultCryptographicMaterialsManagerInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { +func CreateRawRsaKeyringInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput) AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput { + return func() AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultCryptographicMaterialsManagerInput_.Create_CreateDefaultCryptographicMaterialsManagerInput_(Keyring_ToDafny(nativeInput.Keyring)) + return AwsCryptographyMaterialProvidersTypes.Companion_CreateRawRsaKeyringInput_.Create_CreateRawRsaKeyringInput_(aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(nativeInput.KeyNamespace), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(nativeInput.KeyName), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(nativeInput.PaddingScheme), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(nativeInput.PrivateKey)) }() } @@ -217,38 +235,35 @@ func CreateRequiredEncryptionContextCMMInput_ToDafny(nativeInput awscryptography } -func CreateCryptographicMaterialsCacheInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput) AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { +func DecryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateCryptographicMaterialsCacheInput_.Create_CreateCryptographicMaterialsCacheInput_(aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(nativeInput.Cache)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(nativeInput.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(nativeInput.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(nativeInput.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(nativeInput.SymmetricSigningKey)) }() } -func CreateDefaultClientSupplierInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput) AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { +func EncryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return AwsCryptographyMaterialProvidersTypes.Companion_CreateDefaultClientSupplierInput_.Create_CreateDefaultClientSupplierInput_() + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(nativeInput.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(nativeInput.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(nativeInput.SymmetricSigningKeys)) }() } -func InitializeEncryptionMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput) AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { - - return func() AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { +func GetAlgorithmSuiteInfoInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput) dafny.Sequence { - return AwsCryptographyMaterialProvidersTypes.Companion_InitializeEncryptionMaterialsInput_.Create_InitializeEncryptionMaterialsInput_(aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(nativeInput.VerificationKey)) - }() + return Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(nativeInput.BinaryId) } -func EncryptionMaterials_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { +func AlgorithmSuiteInfo_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(nativeOutput.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(nativeOutput.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(nativeOutput.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeOutput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(nativeOutput.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(nativeOutput.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(nativeOutput.SymmetricSigningKeys)) + return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(nativeOutput.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(nativeOutput.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(nativeOutput.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(nativeOutput.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(nativeOutput.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(nativeOutput.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(nativeOutput.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(nativeOutput.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(nativeOutput.EdkWrapping)) }() } @@ -262,62 +277,47 @@ func InitializeDecryptionMaterialsInput_ToDafny(nativeInput awscryptographymater } -func DecryptionMaterials_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(nativeOutput.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(nativeOutput.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(nativeOutput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(nativeOutput.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(nativeOutput.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(nativeOutput.SymmetricSigningKey)) - }() - -} - -func ValidEncryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { +func InitializeEncryptionMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput) AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { + return func() AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidEncryptionMaterialsTransitionInput_.Create_ValidEncryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) + return AwsCryptographyMaterialProvidersTypes.Companion_InitializeEncryptionMaterialsInput_.Create_InitializeEncryptionMaterialsInput_(aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(nativeInput.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(nativeInput.VerificationKey)) }() } -func ValidDecryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { +func ValidateCommitmentPolicyOnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { + return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidDecryptionMaterialsTransitionInput_.Create_ValidDecryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnDecryptInput_.Create_ValidateCommitmentPolicyOnDecryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) }() } -func GetAlgorithmSuiteInfoInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput) dafny.Sequence { - - return Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(nativeInput.BinaryId) - -} - -func AlgorithmSuiteInfo_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { +func ValidateCommitmentPolicyOnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { - return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(nativeOutput.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(nativeOutput.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(nativeOutput.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(nativeOutput.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(nativeOutput.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(nativeOutput.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(nativeOutput.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(nativeOutput.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(nativeOutput.EdkWrapping)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnEncryptInput_.Create_ValidateCommitmentPolicyOnEncryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) }() } -func ValidateCommitmentPolicyOnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { +func ValidDecryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput { + return func() AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnEncryptInput_.Create_ValidateCommitmentPolicyOnEncryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidDecryptionMaterialsTransitionInput_.Create_ValidDecryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) }() } -func ValidateCommitmentPolicyOnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput) AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { +func ValidEncryptionMaterialsTransitionInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput) AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { - return func() AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput { + return func() AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput { - return AwsCryptographyMaterialProvidersTypes.Companion_ValidateCommitmentPolicyOnDecryptInput_.Create_ValidateCommitmentPolicyOnDecryptInput_(aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(nativeInput.Algorithm), aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy)) + return AwsCryptographyMaterialProvidersTypes.Companion_ValidEncryptionMaterialsTransitionInput_.Create_ValidEncryptionMaterialsTransitionInput_(aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(nativeInput.Start), aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(nativeInput.Stop)) }() } @@ -367,47 +367,38 @@ func ClientSupplier_ToDafny(nativeResource awscryptographymaterialproviderssmith } -func OnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput) AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - - return func() AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptInput_.Create_OnEncryptInput_(aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(nativeInput.Materials)) - }() - -} - -func OnEncryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput) AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { +func DeleteCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput) AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { - return func() AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { + return func() AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { - return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptOutput_.Create_OnEncryptOutput_(aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(nativeOutput.Materials)) + return AwsCryptographyMaterialProvidersTypes.Companion_DeleteCacheEntryInput_.Create_DeleteCacheEntryInput_(aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(nativeInput.Identifier)) }() } -func Keyring_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) AwsCryptographyMaterialProvidersTypes.IKeyring { - val, ok := nativeResource.(*Keyring) +func CryptographicMaterialsCache_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache { + val, ok := nativeResource.(*CryptographicMaterialsCache) if ok { return val.Impl } - return Keyring{&KeyringNativeWrapper{Impl: nativeResource}}.Impl + return CryptographicMaterialsCache{&CryptographicMaterialsCacheNativeWrapper{Impl: nativeResource}}.Impl } -func OnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput) AwsCryptographyMaterialProvidersTypes.OnDecryptInput { +func GetCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { - return func() AwsCryptographyMaterialProvidersTypes.OnDecryptInput { + return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { - return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptInput_.Create_OnDecryptInput_(aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(nativeInput.Materials), aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys)) + return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryInput_.Create_GetCacheEntryInput_(aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) }() } -func OnDecryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput) AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { +func GetCacheEntryOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { - return func() AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { + return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { - return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptOutput_.Create_OnDecryptOutput_(aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(nativeOutput.Materials)) + return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryOutput_.Create_GetCacheEntryOutput_(aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(nativeOutput.Materials), aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(nativeOutput.CreationTime), aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(nativeOutput.ExpiryTime), aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(nativeOutput.MessagesUsed), aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(nativeOutput.BytesUsed)) }() } @@ -421,50 +412,41 @@ func PutCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmit } -func CryptographicMaterialsCache_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache { - val, ok := nativeResource.(*CryptographicMaterialsCache) - if ok { - return val.Impl - } - return CryptographicMaterialsCache{&CryptographicMaterialsCacheNativeWrapper{Impl: nativeResource}}.Impl - -} - -func GetCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { +func UpdateUsageMetadataInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput) AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { - return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput { + return func() AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { - return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryInput_.Create_GetCacheEntryInput_(aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) + return AwsCryptographyMaterialProvidersTypes.Companion_UpdateUsageMetadataInput_.Create_UpdateUsageMetadataInput_(aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) }() } -func GetCacheEntryOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput) AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { +func DecryptMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { - return func() AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput { + return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { - return AwsCryptographyMaterialProvidersTypes.Companion_GetCacheEntryOutput_.Create_GetCacheEntryOutput_(aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(nativeOutput.Materials), aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(nativeOutput.CreationTime), aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(nativeOutput.ExpiryTime), aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(nativeOutput.MessagesUsed), aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(nativeOutput.BytesUsed)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsInput_.Create_DecryptMaterialsInput_(aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(nativeInput.ReproducedEncryptionContext)) }() } -func UpdateUsageMetadataInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput) AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { +func DecryptMaterialsOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { - return func() AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput { + return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { - return AwsCryptographyMaterialProvidersTypes.Companion_UpdateUsageMetadataInput_.Create_UpdateUsageMetadataInput_(aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(nativeInput.Identifier), aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(nativeInput.BytesUsed)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsOutput_.Create_DecryptMaterialsOutput_(aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(nativeOutput.DecryptionMaterials)) }() } -func DeleteCacheEntryInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput) AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { +func CryptographicMaterialsManager_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager { + val, ok := nativeResource.(*CryptographicMaterialsManager) + if ok { + return val.Impl + } + return CryptographicMaterialsManager{&CryptographicMaterialsManagerNativeWrapper{Impl: nativeResource}}.Impl - return func() AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput { - - return AwsCryptographyMaterialProvidersTypes.Companion_DeleteCacheEntryInput_.Create_DeleteCacheEntryInput_(aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(nativeInput.Identifier)) - }() - -} +} func GetEncryptionMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput) AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsInput { @@ -484,93 +466,111 @@ func GetEncryptionMaterialsOutput_ToDafny(nativeOutput awscryptographymaterialpr } -func CryptographicMaterialsManager_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager) AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager { - val, ok := nativeResource.(*CryptographicMaterialsManager) +func OnDecryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput) AwsCryptographyMaterialProvidersTypes.OnDecryptInput { + + return func() AwsCryptographyMaterialProvidersTypes.OnDecryptInput { + + return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptInput_.Create_OnDecryptInput_(aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(nativeInput.Materials), aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys)) + }() + +} + +func OnDecryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput) AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { + + return func() AwsCryptographyMaterialProvidersTypes.OnDecryptOutput { + + return AwsCryptographyMaterialProvidersTypes.Companion_OnDecryptOutput_.Create_OnDecryptOutput_(aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(nativeOutput.Materials)) + }() + +} + +func Keyring_ToDafny(nativeResource awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) AwsCryptographyMaterialProvidersTypes.IKeyring { + val, ok := nativeResource.(*Keyring) if ok { return val.Impl } - return CryptographicMaterialsManager{&CryptographicMaterialsManagerNativeWrapper{Impl: nativeResource}}.Impl + return Keyring{&KeyringNativeWrapper{Impl: nativeResource}}.Impl } -func DecryptMaterialsInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { +func OnEncryptInput_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput) AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput { + return func() AwsCryptographyMaterialProvidersTypes.OnEncryptInput { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsInput_.Create_DecryptMaterialsInput_(aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(nativeInput.AlgorithmSuiteId), aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(nativeInput.CommitmentPolicy), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(nativeInput.EncryptedDataKeys), aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(nativeInput.EncryptionContext), aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(nativeInput.ReproducedEncryptionContext)) + return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptInput_.Create_OnEncryptInput_(aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(nativeInput.Materials)) }() } -func DecryptMaterialsOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput) AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { +func OnEncryptOutput_ToDafny(nativeOutput awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput) AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { - return func() AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput { + return func() AwsCryptographyMaterialProvidersTypes.OnEncryptOutput { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptMaterialsOutput_.Create_DecryptMaterialsOutput_(aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(nativeOutput.DecryptionMaterials)) + return AwsCryptographyMaterialProvidersTypes.Companion_OnEncryptOutput_.Create_OnEncryptOutput_(aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(nativeOutput.Materials)) }() } -func InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt) AwsCryptographyMaterialProvidersTypes.Error { +func AwsCryptographicMaterialProvidersException_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnDecrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_AwsCryptographicMaterialProvidersException_(aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(nativeInput.Message)) }() } -func InvalidEncryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { +func EntryAlreadyExists_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterials_(aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryAlreadyExists_(aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(nativeInput.Message)) }() } -func InvalidAlgorithmSuiteInfoOnEncrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt) AwsCryptographyMaterialProvidersTypes.Error { +func EntryDoesNotExist_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnEncrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryDoesNotExist_(aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(nativeInput.Message)) }() } -func InvalidEncryptionMaterialsTransition_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition) AwsCryptographyMaterialProvidersTypes.Error { +func InFlightTTLExceeded_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterialsTransition_(aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InFlightTTLExceeded_(aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(nativeInput.Message)) }() } -func InFlightTTLExceeded_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidAlgorithmSuiteInfo_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InFlightTTLExceeded_(aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfo_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(nativeInput.Message)) }() } -func EntryAlreadyExists_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryAlreadyExists_(aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnDecrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(nativeInput.Message)) }() } -func AwsCryptographicMaterialProvidersException_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidAlgorithmSuiteInfoOnEncrypt_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_AwsCryptographicMaterialProvidersException_(aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfoOnEncrypt_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(nativeInput.Message)) }() } -func InvalidAlgorithmSuiteInfo_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidDecryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidAlgorithmSuiteInfo_(aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidDecryptionMaterials_(aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(nativeInput.Message)) }() } @@ -583,18 +583,18 @@ func InvalidDecryptionMaterialsTransition_ToDafny(nativeInput awscryptographymat } -func EntryDoesNotExist_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidEncryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_EntryDoesNotExist_(aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterials_(aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(nativeInput.Message)) }() } -func InvalidDecryptionMaterials_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials) AwsCryptographyMaterialProvidersTypes.Error { +func InvalidEncryptionMaterialsTransition_ToDafny(nativeInput awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition) AwsCryptographyMaterialProvidersTypes.Error { return func() AwsCryptographyMaterialProvidersTypes.Error { - return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidDecryptionMaterials_(aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(nativeInput.Message)) + return AwsCryptographyMaterialProvidersTypes.Companion_Error_.Create_InvalidEncryptionMaterialsTransition_(aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(nativeInput.Message)) }() } @@ -613,38 +613,38 @@ func OpaqueError_Input_ToDafny(nativeInput awscryptographymaterialproviderssmith func Error_ToDafny(err error) AwsCryptographyMaterialProvidersTypes.Error { switch err.(type) { // Service Errors - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials: - return InvalidEncryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials)) - - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo: - return InvalidAlgorithmSuiteInfo_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo)) - - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition: - return InvalidEncryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition)) - - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt: - return InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt)) + case awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException: + return AwsCryptographicMaterialProvidersException_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException)) case awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists: return EntryAlreadyExists_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists)) - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition: - return InvalidDecryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition)) + case awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist: + return EntryDoesNotExist_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist)) case awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded: return InFlightTTLExceeded_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded)) - case awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist: - return EntryDoesNotExist_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist)) + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo: + return InvalidAlgorithmSuiteInfo_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo)) - case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials: - return InvalidDecryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials)) + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt: + return InvalidAlgorithmSuiteInfoOnDecrypt_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt)) case awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt: return InvalidAlgorithmSuiteInfoOnEncrypt_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt)) - case awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException: - return AwsCryptographicMaterialProvidersException_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException)) + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials: + return InvalidDecryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials)) + + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition: + return InvalidDecryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition)) + + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials: + return InvalidEncryptionMaterials_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials)) + + case awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition: + return InvalidEncryptionMaterialsTransition_ToDafny(err.(awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition)) //DependentErrors case awscryptographyprimitivessmithygeneratedtypes.AwsCryptographicPrimitivesBaseException: @@ -696,161 +696,154 @@ func MaterialProvidersConfig_ToDafny(nativeInput awscryptographymaterialprovider } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} + +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault: - var inputToConversion = aws_cryptography_materialProviders_CacheType_Default_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo: - var inputToConversion = aws_cryptography_materialProviders_CacheType_No_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded: - var inputToConversion = aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded: - var inputToConversion = aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking: - var inputToConversion = aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache))) - case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared: - var inputToConversion = func() Wrappers.Option { - if (input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value) == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(CryptographicMaterialsCache_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value)) - }() - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))) - - default: - panic("Unhandled union type") - } + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA: - var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_ECDSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ECDSA)) - case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - default: - panic("Unhandled union type") + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.HKDF) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_HKDF_.Create_HKDF_(aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input.Hmac), aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input.SaltLength), aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input.InputKeyLength), aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input.OutputKeyLength))) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { +func aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) + element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_RegionList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_RawPrivateKeyToStaticPublicKeyInput_.Create_RawPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input.SenderStaticPrivateKey), aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_ToDafny(input *int64) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPublicKeyDiscoveryInput_.Create_KmsPublicKeyDiscoveryInput_(aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input.RecipientKmsIdentifier))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) }() } -func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(input *int64) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) - }() -} +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { + return func() AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery: + var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey: + var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPublicKeyDiscoveryInput_.Create_KmsPublicKeyDiscoveryInput_(aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input.RecipientKmsIdentifier))) + }() +} + +func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPrivateKeyToStaticPublicKeyInput_.Create_KmsPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input.SenderKmsIdentifier), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + }() +} + +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -863,67 +856,100 @@ func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDa }() } -func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return input + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} + +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) AwsCryptographyMaterialProvidersTypes.CacheType { - return func() AwsCryptographyMaterialProvidersTypes.CacheType { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(input *awscryptographykeystoresmithygenerated.Client) AwsCryptographyKeyStoreTypes.IKeyStoreClient { + return input.DafnyClient +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(input int64) int64 { + return func() int64 { + + return input + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } switch input.(type) { case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault: var inputToConversion = aws_cryptography_materialProviders_CacheType_Default_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo: var inputToConversion = aws_cryptography_materialProviders_CacheType_No_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded: var inputToConversion = aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded: var inputToConversion = aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking: var inputToConversion = aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache))) case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared: var inputToConversion = func() Wrappers.Option { if (input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value) == nil { @@ -931,7 +957,7 @@ func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_c } return Wrappers.Companion_Option_.Create_Some_(CryptographicMaterialsCache_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value)) }() - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))) default: panic("Unhandled union type") @@ -939,68 +965,65 @@ func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_c }() } -func aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input int32) int32 { +func aws_cryptography_materialProviders_CacheType_Default_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DefaultCache_.Create_DefaultCache_(aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input.EntryCapacity))) + }() +} + +func aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { - return func() AwsCryptographyMaterialProvidersTypes.Encrypt { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: - var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) +func aws_cryptography_materialProviders_CacheType_No_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.NoCache) Wrappers.Option { + return func() Wrappers.Option { - default: - panic("Unhandled union type") - } + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_NoCache_.Create_NoCache_()) }() } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache) Wrappers.Option { + return func() Wrappers.Option { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_SingleThreadedCache_.Create_SingleThreadedCache_(aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) }() } -func Aws_cryptography_materialProviders_GetClientOutput_client_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} +func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { +func aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache) Wrappers.Option { + return func() Wrappers.Option { - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_MultiThreadedCache_.Create_MultiThreadedCache_(aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) + }() +} - default: - panic("Unhandled union type") - } +func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_ToDafny(input *int32) Wrappers.Option { +func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1009,277 +1032,277 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_ToDafny(inp }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_StormTrackingCache_.Create_StormTrackingCache_(aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize), aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input.GracePeriod), aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input.GraceInterval), aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input.FanOut), aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input.InFlightTTL), aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input.SleepMilli), aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input.TimeUnits))) }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} -} +func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input int32) int32 { + return func() int32 { -func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return input }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input int32) int32 { + return func() int32 { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return input }() } -func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) +func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input int32) int32 { + return func() int32 { - default: - panic("Unhandled union type") - } + return input }() } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg) AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { - return func() AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { - var index int for _, enumVal := range input.Values() { index++ - if enumVal == input { + if enumVal == *input { break } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits)) }() } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId))) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + }() +} - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { + return &KMSwrapped.Shim{Client: input} +} - return input +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input int32) int32 { - return func() int32 { - - return input +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { - - return input +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) @@ -1300,57 +1323,98 @@ func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantToken }() } -func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { - - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { break } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) }() } -func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { + return func() Wrappers.Option { + if (input) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) + }() +} - return input +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { +func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CacheType) AwsCryptographyMaterialProvidersTypes.CacheType { + return func() AwsCryptographyMaterialProvidersTypes.CacheType { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC: - var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_HMAC_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) - case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault: + var inputToConversion = aws_cryptography_materialProviders_CacheType_Default_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Default_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DefaultCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo: + var inputToConversion = aws_cryptography_materialProviders_CacheType_No_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_No_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.NoCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded: + var inputToConversion = aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_SingleThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded: + var inputToConversion = aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_MultiThreaded_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking: + var inputToConversion = aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_StormTracking_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.StormTrackingCache)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared: + var inputToConversion = func() Wrappers.Option { + if (input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value) == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(CryptographicMaterialsCache_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared).Value)) + }() + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CacheType_{}.Create_Shared_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache)) default: panic("Unhandled union type") @@ -1358,6 +1422,18 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_To }() } +func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) dafny.Sequence { + return func() dafny.Sequence { + + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := Keyring_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { @@ -1365,18 +1441,28 @@ func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_To }() } -func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil } - return fieldValue.ToMap() + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { - return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg) AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { + return func() AwsCryptographyMaterialProvidersTypes.AesWrappingAlg { var index int for _, enumVal := range input.Values() { @@ -1386,75 +1472,78 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_T } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) + return enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) }() } -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { + return func() AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { + + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery: + var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_PublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey: + var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_RawPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey: + var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_EphemeralPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput)) + + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput) Wrappers.Option { return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_PublicKeyDiscoveryInput_.Create_PublicKeyDiscoveryInput_(aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input.RecipientStaticPrivateKey))) + }() +} + +func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) - }() -} - -func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput) Wrappers.Option { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_PublicKeyDiscoveryInput_.Create_PublicKeyDiscoveryInput_(aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input.RecipientStaticPrivateKey))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_RawPrivateKeyToStaticPublicKeyInput_.Create_RawPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input.SenderStaticPrivateKey), aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) - - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1467,34 +1556,28 @@ func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(i }() } -func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput) Wrappers.Option { + return func() Wrappers.Option { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EphemeralPrivateKeyToStaticPublicKeyInput_.Create_EphemeralPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int for _, enumVal := range input.Values() { @@ -1504,34 +1587,33 @@ func aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input awscryptograph } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { + return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { var index int for _, enumVal := range input.Values() { @@ -1541,52 +1623,87 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input awscr } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) - }() -} - -func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(input int64) int64 { - return func() int64 { - - return input + return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { - return func() AwsCryptographyMaterialProvidersTypes.Encrypt { +func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + + return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) + }() +} + +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: - var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) default: panic("Unhandled union type") @@ -1594,68 +1711,77 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} -func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { - return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_ToDafny(input *kms.Client) Wrappers.Option { +func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId) Wrappers.Option { return func() Wrappers.Option { - if (input) == nil { - return Wrappers.Companion_Option_.Create_None_() + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(&KMSwrapped.Shim{Client: input}) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { + return func() AwsCryptographyMaterialProvidersTypes.Encrypt { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: + var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) default: panic("Unhandled union type") @@ -1663,41 +1789,47 @@ func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKey }() } -func aws_cryptography_materialProviders_CacheType_Default_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache) Wrappers.Option { +func aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DefaultCache_.Create_DefaultCache_(aws_cryptography_materialProviders_DefaultCache_entryCapacity_ToDafny(input.EntryCapacity))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength))) }() } -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { + return func() int32 { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return input }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} +func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) default: panic("Unhandled union type") @@ -1705,15 +1837,15 @@ func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPo }() } -func aws_cryptography_materialProviders_CacheType_MultiThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache) Wrappers.Option { +func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.HKDF) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_MultiThreadedCache_.Create_MultiThreadedCache_(aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_HKDF_.Create_HKDF_(aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input.Hmac), aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input.SaltLength), aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input.InputKeyLength), aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input.OutputKeyLength))) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int for _, enumVal := range input.Values() { @@ -1723,102 +1855,82 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input awsc } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKAlgorithmSuiteId_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input int32) int32 { + return func() int32 { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DIRECT__KEY__WRAPPING_.Create_DIRECT__KEY__WRAPPING_()) + return input }() } -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_HKDF_inputKeyLength_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) + return input }() } -func aws_cryptography_materialProviders_GetClientInput_region_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input int32) int32 { + return func() int32 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IDENTITY_.Create_IDENTITY_()) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { + return func() Wrappers.Option { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) }() } -func aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { -func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input int32) int32 { - return func() int32 { + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) - return input + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA: + var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_ECDSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ECDSA)) + case *awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) default: panic("Unhandled union type") @@ -1826,292 +1938,278 @@ func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_c }() } -func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ECDSA) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_ECDSA_.Create_ECDSA_(aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input.Curve))) }() } -func aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { +func aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) }() } -func aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_SignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { + return func() Wrappers.Option { - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) }() } -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm) AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC: + var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_HMAC_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) + case *awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_SymmetricSignatureAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) Wrappers.Option { + return func() Wrappers.Option { - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break } - return f - }()...) + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_ToDafny(input int64) int64 { - return func() int64 { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm) AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { - return input - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: + var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_DIRECT__KEY__WRAPPING_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DIRECT__KEY__WRAPPING)) + case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping: + var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_IntermediateKeyWrapping_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping)) -func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING) Wrappers.Option { + return func() Wrappers.Option { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DIRECT__KEY__WRAPPING_.Create_DIRECT__KEY__WRAPPING_()) }() } -func aws_cryptography_materialProviders_CacheType_SingleThreaded_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache) Wrappers.Option { +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_SingleThreadedCache_.Create_SingleThreadedCache_(aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IntermediateKeyWrapping_.Create_IntermediateKeyWrapping_(aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input.KeyEncryptionKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input.MacKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input.PdkEncryptAlgorithm))) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} -} - -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return input - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) -func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { + return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) + case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: + var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Encrypt) AwsCryptographyMaterialProvidersTypes.Encrypt { + return func() AwsCryptographyMaterialProvidersTypes.Encrypt { - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM: + var inputToConversion = aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Encrypt_{}.Create_AES__GCM_(inputToConversion.UnwrapOr(nil).(AwsCryptographyPrimitivesTypes.AES__GCM)) -func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + default: + panic("Unhandled union type") } - return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy) Wrappers.Option { - return func() Wrappers.Option { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBECommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } +func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } +func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_ToDafny(input *string) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) - }() -} - -func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ECDSA) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_ECDSA_.Create_ECDSA_(aws_cryptography_materialProviders_ECDSA_curve_ToDafny(input.Curve))) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return dafny.SeqOfChars([]dafny.Char(input)...) + return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) }() } -func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) +func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } @@ -2127,165 +2225,120 @@ func aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_To }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { + return func() AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptedDataKey_.Create_EncryptedDataKey_(aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input.KeyProviderId), aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input.KeyProviderInfo), aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input.Ciphertext)) }() } -func aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys))) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) - }() -} - -func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { - return func() AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery: - var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput)) - case *awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey: - var inputToConversion = aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_KmsEcdhStaticConfigurations_{}.Create_KmsPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput)) - - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Materials) AwsCryptographyMaterialProvidersTypes.Materials { - return func() AwsCryptographyMaterialProvidersTypes.Materials { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption: - var inputToConversion = aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Encryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials)) - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption: - var inputToConversion = aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Decryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials)) - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey: - var inputToConversion = aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BranchKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BranchKeyMaterials)) - case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey: - var inputToConversion = aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BeaconKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials)) +func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - default: - panic("Unhandled union type") + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits) Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == *input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { - +func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input [][]byte) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + element := aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + var v []interface{} + if input == nil { + return nil } - return fieldValue.ToMap() - }() -} - -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) - case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) - - default: - panic("Unhandled union type") + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2298,7 +2351,24 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_ToDafny(in }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { return func() dafny.Map { fieldValue := dafny.NewMapBuilder() for key, val := range input { @@ -2308,102 +2378,101 @@ func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encry }() } -func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - return input + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { - return func() AwsCryptographyMaterialProvidersTypes.EncryptedDataKey { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptedDataKey_.Create_EncryptedDataKey_(aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_ToDafny(input.KeyProviderId), aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_ToDafny(input.KeyProviderInfo), aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input.Ciphertext)) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { - return input + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } for _, e := range input { v = append(v, e) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) - }() -} - -func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) - }() -} - -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - - return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) - }() -} - -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } for _, e := range input { v = append(v, e) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_ToDafny(input *awscryptographykeystoresmithygenerated.Client) AwsCryptographyKeyStoreTypes.IKeyStoreClient { - return input.DafnyClient -} +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { switch input.(type) { @@ -2420,28 +2489,30 @@ func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_T }() } -func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} +func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy) Wrappers.Option { + return func() Wrappers.Option { -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2451,30 +2522,27 @@ func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_T } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBECommitmentPolicy_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) }() } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations) AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { - return func() AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { + return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery: - var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_PublicKeyDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput)) - case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey: - var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_RawPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput)) - case *awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey: - var inputToConversion = aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_RawEcdhStaticConfigurations_{}.Create_EphemeralPrivateKeyToStaticPublicKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) default: panic("Unhandled union type") @@ -2482,79 +2550,93 @@ func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementSc }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_ToDafny(input int64) int64 { - return func() int64 { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { - return input + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + }() +} - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + }() +} + +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) + }() +} + +func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(input int64) int64 { - return func() int64 { +func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_RegionList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_GetClientInput_region_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { +func Aws_cryptography_materialProviders_GetClientOutput_client_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { return &KMSwrapped.Shim{Client: input} } -func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func aws_cryptography_materialProviders_CacheType_No_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.NoCache) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_NoCache_.Create_NoCache_()) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2567,58 +2649,67 @@ func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInpu }() } -func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) +func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo { +func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.Materials) AwsCryptographyMaterialProvidersTypes.Materials { + return func() AwsCryptographyMaterialProvidersTypes.Materials { - return AwsCryptographyMaterialProvidersTypes.Companion_AlgorithmSuiteInfo_.Create_AlgorithmSuiteInfo_(aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_ToDafny(input.Id), aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_ToDafny(input.BinaryId), aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_ToDafny(input.MessageVersion), aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_ToDafny(input.Encrypt), aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input.Kdf), aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input.Commitment), aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_ToDafny(input.Signature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_ToDafny(input.SymmetricSignature), aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input.EdkWrapping)) + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption: + var inputToConversion = aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Encryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials)) + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption: + var inputToConversion = aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_Decryption_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials)) + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey: + var inputToConversion = aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BranchKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BranchKeyMaterials)) + case *awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey: + var inputToConversion = aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_Materials_{}.Create_BeaconKey_(inputToConversion.UnwrapOr(nil).(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials)) + + default: + panic("Unhandled union type") + } }() } -func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) Wrappers.Option { + return func() Wrappers.Option { - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys))) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { +func aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) Wrappers.Option { return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey))) }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { - return func() dafny.Map { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) - } - return fieldValue.ToMap() +func aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey))) }() } -func aws_cryptography_materialProviders_Materials_Decryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey))) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOf(func() []interface{} { @@ -2633,41 +2724,47 @@ func aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(input stri }() } -func aws_cryptography_materialProviders_HKDF_outputKeyLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) +func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_CacheType_StormTracking_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_keyStore_EncryptionContext_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_StormTrackingCache_.Create_StormTrackingCache_(aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input.EntryCapacity), aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_ToDafny(input.EntryPruningTailSize), aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_ToDafny(input.GracePeriod), aws_cryptography_materialProviders_StormTrackingCache_graceInterval_ToDafny(input.GraceInterval), aws_cryptography_materialProviders_StormTrackingCache_fanOut_ToDafny(input.FanOut), aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_ToDafny(input.InFlightTTL), aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_ToDafny(input.SleepMilli), aws_cryptography_materialProviders_StormTrackingCache_timeUnits_ToDafny(input.TimeUnits))) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_EncryptionContext_value_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2680,181 +2777,102 @@ func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_ToDafny(inpu }() } -func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func aws_cryptography_materialProviders_Encrypt_AES_GCM_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) Wrappers.Option { +func aws_cryptography_materialProviders_Materials_BeaconKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength))) - }() -} - -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BeaconKeyMaterials_.Create_BeaconKeyMaterials_(aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input.BeaconKeyIdentifier), aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input.BeaconKey), aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input.HmacKeys))) }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) - - default: - panic("Unhandled union type") +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) - }() -} - -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_ToDafny(input map[string][]byte) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(key), aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_ToDafny(input int64) int64 { - return func() int64 { - - return input + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func aws_cryptography_materialProviders_KmsKeyIdList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var v []interface{} + if input == nil { + return nil } - return dafny.SeqOf(fieldValue...) - }() -} - -func aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.None) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_None_.Create_None_()) - }() -} - -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) - - default: - panic("Unhandled union type") + for _, e := range input { + v = append(v, e) } + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_ToDafny(input int64) int64 { + return func() int64 { - return dafny.SeqOfChars([]dafny.Char(input)...) + return input }() } -func aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { +func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_ToDafny(input int64) int64 { + return func() int64 { - return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + return input }() } -func aws_cryptography_materialProviders_HKDF_saltLength_ToDafny(input int32) int32 { +func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_materialProviders_Materials_Encryption_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys))) - }() -} +func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(input int32) int32 { + return func() int32 { -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return input }() } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2890,28 +2908,39 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_materials_ToDafny(inp }() } -func aws_cryptography_materialProviders_Materials_BranchKey_ToDafny(input awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_ToDafny(input int64) int64 { + return func() int64 { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyKeyStoreTypes.Companion_BranchKeyMaterials_.Create_BranchKeyMaterials_(aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_ToDafny(input.BranchKeyIdentifier), aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_ToDafny(input.BranchKeyVersion), aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_keyStore_BranchKeyMaterials_branchKey_ToDafny(input.BranchKey))) + return input }() } -func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_ToDafny(input int64) int64 { + return func() int64 { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IDENTITY_.Create_IDENTITY_()) + return input }() } -func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} - return input +func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -2924,35 +2953,14 @@ func aws_cryptography_keyStore_HmacKeyMap_value_ToDafny(input []byte) dafny.Sequ }() } -func aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) - }() -} +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(input int32) int32 { + return func() int32 { -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return input }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { +func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { switch input.(type) { @@ -2969,53 +2977,82 @@ func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algor }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + + switch input.(type) { + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { + return func() dafny.Map { + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_ToDafny(input map[string]string) dafny.Map { +func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) + }() +} + +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_ToDafny(input map[string]string) dafny.Map { return func() dafny.Map { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(aws_cryptography_keyStore_EncryptionContext_key_ToDafny(key), aws_cryptography_keyStore_EncryptionContext_value_ToDafny(val)) + fieldValue.Add(aws_cryptography_materialProviders_EncryptionContext_key_ToDafny(key), aws_cryptography_materialProviders_EncryptionContext_value_ToDafny(val)) } return fieldValue.ToMap() }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm) AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy) AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { + return func() AwsCryptographyMaterialProvidersTypes.CommitmentPolicy { switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: - var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_DIRECT__KEY__WRAPPING_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DIRECT__KEY__WRAPPING)) - case *awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping: - var inputToConversion = aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_EdkWrappingAlgorithm_{}.Create_IntermediateKeyWrapping_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy)) + case *awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_CommitmentPolicy_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE).Value) + return AwsCryptographyMaterialProvidersTypes.CompanionStruct_CommitmentPolicy_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy)) default: panic("Unhandled union type") @@ -3023,19 +3060,18 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_ToDafny(i }() } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm) AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - return func() AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm { - +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_HKDF_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.HKDF)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_IDENTITY_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IDENTITY)) - case *awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone: - var inputToConversion = aws_cryptography_materialProviders_DerivationAlgorithm_None_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_DerivationAlgorithm_{}.Create_None_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.None)) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId))) + case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: + var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId))) default: panic("Unhandled union type") @@ -3043,185 +3079,149 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_ToDafny(in }() } -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping) Wrappers.Option { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_IntermediateKeyWrapping_.Create_IntermediateKeyWrapping_(aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_ToDafny(input.KeyEncryptionKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_ToDafny(input.MacKeyKdf), aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_ToDafny(input.PdkEncryptAlgorithm))) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) +func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) }() } -func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_materialProviders_OnDecryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) }() } -func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring) dafny.Sequence { +func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_ToDafny(input []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey) dafny.Sequence { return func() dafny.Sequence { var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := Keyring_ToDafny(val) + element := aws_cryptography_materialProviders_EncryptedDataKeyList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProviders_HKDF_hmac_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_materialProviders_OnDecryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials) AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.DecryptionMaterials { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return AwsCryptographyMaterialProvidersTypes.Companion_DecryptionMaterials_.Create_DecryptionMaterials_(aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_ToDafny(input.VerificationKey), aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ToDafny(input.SymmetricSigningKey)) }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_OnEncryptInput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_EphemeralPrivateKeyToStaticPublicKeyInput_.Create_EphemeralPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) }() } -func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input [][]byte) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_SymmetricSigningKeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) +func aws_cryptography_materialProviders_OnEncryptOutput_materials_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials) AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + return func() AwsCryptographyMaterialProvidersTypes.EncryptionMaterials { + + return AwsCryptographyMaterialProvidersTypes.Companion_EncryptionMaterials_.Create_EncryptionMaterials_(aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_ToDafny(input.AlgorithmSuite), aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_ToDafny(input.EncryptionContext), aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_ToDafny(input.EncryptedDataKeys), aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys), aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_ToDafny(input.PlaintextDataKey), aws_cryptography_materialProviders_EncryptionMaterials_signingKey_ToDafny(input.SigningKey), aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_ToDafny(input.SymmetricSigningKeys)) }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_RegionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_ToDafny(input *kms.Client) ComAmazonawsKmsTypes.IKMSClient { - return &KMSwrapped.Shim{Client: input} +func aws_cryptography_materialProviders_EntryAlreadyExists_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() } -func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EntryDoesNotExist_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_KmsPrivateKeyToStaticPublicKeyInput_.Create_KmsPrivateKeyToStaticPublicKeyInput_(aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_ToDafny(input.SenderKmsIdentifier), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_ToDafny(input.RecipientPublicKey))) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId) AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { - return func() AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId { +func aws_cryptography_materialProviders_InFlightTTLExceeded_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - switch input.(type) { - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_ESDK_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId)) - case *awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE: - var inputToConversion = aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_ToDafny(input.(*awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE).Value) - return AwsCryptographyMaterialProvidersTypes.CompanionStruct_AlgorithmSuiteId_{}.Create_DBE_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId)) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} - default: - panic("Unhandled union type") - } +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return input + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) +func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } diff --git a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go index e4189bc5c..2e1a47aa8 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go @@ -21,15 +21,6 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func CreateAwsKmsKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), - KmsClient: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), - } - -} - func CreateAwsKmsDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput{KmsClient: aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), @@ -39,21 +30,6 @@ func CreateAwsKmsDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMater } -func CreateAwsKmsMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), - KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), - ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { - if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { - return nil - } - return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) - }(), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), - } - -} - func CreateAwsKmsDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput{Regions: aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(dafnyInput.Dtor_regions()), @@ -69,26 +45,38 @@ func CreateAwsKmsDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptography } -func CreateAwsKmsMrkKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput { +func CreateAwsKmsEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), - KmsClient: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), + CurveSpec: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), + KmsClient: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } -func CreateAwsKmsMrkMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput { +func CreateAwsKmsHierarchicalKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), - KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), - ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { - if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput{BranchKeyId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(dafnyInput.Dtor_branchKeyId().UnwrapOr(nil)), + BranchKeyIdSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { + if dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil) == nil { return nil } - return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) + return BranchKeyIdSupplier_FromDafny(dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier)) }(), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + KeyStore: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(dafnyInput.Dtor_keyStore()), + TtlSeconds: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(dafnyInput.Dtor_ttlSeconds()), + Cache: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(dafnyInput.Dtor_cache().UnwrapOr(nil)), + PartitionId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(dafnyInput.Dtor_partitionId().UnwrapOr(nil)), + } + +} + +func CreateAwsKmsKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), + KmsClient: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } @@ -118,19 +106,41 @@ func CreateAwsKmsMrkDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptogra } -func CreateAwsKmsHierarchicalKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput { +func CreateAwsKmsMrkKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput{BranchKeyId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(dafnyInput.Dtor_branchKeyId().UnwrapOr(nil)), - BranchKeyIdSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { - if dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil) == nil { + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput{KmsKeyId: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), + KmsClient: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + } + +} + +func CreateAwsKmsMrkMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), + KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), + ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { + if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { return nil } - return BranchKeyIdSupplier_FromDafny(dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier)) + return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) }(), - KeyStore: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(dafnyInput.Dtor_keyStore()), - TtlSeconds: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(dafnyInput.Dtor_ttlSeconds()), - Cache: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(dafnyInput.Dtor_cache().UnwrapOr(nil)), - PartitionId: aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(dafnyInput.Dtor_partitionId().UnwrapOr(nil)), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), + } + +} + +func CreateAwsKmsMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput{Generator: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), + KmsKeyIds: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), + ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { + if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { + return nil + } + return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) + }(), + GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } @@ -146,13 +156,21 @@ func CreateAwsKmsRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialPro } -func CreateAwsKmsEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput { +func CreateCryptographicMaterialsCacheInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), - CurveSpec: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), - KmsClient: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), - GrantTokens: aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), - } + return awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput{Cache: aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(dafnyInput.Dtor_cache())} + +} + +func CreateDefaultClientSupplierInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput{} + +} + +func CreateDefaultCryptographicMaterialsManagerInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput{Keyring: Keyring_FromDafny(dafnyInput.Dtor_keyring())} } @@ -179,17 +197,6 @@ func CreateRawAesKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvid } -func CreateRawRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput{KeyNamespace: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), - KeyName: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), - PaddingScheme: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(dafnyInput.Dtor_paddingScheme()), - PublicKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), - PrivateKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey().UnwrapOr(nil)), - } - -} - func CreateRawEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput{KeyAgreementScheme: aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), @@ -198,9 +205,14 @@ func CreateRawEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvi } -func CreateDefaultCryptographicMaterialsManagerInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput { +func CreateRawRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput{Keyring: Keyring_FromDafny(dafnyInput.Dtor_keyring())} + return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput{KeyNamespace: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), + KeyName: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), + PaddingScheme: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(dafnyInput.Dtor_paddingScheme()), + PublicKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), + PrivateKey: aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey().UnwrapOr(nil)), + } } @@ -223,38 +235,48 @@ func CreateRequiredEncryptionContextCMMInput_FromDafny(dafnyInput AwsCryptograph } -func CreateCryptographicMaterialsCacheInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput { +func DecryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput{Cache: aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(dafnyInput.Dtor_cache())} + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(dafnyInput.Dtor_symmetricSigningKey().UnwrapOr(nil)), + } } -func CreateDefaultClientSupplierInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput { +func EncryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.EncryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput{} + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(dafnyInput.Dtor_symmetricSigningKeys().UnwrapOr(nil)), + } } -func InitializeEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput { +func GetAlgorithmSuiteInfoInput_FromDafny(dafnyInput dafny.Sequence) awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput { - return awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), - EncryptionContext: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), - SigningKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), - } + return awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput{BinaryId: Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(dafnyInput)} } -func EncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.EncryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { +func AlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(dafnyOutput.Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(dafnyOutput.Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(dafnyOutput.Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyOutput.Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(dafnyOutput.Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(dafnyOutput.Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(dafnyOutput.Dtor_symmetricSigningKeys().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(dafnyOutput.Dtor_id()), + BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(dafnyOutput.Dtor_binaryId()), + MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(dafnyOutput.Dtor_messageVersion()), + Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(dafnyOutput.Dtor_encrypt()), + Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(dafnyOutput.Dtor_kdf()), + Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(dafnyOutput.Dtor_commitment()), + Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(dafnyOutput.Dtor_signature()), + SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(dafnyOutput.Dtor_symmetricSignature()), + EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(dafnyOutput.Dtor_edkWrapping()), } } @@ -268,67 +290,45 @@ func InitializeDecryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMate } -func DecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(dafnyOutput.Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(dafnyOutput.Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyOutput.Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(dafnyOutput.Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(dafnyOutput.Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(dafnyOutput.Dtor_symmetricSigningKey().UnwrapOr(nil)), - } - -} - -func ValidEncryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput { +func InitializeEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), - Stop: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), + return awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), + EncryptionContext: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), + SigningKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), } } -func ValidDecryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput { +func ValidateCommitmentPolicyOnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), - Stop: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), + CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), } } -func GetAlgorithmSuiteInfoInput_FromDafny(dafnyInput dafny.Sequence) awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput{BinaryId: Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(dafnyInput)} - -} - -func AlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { +func ValidateCommitmentPolicyOnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput { - return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(dafnyOutput.Dtor_id()), - BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(dafnyOutput.Dtor_binaryId()), - MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(dafnyOutput.Dtor_messageVersion()), - Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(dafnyOutput.Dtor_encrypt()), - Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(dafnyOutput.Dtor_kdf()), - Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(dafnyOutput.Dtor_commitment()), - Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(dafnyOutput.Dtor_signature()), - SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(dafnyOutput.Dtor_symmetricSignature()), - EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(dafnyOutput.Dtor_edkWrapping()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), + CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), } } -func ValidateCommitmentPolicyOnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput { +func ValidDecryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), - CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), + Stop: aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), } } -func ValidateCommitmentPolicyOnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput { +func ValidEncryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput { - return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput{Algorithm: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), - CommitmentPolicy: aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), + return awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput{Start: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), + Stop: aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), } } @@ -369,38 +369,37 @@ func ClientSupplier_FromDafny(dafnyResource AwsCryptographyMaterialProvidersType return &ClientSupplier{dafnyResource} } -func OnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput{Materials: aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(dafnyInput.Dtor_materials())} - -} - -func OnEncryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnEncryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput { +func DeleteCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput { - return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput{Materials: aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} + return awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput{Identifier: aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier())} } -func Keyring_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IKeyring) awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { - val, ok := dafnyResource.(*KeyringNativeWrapper) +func CryptographicMaterialsCache_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache { + val, ok := dafnyResource.(*CryptographicMaterialsCacheNativeWrapper) if ok { return val.Impl } - return &Keyring{dafnyResource} + return &CryptographicMaterialsCache{dafnyResource} } -func OnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput { +func GetCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput { - return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput{Materials: aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(dafnyInput.Dtor_materials()), - EncryptedDataKeys: aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), + return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput{Identifier: aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), + BytesUsed: aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), } } -func OnDecryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnDecryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput { +func GetCacheEntryOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput { - return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput{Materials: aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} + return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput{Materials: aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(dafnyOutput.Dtor_materials()), + CreationTime: aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(dafnyOutput.Dtor_creationTime()), + ExpiryTime: aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(dafnyOutput.Dtor_expiryTime()), + MessagesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(dafnyOutput.Dtor_messagesUsed()), + BytesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(dafnyOutput.Dtor_bytesUsed()), + } } @@ -416,46 +415,38 @@ func PutCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTyp } -func CryptographicMaterialsCache_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache { - val, ok := dafnyResource.(*CryptographicMaterialsCacheNativeWrapper) - if ok { - return val.Impl +func UpdateUsageMetadataInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput) awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput{Identifier: aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), + BytesUsed: aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed()), } - return &CryptographicMaterialsCache{dafnyResource} } -func GetCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput { +func DecryptMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput { - return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput{Identifier: aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), - BytesUsed: aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), + CommitmentPolicy: aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), + EncryptedDataKeys: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), + EncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), + ReproducedEncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(dafnyInput.Dtor_reproducedEncryptionContext().UnwrapOr(nil)), } } -func GetCacheEntryOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput { +func DecryptMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput { - return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput{Materials: aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(dafnyOutput.Dtor_materials()), - CreationTime: aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(dafnyOutput.Dtor_creationTime()), - ExpiryTime: aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(dafnyOutput.Dtor_expiryTime()), - MessagesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(dafnyOutput.Dtor_messagesUsed()), - BytesUsed: aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(dafnyOutput.Dtor_bytesUsed()), - } + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput{DecryptionMaterials: aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(dafnyOutput.Dtor_decryptionMaterials())} } -func UpdateUsageMetadataInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput) awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput{Identifier: aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), - BytesUsed: aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed()), +func CryptographicMaterialsManager_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { + val, ok := dafnyResource.(*CryptographicMaterialsManagerNativeWrapper) + if ok { + return val.Impl } -} - -func DeleteCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput { - - return awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput{Identifier: aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier())} - + return &CryptographicMaterialsManager{dafnyResource} } func GetEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput { @@ -475,49 +466,53 @@ func GetEncryptionMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialP } -func CryptographicMaterialsManager_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { - val, ok := dafnyResource.(*CryptographicMaterialsManagerNativeWrapper) - if ok { - return val.Impl +func OnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput { + + return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput{Materials: aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(dafnyInput.Dtor_materials()), + EncryptedDataKeys: aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), } - return &CryptographicMaterialsManager{dafnyResource} } -func DecryptMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput { +func OnDecryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnDecryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput{AlgorithmSuiteId: aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), - CommitmentPolicy: aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), - EncryptedDataKeys: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), - EncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), - ReproducedEncryptionContext: aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(dafnyInput.Dtor_reproducedEncryptionContext().UnwrapOr(nil)), + return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput{Materials: aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} + +} + +func Keyring_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IKeyring) awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { + val, ok := dafnyResource.(*KeyringNativeWrapper) + if ok { + return val.Impl } + return &Keyring{dafnyResource} } -func DecryptMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput { +func OnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput{DecryptionMaterials: aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(dafnyOutput.Dtor_decryptionMaterials())} + return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput{Materials: aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(dafnyInput.Dtor_materials())} } -func InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(dafnyOutput.Dtor_message())} +func OnEncryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnEncryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput { + + return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput{Materials: aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} } -func InvalidEncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} +func AwsCryptographicMaterialProvidersException_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException { + return awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException{Message: aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(dafnyOutput.Dtor_message())} +func EntryAlreadyExists_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists { + return awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists{Message: aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidEncryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} +func EntryDoesNotExist_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist { + return awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist{Message: aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(dafnyOutput.Dtor_message())} } @@ -526,18 +521,23 @@ func InFlightTTLExceeded_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersT } -func EntryAlreadyExists_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists { - return awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists{Message: aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidAlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(dafnyOutput.Dtor_message())} } -func AwsCryptographicMaterialProvidersException_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException { - return awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException{Message: aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidAlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt{Message: aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(dafnyOutput.Dtor_message())} + +} + +func InvalidDecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials{Message: aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} } @@ -546,13 +546,13 @@ func InvalidDecryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyM } -func EntryDoesNotExist_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist { - return awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist{Message: aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidEncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} } -func InvalidDecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials{Message: aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} +func InvalidEncryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition { + return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition{Message: aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} } @@ -590,48 +590,48 @@ func OpaqueError_Output_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTy func Error_FromDafny(err AwsCryptographyMaterialProvidersTypes.Error) error { // Service Errors - if err.Is_InvalidEncryptionMaterials() { - return InvalidEncryptionMaterials_FromDafny(err) - } - - if err.Is_InvalidAlgorithmSuiteInfo() { - return InvalidAlgorithmSuiteInfo_FromDafny(err) - } - - if err.Is_InvalidEncryptionMaterialsTransition() { - return InvalidEncryptionMaterialsTransition_FromDafny(err) - } - - if err.Is_InvalidAlgorithmSuiteInfoOnDecrypt() { - return InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(err) + if err.Is_AwsCryptographicMaterialProvidersException() { + return AwsCryptographicMaterialProvidersException_FromDafny(err) } if err.Is_EntryAlreadyExists() { return EntryAlreadyExists_FromDafny(err) } - if err.Is_InvalidDecryptionMaterialsTransition() { - return InvalidDecryptionMaterialsTransition_FromDafny(err) + if err.Is_EntryDoesNotExist() { + return EntryDoesNotExist_FromDafny(err) } if err.Is_InFlightTTLExceeded() { return InFlightTTLExceeded_FromDafny(err) } - if err.Is_EntryDoesNotExist() { - return EntryDoesNotExist_FromDafny(err) + if err.Is_InvalidAlgorithmSuiteInfo() { + return InvalidAlgorithmSuiteInfo_FromDafny(err) } - if err.Is_InvalidDecryptionMaterials() { - return InvalidDecryptionMaterials_FromDafny(err) + if err.Is_InvalidAlgorithmSuiteInfoOnDecrypt() { + return InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(err) } if err.Is_InvalidAlgorithmSuiteInfoOnEncrypt() { return InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(err) } - if err.Is_AwsCryptographicMaterialProvidersException() { - return AwsCryptographicMaterialProvidersException_FromDafny(err) + if err.Is_InvalidDecryptionMaterials() { + return InvalidDecryptionMaterials_FromDafny(err) + } + + if err.Is_InvalidDecryptionMaterialsTransition() { + return InvalidDecryptionMaterialsTransition_FromDafny(err) + } + + if err.Is_InvalidEncryptionMaterials() { + return InvalidEncryptionMaterials_FromDafny(err) + } + + if err.Is_InvalidEncryptionMaterialsTransition() { + return InvalidEncryptionMaterialsTransition_FromDafny(err) } //DependentErrors @@ -664,157 +664,174 @@ func MaterialProvidersConfig_FromDafny(dafnyOutput AwsCryptographyMaterialProvid } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { - var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { if input == nil { return nil } - - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ - Value: (aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), - } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ - Value: (aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), +} +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ - Value: (aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), + return fieldValue +} +func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ - Value: (aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), + }() +} +func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } + }() +} +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ - Value: (aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ - Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), + return fieldValue +} +func aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) } - - return union - + return fieldValue } -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_ECDSA() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA{ - Value: (aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_ECDSA())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_None())), - } - } - - return union - -} -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } +func aws_cryptography_materialProviders_RegionList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) } } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b }() } -func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.HKDF { - return awscryptographymaterialproviderssmithygeneratedtypes.HKDF{Hmac: aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_hmac()), - SaltLength: aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_saltLength()), - InputKeyLength: aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_inputKeyLength()), - OutputKeyLength: aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_outputKeyLength()), +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil } -} -func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), - BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), - MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), - Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), - Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), - Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), - Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), - SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), - EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } -func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) +func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput { - return awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput{SenderStaticPrivateKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_senderStaticPrivateKey()), - RecipientPublicKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { + var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations + + if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ + Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), + } } -} -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(input interface{}) *int64 { - return func() *int64 { - var b int64 - if input == nil { - return nil + if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ + Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), } - b = input.(int64) - return &b - }() + } + + return union + } func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput { return awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput{RecipientKmsIdentifier: aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput).Dtor_recipientKmsIdentifier())} } -func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int64 { - return func() *int64 { - var b int64 - if input == nil { - return nil +func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - b = input.(int64) - return &b }() } -func aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { - return awscryptographymaterialproviderssmithygeneratedtypes.None{} +func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput { + return awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput{SenderKmsIdentifier: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderKmsIdentifier()), + SenderPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderPublicKey().UnwrapOr(nil)), + RecipientPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), + } } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -827,7 +844,7 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny( } }() } -func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -843,7 +860,7 @@ func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_From } }() } -func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -859,40 +876,82 @@ func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny } }() } -func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] }() } -func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { - return func() *int32 { - var b int32 - if input == nil { - return nil - } - b = input.(int32) - return &b +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(input interface{}) *awscryptographykeystoresmithygenerated.Client { + value, ok := input.(AwsCryptographyKeyStoreTypes.IKeyStoreClient) + if !ok { + panic("invalid type found.") + } + return &awscryptographykeystoresmithygenerated.Client{value} + +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(input interface{}) int64 { + return func() int64 { + var b = input.(int64) + return b }() + } -func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType + if input == nil { + return nil + } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { @@ -934,84 +993,78 @@ func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_c return union } -func aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input interface{}) int32 { +func aws_cryptography_materialProviders_CacheType_Default_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache { + return awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache{EntryCapacity: aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DefaultCache).Dtor_entryCapacity())} +} +func aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { - var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt - - if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ - Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), - } - } - - return union - +func aws_cryptography_materialProviders_CacheType_No_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.NoCache { + return awscryptographymaterialproviderssmithygeneratedtypes.NoCache{} } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), +func aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache { + return awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache{EntryCapacity: aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryCapacity()), + EntryPruningTailSize: aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), } } -func Aws_cryptography_materialProviders_GetClientOutput_client_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - +func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(input interface{}) *string { - return func() *string { - var s string +func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { + return func() *int32 { + var b int32 if input == nil { return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + b = input.(int32) + return &b }() } -func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), - } +func aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache { + return awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache{EntryCapacity: aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryCapacity()), + EntryPruningTailSize: aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), +} +func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { + return func() *int32 { + var b int32 + if input == nil { + return nil } + b = input.(int32) + return &b + }() +} +func aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache { + return awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache{EntryCapacity: aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryCapacity()), + EntryPruningTailSize: aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), + GracePeriod: aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_gracePeriod()), + GraceInterval: aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_graceInterval()), + FanOut: aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_fanOut()), + InFlightTTL: aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_inFlightTTL()), + SleepMilli: aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_sleepMilli()), + TimeUnits: aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_timeUnits().UnwrapOr(nil)), } - - return union - } -func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int32 { +func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { @@ -1021,47 +1074,95 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(i return &b }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { + return func() *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { + var u awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits + if input == nil { + return nil + } + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.TimeUnits) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits).Equals(inputEnum) { + break + } + } + } + + return &u.Values()[index] + }() +} +func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -1075,81 +1176,69 @@ func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_ } return fieldValue } -func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + +} +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil + } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } -func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - return m - + return fieldValue } -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) } - return m - + return fieldValue } -func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } - - return union - } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -1159,29 +1248,11 @@ func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_ if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { - return func() awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { - var u awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1194,39 +1265,59 @@ func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDaf } }() } -func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client - } +} +func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } - }() + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + } + return fieldValue } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { - return func() string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(input interface{}) *string { + return func() *string { var s string + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1239,54 +1330,81 @@ func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_mes } }() } -func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { - return func() string { +func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(input interface{}) *string { + return func() *string { var s string + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { if input == nil { return nil } - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + return fieldValue +} +func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { + if input == nil { + return nil + } + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - - return union - -} -func aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() + return fieldValue } -func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1317,32 +1435,15 @@ func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAl return u.Values()[index] }() } -func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") + } + return shim.Client + } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -1356,75 +1457,74 @@ func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_gra } return fieldValue } -func aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil +func aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { + var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType + + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ + Value: (aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), + } } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ + Value: (aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } - return fieldValue + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ + Value: (aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ + Value: (aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ + Value: (aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ + Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), + } + } + + return union + } -func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) +func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.IKeyring, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + fieldValue = append(fieldValue, Keyring_FromDafny(val.(AwsCryptographyMaterialProvidersTypes.IKeyring))) } return fieldValue } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_HMAC() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_HMAC()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC{ - Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_None())), +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - } - - return union - + }() } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1437,31 +1537,32 @@ func aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_Fr } }() } -func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) +func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { + return func() awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { + var u awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { + if enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg).Equals(inputEnum) { break } } @@ -1470,7 +1571,35 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_F return u.Values()[index] }() } -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { + var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations + + if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ + Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ + Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ + Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), + } + } + + return union + +} +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput { + return awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput{RecipientStaticPrivateKey: aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput).Dtor_recipientStaticPrivateKey())} +} +func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1486,7 +1615,12 @@ func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDaf } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput { + return awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput{SenderStaticPrivateKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_senderStaticPrivateKey()), + RecipientPublicKey: aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), + } +} +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1502,42 +1636,26 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input inte } }() } -func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput { - return awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput{RecipientStaticPrivateKey: aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput).Dtor_recipientStaticPrivateKey())} -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - +func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput { + return awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput{RecipientPublicKey: aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey())} } -func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1553,41 +1671,16 @@ func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny } }() } -func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) +func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { break } } @@ -1596,7 +1689,7 @@ func aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) return u.Values()[index] }() } -func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1604,27 +1697,34 @@ func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { - return func() awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { - var u awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId) +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId).Equals(inputEnum) { + if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { break } } @@ -1633,97 +1733,50 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input int return u.Values()[index] }() } -func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(input interface{}) int64 { - return func() int64 { - var b = input.(int64) - return b +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() - } -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { - return awscryptographymaterialproviderssmithygeneratedtypes.None{} -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { - var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt - - if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ - Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), - } - } - - return union - -} -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { - if input == nil { - return nil - } +func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1731,93 +1784,48 @@ func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_reg if !ok { return s } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), - } - } + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint - return union + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) -} -func aws_cryptography_materialProviders_CacheType_Default_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache { - return awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache{EntryCapacity: aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DefaultCache).Dtor_entryCapacity())} -} -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), - SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), - } -} -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") +func aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { + return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), + BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), + MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), + Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), + Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), + Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), + Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), + SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), + EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), } - return shim.Client - } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } -func aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache { - return awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache{EntryCapacity: aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryCapacity()), - EntryPruningTailSize: aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), - } -} func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId @@ -1836,42 +1844,25 @@ func aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(input in return u.Values()[index] }() } -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING { - return awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING{} -} -func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - - } - } - }() -} -func aws_cryptography_materialProviders_GetClientInput_region_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) +func aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { + return func() awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { + var u awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1887,69 +1878,447 @@ func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input inte } }() } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input interface{}) int32 { +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { + var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ + Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), } } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + + return union + +} +func aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { + return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), + TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), + IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + } +} +func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.HKDF { + return awscryptographymaterialproviderssmithygeneratedtypes.HKDF{Hmac: aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_hmac()), + SaltLength: aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_saltLength()), + InputKeyLength: aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_inputKeyLength()), + OutputKeyLength: aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_outputKeyLength()), + } +} +func aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY { + return awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY{} +} +func aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { + return awscryptographymaterialproviderssmithygeneratedtypes.None{} +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_ECDSA() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA{ + Value: (aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_ECDSA())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ECDSA { + return awscryptographymaterialproviderssmithygeneratedtypes.ECDSA{Curve: aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.ECDSA).Dtor_curve())} +} +func aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { + return awscryptographymaterialproviderssmithygeneratedtypes.None{} +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_HMAC() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_HMAC()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC{ + Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { + return awscryptographymaterialproviderssmithygeneratedtypes.None{} +} +func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_DIRECT__KEY__WRAPPING() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING{ + Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_DIRECT__KEY__WRAPPING())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_IntermediateKeyWrapping() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping{ + Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_IntermediateKeyWrapping())), + } + } + + return union + +} +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING { + return awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING{} +} +func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping { + return awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping{KeyEncryptionKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_keyEncryptionKeyKdf()), + MacKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_macKeyKdf()), + PdkEncryptAlgorithm: aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_pdkEncryptAlgorithm()), + } +} +func aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { + var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ + Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + } + } + + return union + +} +func aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { + var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt + + if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ + Value: (aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), + } + } + + return union + +} +func aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + +} +func aws_cryptography_materialProviders_EncryptionContext_key_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + + } + } + }() +} +func aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { + return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), + BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), + MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), + Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), + Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), + Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), + Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), + SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), + EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), } - - return union - } -func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(input interface{}) map[string]string { +func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil @@ -1964,17 +2333,24 @@ func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_Fr return m } -func aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), +func aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) } + return fieldValue } -func aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey{KeyProviderId: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderId()), + KeyProviderInfo: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderInfo()), + Ciphertext: aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_ciphertext()), + } +} +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1982,102 +2358,229 @@ func aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(inpu if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), +func aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } + return fieldValue } -func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input interface{}) [][]byte { + if input == nil { + return nil + } + fieldValue := make([][]byte, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + +} +func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - }() + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } -} -func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(input interface{}) int64 { - return func() int64 { - var b = input.(int64) - return b - }() + return m } -func aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache { - return awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache{EntryCapacity: aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryCapacity()), - EntryPruningTailSize: aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), - } -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2093,20 +2596,7 @@ func aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_ } }() } -func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2122,33 +2612,60 @@ func aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(in } }() } -func aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - }() + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + } -func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { + return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { + var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } func aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy { @@ -2169,7 +2686,45 @@ func aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(input int return u.Values()[index] }() } -func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + +} +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), @@ -2178,43 +2733,16 @@ func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMateria SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) +func aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() } -func aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), @@ -2224,42 +2752,32 @@ func aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(inpu SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ECDSA { - return awscryptographymaterialproviderssmithygeneratedtypes.ECDSA{Curve: aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.ECDSA).Dtor_curve())} +func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue -} -func aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { - return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { - var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy).Equals(inputEnum) { - break - } - } - } + return m - return u.Values()[index] - }() } -func aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2272,7 +2790,7 @@ func aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(in } }() } -func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_GetClientInput_region_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2280,47 +2798,20 @@ func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{} if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), - EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), - BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), - HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), +func Aws_cryptography_materialProviders_GetClientOutput_client_FromDafny(input interface{}) *kms.Client { + shim, ok := input.(*KMSwrapped.Shim) + if !ok { + panic("Not able to convert client to native") } + return shim.Client + } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2336,37 +2827,31 @@ func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_Fr } }() } -func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { - var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations - - if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ - Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ - Value: (aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), +func aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int64 { + return func() *int64 { + var b int64 + if input == nil { + return nil } - } - - return union - + b = input.(int64) + return &b + }() } func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { var union awscryptographymaterialproviderssmithygeneratedtypes.Materials @@ -2399,47 +2884,33 @@ func aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny( return union } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), +func aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { - return func() *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { - var u awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits - if input == nil { - return nil - } - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.TimeUnits) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits).Equals(inputEnum) { - break - } - } - } - - return &u.Values()[index] - }() +func aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) +func aws_cryptography_materialProviders_Materials_BranchKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), + BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), + EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), + BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), } - return fieldValue } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2452,57 +2923,26 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDaf } }() } -func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy - - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { +func aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil @@ -2512,24 +2952,31 @@ func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encry if !ok { break } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } -func aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey{KeyProviderId: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderId()), - KeyProviderInfo: aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderInfo()), - Ciphertext: aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_ciphertext()), - } +func aws_cryptography_keyStore_EncryptionContext_key_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + + } + } + }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_EncryptionContext_value_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2537,18 +2984,18 @@ func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_messa if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2564,35 +3011,42 @@ func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_send } }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), +func aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { + return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), + EncryptionContext: aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), + BeaconKey: aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), + HmacKeys: aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), - } +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } -func aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { - return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), - EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), - EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), - RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), - PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), - SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), - SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), +func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m + } -func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2608,48 +3062,22 @@ func aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_reci } }() } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(input interface{}) *awscryptographykeystoresmithygenerated.Client { - value, ok := input.(AwsCryptographyKeyStoreTypes.IKeyStoreClient) - if !ok { - panic("invalid type found.") - } - return &awscryptographykeystoresmithygenerated.Client{value} - -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { + var m map[string][]byte = make(map[string][]byte) if input == nil { return nil } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { - var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy - - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ - Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } + m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - - return union + return m } -func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(input interface{}) string { +func aws_cryptography_keyStore_HmacKeyMap_key_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -2662,7 +3090,7 @@ func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromD } }() } -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2678,118 +3106,104 @@ func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_reci } }() } -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } +func aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(input interface{}) int64 { + return func() int64 { + var b = input.(int64) + return b + }() + +} +func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(input interface{}) int64 { + return func() int64 { + var b = input.(int64) + return b + }() + +} +func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - - return u.Values()[index] }() } -func aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { - var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations +func aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { + var union awscryptographymaterialproviderssmithygeneratedtypes.Materials - if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ - Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ + Value: (aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), } } - if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ - Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ + Value: (aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), } } - if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ - Value: (aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ + Value: (aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { + + union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ + Value: (aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), } } return union } -func aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(input interface{}) int64 { +func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(input interface{}) int64 { +func aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } -func aws_cryptography_materialProviders_RegionList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(input interface{}) *int32 { + return func() *int32 { + var b int32 + if input == nil { + return nil } - }() -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - + b = input.(int32) + return &b + }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(input interface{}) *int32 { +func aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { @@ -2799,10 +3213,7 @@ func aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafn return &b }() } -func aws_cryptography_materialProviders_CacheType_No_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.NoCache { - return awscryptographymaterialproviderssmithygeneratedtypes.NoCache{} -} -func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -2818,48 +3229,63 @@ func aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInpu } }() } -func aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil +func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } - m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + + return union } -func aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { - return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), - BinaryId: aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), - MessageVersion: aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), - Encrypt: aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), - Kdf: aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), - Commitment: aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), - Signature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), - SymmetricSignature: aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), - EdkWrapping: aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), +func aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), + } } + + return union + } -func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } - }() + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) + } + return fieldValue } -func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input interface{}) map[string][]byte { - var m map[string][]byte = make(map[string][]byte) +func aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } @@ -2868,12 +3294,12 @@ func aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input inter if !ok { break } - m[aws_cryptography_keyStore_HmacKeyMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_HmacKeyMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } -func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { +func aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil @@ -2888,7 +3314,7 @@ func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionCo return m } -func aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { +func aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), @@ -2897,179 +3323,73 @@ func aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input int SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_EncryptionContext_key_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - - } - } - }() -} -func aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache { - return awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache{EntryCapacity: aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryCapacity()), - EntryPruningTailSize: aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), - GracePeriod: aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_gracePeriod()), - GraceInterval: aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_graceInterval()), - FanOut: aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_fanOut()), - InFlightTTL: aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_inFlightTTL()), - SleepMilli: aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_sleepMilli()), - TimeUnits: aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_timeUnits().UnwrapOr(nil)), +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil } -} -func aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { - return func() *int32 { - var b int32 - if input == nil { - return nil + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } - b = input.(int32) - return &b - }() -} -func aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { - return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), - TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), - IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + m[aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m + } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { + var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy + + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } - }() -} -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } + } + if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ + Value: (aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), } - }() -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm + } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { + return union - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } +} +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { + var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId + if input == nil { + return nil } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), + if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { + var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) + union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ + Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } -func aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), - } -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(input interface{}) *string { - return func() *string { - var s string +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(input interface{}) *int64 { + return func() *int64 { + var b int64 if input == nil { return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + b = input.(int64) + return &b }() } -func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(input interface{}) []string { +func aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { if input == nil { return nil } @@ -3079,76 +3399,40 @@ func aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_ if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(input interface{}) int64 { - return func() int64 { - var b = input.(int64) - return b - }() - +func aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() +func aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + VerificationKey: aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), + SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), + } } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) +func aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { + fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) } return fieldValue } -func aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { - return awscryptographymaterialproviderssmithygeneratedtypes.None{} -} -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} func aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), @@ -3158,13 +3442,7 @@ func aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(inpu SymmetricSigningKey: aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { +func aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), @@ -3174,100 +3452,43 @@ func aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input int SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { - if input == nil { - return nil - } - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) +func aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { + return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), + EncryptionContext: aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), + EncryptedDataKeys: aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), + RequiredEncryptionContextKeys: aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), + PlaintextDataKey: aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), + SigningKey: aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), + SymmetricSigningKeys: aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } - return fieldValue } -func aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { - var union awscryptographymaterialproviderssmithygeneratedtypes.Materials - - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ - Value: (aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ - Value: (aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ - Value: (aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ - Value: (aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), - } - } - - return union - -} -func aws_cryptography_materialProviders_Materials_BranchKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { - return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), - BranchKeyVersion: aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), - EncryptionContext: aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), - BranchKey: aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), - } -} -func aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY { - return awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY{} -} -func aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_keyStore_HmacKeyMap_value_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -3275,53 +3496,25 @@ func aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input if !ok { return s } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } - }() -} -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - + }() } -func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -3334,7 +3527,7 @@ func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_messa } }() } -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(input interface{}) string { +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -3347,261 +3540,68 @@ func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_Fr } }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[aws_cryptography_keyStore_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = aws_cryptography_keyStore_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_DIRECT__KEY__WRAPPING() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING{ - Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_DIRECT__KEY__WRAPPING())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_IntermediateKeyWrapping() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping{ - Value: (aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_IntermediateKeyWrapping())), - } - } - - return union - -} -func aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { - var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm - - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { - - union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ - Value: (aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), - } - } - - return union - -} -func aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping { - return awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping{KeyEncryptionKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_keyEncryptionKeyKdf()), - MacKeyKdf: aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_macKeyKdf()), - PdkEncryptAlgorithm: aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_pdkEncryptAlgorithm()), - } -} -func aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { - return func() *int32 { - var b int32 - if input == nil { - return nil - } - b = input.(int32) - return &b - }() -} -func aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { - fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.IKeyring, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, Keyring_FromDafny(val.(AwsCryptographyMaterialProvidersTypes.IKeyring))) - } - return fieldValue -} -func aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } +func aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) } } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput { - return awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput{RecipientPublicKey: aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey())} -} -func aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input interface{}) [][]byte { - if input == nil { - return nil - } - fieldValue := make([][]byte, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { - shim, ok := input.(*KMSwrapped.Shim) - if !ok { - panic("Not able to convert client to native") - } - return shim.Client - -} -func aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput { - return awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput{SenderKmsIdentifier: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderKmsIdentifier()), - SenderPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderPublicKey().UnwrapOr(nil)), - RecipientPublicKey: aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), - } -} -func aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { - var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId - - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { - var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) - union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ - Value: (aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - -} -func aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b }() } -func aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) - } - return fieldValue -} diff --git a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go index 7e773c27d..3e4955344 100644 --- a/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go +++ b/AwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderssmithygeneratedtypes/types.go @@ -98,22 +98,6 @@ func (input IntermediateKeyWrapping) Validate() error { return nil } -func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_Validate() error { - if input.PdkEncryptAlgorithm == nil { - return nil - } - switch unionType := input.PdkEncryptAlgorithm.(type) { - case *EncryptMemberAES_GCM: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) - } - - return nil -} func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_Validate() error { if input.KeyEncryptionKeyKdf == nil { return nil @@ -162,6 +146,22 @@ func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_Intermed return nil } +func (input IntermediateKeyWrapping) aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_Validate() error { + if input.PdkEncryptAlgorithm == nil { + return nil + } + switch unionType := input.PdkEncryptAlgorithm.(type) { + case *EncryptMemberAES_GCM: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) + } + + return nil +} type ECDSA struct { Curve awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm @@ -239,16 +239,20 @@ func (input AlgorithmSuiteInfo) Validate() error { return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_Validate() error { - if input.Signature == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_Validate() error { + if input.Commitment == nil { return nil } - switch unionType := input.Signature.(type) { - case *SignatureAlgorithmMemberECDSA: + switch unionType := input.Commitment.(type) { + case *DerivationAlgorithmMemberHKDF: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } - case *SignatureAlgorithmMemberNone: + case *DerivationAlgorithmMemberIDENTITY: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + case *DerivationAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -259,20 +263,16 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_Validate() error { - if input.Commitment == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_Validate() error { + if input.EdkWrapping == nil { return nil } - switch unionType := input.Commitment.(type) { - case *DerivationAlgorithmMemberHKDF: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - case *DerivationAlgorithmMemberIDENTITY: + switch unionType := input.EdkWrapping.(type) { + case *EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } - case *DerivationAlgorithmMemberNone: + case *EdkWrappingAlgorithmMemberIntermediateKeyWrapping: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -283,13 +283,12 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_Validate() error { - if input.SymmetricSignature == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_Validate() error { + if input.Encrypt == nil { return nil } - switch unionType := input.SymmetricSignature.(type) { - case *SymmetricSignatureAlgorithmMemberHMAC: - case *SymmetricSignatureAlgorithmMemberNone: + switch unionType := input.Encrypt.(type) { + case *EncryptMemberAES_GCM: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -314,12 +313,20 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_Validate() error { - if input.Encrypt == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_Validate() error { + if input.Kdf == nil { return nil } - switch unionType := input.Encrypt.(type) { - case *EncryptMemberAES_GCM: + switch unionType := input.Kdf.(type) { + case *DerivationAlgorithmMemberHKDF: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + case *DerivationAlgorithmMemberIDENTITY: + if unionType.Value.Validate() != nil { + return unionType.Value.Validate() + } + case *DerivationAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -330,16 +337,16 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_Validate() error { - if input.EdkWrapping == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_Validate() error { + if input.Signature == nil { return nil } - switch unionType := input.EdkWrapping.(type) { - case *EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING: + switch unionType := input.Signature.(type) { + case *SignatureAlgorithmMemberECDSA: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } - case *EdkWrappingAlgorithmMemberIntermediateKeyWrapping: + case *SignatureAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -350,20 +357,13 @@ func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuit return nil } -func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_Validate() error { - if input.Kdf == nil { +func (input AlgorithmSuiteInfo) aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_Validate() error { + if input.SymmetricSignature == nil { return nil } - switch unionType := input.Kdf.(type) { - case *DerivationAlgorithmMemberHKDF: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - case *DerivationAlgorithmMemberIDENTITY: - if unionType.Value.Validate() != nil { - return unionType.Value.Validate() - } - case *DerivationAlgorithmMemberNone: + switch unionType := input.SymmetricSignature.(type) { + case *SymmetricSignatureAlgorithmMemberHMAC: + case *SymmetricSignatureAlgorithmMemberNone: if unionType.Value.Validate() != nil { return unionType.Value.Validate() } @@ -1168,14 +1168,16 @@ func (input DecryptMaterialsInput) Validate() error { return nil } -func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_Validate() error { - for key, value := range input.ReproducedEncryptionContext { - if !utf8.ValidString(key) { - return fmt.Errorf("Invalid UTF bytes %s ", key) - } - if !utf8.ValidString(value) { - return fmt.Errorf("Invalid UTF bytes %s ", value) - } +func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_Validate() error { + if input.AlgorithmSuiteId == nil { + return nil + } + switch unionType := input.AlgorithmSuiteId.(type) { + case *AlgorithmSuiteIdMemberESDK: + case *AlgorithmSuiteIdMemberDBE: + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) } return nil @@ -1215,16 +1217,14 @@ func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMat return nil } -func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_Validate() error { - if input.AlgorithmSuiteId == nil { - return nil - } - switch unionType := input.AlgorithmSuiteId.(type) { - case *AlgorithmSuiteIdMemberESDK: - case *AlgorithmSuiteIdMemberDBE: - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) +func (input DecryptMaterialsInput) aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_Validate() error { + for key, value := range input.ReproducedEncryptionContext { + if !utf8.ValidString(key) { + return fmt.Errorf("Invalid UTF bytes %s ", key) + } + if !utf8.ValidString(value) { + return fmt.Errorf("Invalid UTF bytes %s ", value) + } } return nil @@ -1264,15 +1264,6 @@ func (input DecryptionMaterials) Validate() error { return nil } -func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_Validate() error { - for _, item := range input.RequiredEncryptionContextKeys { - if !utf8.ValidString(item) { - return fmt.Errorf("Invalid UTF bytes %s ", item) - } - } - - return nil -} func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_Validate() error { for key, value := range input.EncryptionContext { if !utf8.ValidString(key) { @@ -1285,6 +1276,15 @@ func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMa return nil } +func (input DecryptionMaterials) aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_Validate() error { + for _, item := range input.RequiredEncryptionContextKeys { + if !utf8.ValidString(item) { + return fmt.Errorf("Invalid UTF bytes %s ", item) + } + } + + return nil +} type DecryptMaterialsOutput struct { DecryptionMaterials DecryptionMaterials @@ -1333,11 +1333,16 @@ func (input GetEncryptionMaterialsInput) Validate() error { return nil } -func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() error { - for _, item := range input.RequiredEncryptionContextKeys { - if !utf8.ValidString(item) { - return fmt.Errorf("Invalid UTF bytes %s ", item) - } +func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_Validate() error { + if input.CommitmentPolicy == nil { + return nil + } + switch unionType := input.CommitmentPolicy.(type) { + case *CommitmentPolicyMemberESDK: + case *CommitmentPolicyMemberDBE: + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) } return nil @@ -1354,20 +1359,6 @@ func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetE return nil } -func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_Validate() error { - if input.CommitmentPolicy == nil { - return nil - } - switch unionType := input.CommitmentPolicy.(type) { - case *CommitmentPolicyMemberESDK: - case *CommitmentPolicyMemberDBE: - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) - } - - return nil -} func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_Validate() error { if input.AlgorithmSuiteId == nil { return nil @@ -1382,6 +1373,15 @@ func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetE return nil } +func (input GetEncryptionMaterialsInput) aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_Validate() error { + for _, item := range input.RequiredEncryptionContextKeys { + if !utf8.ValidString(item) { + return fmt.Errorf("Invalid UTF bytes %s ", item) + } + } + + return nil +} type EncryptionMaterials struct { AlgorithmSuite AlgorithmSuiteInfo @@ -1425,6 +1425,15 @@ func (input EncryptionMaterials) Validate() error { return nil } +func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_Validate() error { + for _, item := range input.EncryptedDataKeys { + if item.Validate() != nil { + return item.Validate() + } + } + + return nil +} func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_Validate() error { for key, value := range input.EncryptionContext { if !utf8.ValidString(key) { @@ -1437,15 +1446,6 @@ func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMa return nil } -func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_Validate() error { - for _, item := range input.EncryptedDataKeys { - if item.Validate() != nil { - return item.Validate() - } - } - - return nil -} func (input EncryptionMaterials) aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_Validate() error { for _, item := range input.RequiredEncryptionContextKeys { if !utf8.ValidString(item) { @@ -1704,13 +1704,13 @@ func (input ValidateCommitmentPolicyOnDecryptInput) Validate() error { return nil } -func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_Validate() error { - if input.CommitmentPolicy == nil { +func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_Validate() error { + if input.Algorithm == nil { return nil } - switch unionType := input.CommitmentPolicy.(type) { - case *CommitmentPolicyMemberESDK: - case *CommitmentPolicyMemberDBE: + switch unionType := input.Algorithm.(type) { + case *AlgorithmSuiteIdMemberESDK: + case *AlgorithmSuiteIdMemberDBE: // Default case should not be reached. default: panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) @@ -1718,13 +1718,13 @@ func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialPro return nil } -func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_Validate() error { - if input.Algorithm == nil { +func (input ValidateCommitmentPolicyOnDecryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_Validate() error { + if input.CommitmentPolicy == nil { return nil } - switch unionType := input.Algorithm.(type) { - case *AlgorithmSuiteIdMemberESDK: - case *AlgorithmSuiteIdMemberDBE: + switch unionType := input.CommitmentPolicy.(type) { + case *CommitmentPolicyMemberESDK: + case *CommitmentPolicyMemberDBE: // Default case should not be reached. default: panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) @@ -1756,20 +1756,6 @@ func (input ValidateCommitmentPolicyOnEncryptInput) Validate() error { return nil } -func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_Validate() error { - if input.CommitmentPolicy == nil { - return nil - } - switch unionType := input.CommitmentPolicy.(type) { - case *CommitmentPolicyMemberESDK: - case *CommitmentPolicyMemberDBE: - // Default case should not be reached. - default: - panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) - } - - return nil -} func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_Validate() error { if input.Algorithm == nil { return nil @@ -1784,6 +1770,20 @@ func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialPro return nil } +func (input ValidateCommitmentPolicyOnEncryptInput) aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_Validate() error { + if input.CommitmentPolicy == nil { + return nil + } + switch unionType := input.CommitmentPolicy.(type) { + case *CommitmentPolicyMemberESDK: + case *CommitmentPolicyMemberDBE: + // Default case should not be reached. + default: + panic(fmt.Sprintf("Unhandled union type: %T ", unionType)) + } + + return nil +} type ValidDecryptionMaterialsTransitionInput struct { Start DecryptionMaterials @@ -2040,25 +2040,6 @@ func (input MaterialProvidersConfig) Validate() error { return nil } -// KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey -// KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery -type KmsEcdhStaticConfigurations interface { - isKmsEcdhStaticConfigurations() -} - -type KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey struct { - Value KmsPrivateKeyToStaticPublicKeyInput -} - -func (*KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey) isKmsEcdhStaticConfigurations() { -} - -type KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery struct { - Value KmsPublicKeyDiscoveryInput -} - -func (*KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery) isKmsEcdhStaticConfigurations() {} - // AlgorithmSuiteIdMemberDBE // AlgorithmSuiteIdMemberESDK type AlgorithmSuiteId interface { @@ -2077,71 +2058,6 @@ type AlgorithmSuiteIdMemberESDK struct { func (*AlgorithmSuiteIdMemberESDK) isAlgorithmSuiteId() {} -// KeyAgreementSchemeMemberStaticConfiguration -type KeyAgreementScheme interface { - isKeyAgreementScheme() -} - -type KeyAgreementSchemeMemberStaticConfiguration struct { - Value StaticConfigurations -} - -func (*KeyAgreementSchemeMemberStaticConfiguration) isKeyAgreementScheme() {} - -// SignatureAlgorithmMemberECDSA -// SignatureAlgorithmMemberNone -type SignatureAlgorithm interface { - isSignatureAlgorithm() -} - -type SignatureAlgorithmMemberECDSA struct { - Value ECDSA -} - -func (*SignatureAlgorithmMemberECDSA) isSignatureAlgorithm() {} - -type SignatureAlgorithmMemberNone struct { - Value None -} - -func (*SignatureAlgorithmMemberNone) isSignatureAlgorithm() {} - -// StaticConfigurationsMemberAWS_KMS_ECDH -// StaticConfigurationsMemberRAW_ECDH -type StaticConfigurations interface { - isStaticConfigurations() -} - -type StaticConfigurationsMemberAWS_KMS_ECDH struct { - Value KmsEcdhStaticConfigurations -} - -func (*StaticConfigurationsMemberAWS_KMS_ECDH) isStaticConfigurations() {} - -type StaticConfigurationsMemberRAW_ECDH struct { - Value RawEcdhStaticConfigurations -} - -func (*StaticConfigurationsMemberRAW_ECDH) isStaticConfigurations() {} - -// SymmetricSignatureAlgorithmMemberHMAC -// SymmetricSignatureAlgorithmMemberNone -type SymmetricSignatureAlgorithm interface { - isSymmetricSignatureAlgorithm() -} - -type SymmetricSignatureAlgorithmMemberHMAC struct { - Value awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm -} - -func (*SymmetricSignatureAlgorithmMemberHMAC) isSymmetricSignatureAlgorithm() {} - -type SymmetricSignatureAlgorithmMemberNone struct { - Value None -} - -func (*SymmetricSignatureAlgorithmMemberNone) isSymmetricSignatureAlgorithm() {} - // CacheTypeMemberDefault // CacheTypeMemberMultiThreaded // CacheTypeMemberNo @@ -2188,6 +2104,67 @@ type CacheTypeMemberStormTracking struct { func (*CacheTypeMemberStormTracking) isCacheType() {} +// CommitmentPolicyMemberDBE +// CommitmentPolicyMemberESDK +type CommitmentPolicy interface { + isCommitmentPolicy() +} + +type CommitmentPolicyMemberDBE struct { + Value DBECommitmentPolicy +} + +func (*CommitmentPolicyMemberDBE) isCommitmentPolicy() {} + +type CommitmentPolicyMemberESDK struct { + Value ESDKCommitmentPolicy +} + +func (*CommitmentPolicyMemberESDK) isCommitmentPolicy() {} + +// DerivationAlgorithmMemberHKDF +// DerivationAlgorithmMemberIDENTITY +// DerivationAlgorithmMemberNone +type DerivationAlgorithm interface { + isDerivationAlgorithm() +} + +type DerivationAlgorithmMemberHKDF struct { + Value HKDF +} + +func (*DerivationAlgorithmMemberHKDF) isDerivationAlgorithm() {} + +type DerivationAlgorithmMemberIDENTITY struct { + Value IDENTITY +} + +func (*DerivationAlgorithmMemberIDENTITY) isDerivationAlgorithm() {} + +type DerivationAlgorithmMemberNone struct { + Value None +} + +func (*DerivationAlgorithmMemberNone) isDerivationAlgorithm() {} + +// EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING +// EdkWrappingAlgorithmMemberIntermediateKeyWrapping +type EdkWrappingAlgorithm interface { + isEdkWrappingAlgorithm() +} + +type EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING struct { + Value DIRECT_KEY_WRAPPING +} + +func (*EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING) isEdkWrappingAlgorithm() {} + +type EdkWrappingAlgorithmMemberIntermediateKeyWrapping struct { + Value IntermediateKeyWrapping +} + +func (*EdkWrappingAlgorithmMemberIntermediateKeyWrapping) isEdkWrappingAlgorithm() {} + // EncryptMemberAES_GCM type Encrypt interface { isEncrypt() @@ -2199,33 +2176,36 @@ type EncryptMemberAES_GCM struct { func (*EncryptMemberAES_GCM) isEncrypt() {} -// RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey -// RawEcdhStaticConfigurationsMemberPublicKeyDiscovery -// RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey -type RawEcdhStaticConfigurations interface { - isRawEcdhStaticConfigurations() +// KeyAgreementSchemeMemberStaticConfiguration +type KeyAgreementScheme interface { + isKeyAgreementScheme() } -type RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey struct { - Value EphemeralPrivateKeyToStaticPublicKeyInput +type KeyAgreementSchemeMemberStaticConfiguration struct { + Value StaticConfigurations } -func (*RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { -} +func (*KeyAgreementSchemeMemberStaticConfiguration) isKeyAgreementScheme() {} -type RawEcdhStaticConfigurationsMemberPublicKeyDiscovery struct { - Value PublicKeyDiscoveryInput +// KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey +// KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery +type KmsEcdhStaticConfigurations interface { + isKmsEcdhStaticConfigurations() } -func (*RawEcdhStaticConfigurationsMemberPublicKeyDiscovery) isRawEcdhStaticConfigurations() {} +type KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey struct { + Value KmsPrivateKeyToStaticPublicKeyInput +} -type RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey struct { - Value RawPrivateKeyToStaticPublicKeyInput +func (*KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey) isKmsEcdhStaticConfigurations() { } -func (*RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { +type KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery struct { + Value KmsPublicKeyDiscoveryInput } +func (*KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery) isKmsEcdhStaticConfigurations() {} + // MaterialsMemberBeaconKey // MaterialsMemberBranchKey // MaterialsMemberDecryption @@ -2258,66 +2238,86 @@ type MaterialsMemberEncryption struct { func (*MaterialsMemberEncryption) isMaterials() {} -// DerivationAlgorithmMemberHKDF -// DerivationAlgorithmMemberIDENTITY -// DerivationAlgorithmMemberNone -type DerivationAlgorithm interface { - isDerivationAlgorithm() +// RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey +// RawEcdhStaticConfigurationsMemberPublicKeyDiscovery +// RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey +type RawEcdhStaticConfigurations interface { + isRawEcdhStaticConfigurations() } -type DerivationAlgorithmMemberHKDF struct { - Value HKDF +type RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey struct { + Value EphemeralPrivateKeyToStaticPublicKeyInput } -func (*DerivationAlgorithmMemberHKDF) isDerivationAlgorithm() {} +func (*RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { +} -type DerivationAlgorithmMemberIDENTITY struct { - Value IDENTITY +type RawEcdhStaticConfigurationsMemberPublicKeyDiscovery struct { + Value PublicKeyDiscoveryInput } -func (*DerivationAlgorithmMemberIDENTITY) isDerivationAlgorithm() {} +func (*RawEcdhStaticConfigurationsMemberPublicKeyDiscovery) isRawEcdhStaticConfigurations() {} -type DerivationAlgorithmMemberNone struct { +type RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey struct { + Value RawPrivateKeyToStaticPublicKeyInput +} + +func (*RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey) isRawEcdhStaticConfigurations() { +} + +// SignatureAlgorithmMemberECDSA +// SignatureAlgorithmMemberNone +type SignatureAlgorithm interface { + isSignatureAlgorithm() +} + +type SignatureAlgorithmMemberECDSA struct { + Value ECDSA +} + +func (*SignatureAlgorithmMemberECDSA) isSignatureAlgorithm() {} + +type SignatureAlgorithmMemberNone struct { Value None } -func (*DerivationAlgorithmMemberNone) isDerivationAlgorithm() {} +func (*SignatureAlgorithmMemberNone) isSignatureAlgorithm() {} -// EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING -// EdkWrappingAlgorithmMemberIntermediateKeyWrapping -type EdkWrappingAlgorithm interface { - isEdkWrappingAlgorithm() +// StaticConfigurationsMemberAWS_KMS_ECDH +// StaticConfigurationsMemberRAW_ECDH +type StaticConfigurations interface { + isStaticConfigurations() } -type EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING struct { - Value DIRECT_KEY_WRAPPING +type StaticConfigurationsMemberAWS_KMS_ECDH struct { + Value KmsEcdhStaticConfigurations } -func (*EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING) isEdkWrappingAlgorithm() {} +func (*StaticConfigurationsMemberAWS_KMS_ECDH) isStaticConfigurations() {} -type EdkWrappingAlgorithmMemberIntermediateKeyWrapping struct { - Value IntermediateKeyWrapping +type StaticConfigurationsMemberRAW_ECDH struct { + Value RawEcdhStaticConfigurations } -func (*EdkWrappingAlgorithmMemberIntermediateKeyWrapping) isEdkWrappingAlgorithm() {} +func (*StaticConfigurationsMemberRAW_ECDH) isStaticConfigurations() {} -// CommitmentPolicyMemberDBE -// CommitmentPolicyMemberESDK -type CommitmentPolicy interface { - isCommitmentPolicy() +// SymmetricSignatureAlgorithmMemberHMAC +// SymmetricSignatureAlgorithmMemberNone +type SymmetricSignatureAlgorithm interface { + isSymmetricSignatureAlgorithm() } -type CommitmentPolicyMemberDBE struct { - Value DBECommitmentPolicy +type SymmetricSignatureAlgorithmMemberHMAC struct { + Value awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm } -func (*CommitmentPolicyMemberDBE) isCommitmentPolicy() {} +func (*SymmetricSignatureAlgorithmMemberHMAC) isSymmetricSignatureAlgorithm() {} -type CommitmentPolicyMemberESDK struct { - Value ESDKCommitmentPolicy +type SymmetricSignatureAlgorithmMemberNone struct { + Value None } -func (*CommitmentPolicyMemberESDK) isCommitmentPolicy() {} +func (*SymmetricSignatureAlgorithmMemberNone) isSymmetricSignatureAlgorithm() {} type AwsCryptographicMaterialProvidersBaseException interface { // This is a dummy method to allow type assertion since Go empty interfaces @@ -2334,12 +2334,6 @@ type IClientSupplier interface { GetClient(GetClientInput) (kms.Client, error) } -type IKeyring interface { - OnEncrypt(OnEncryptInput) (*OnEncryptOutput, error) - - OnDecrypt(OnDecryptInput) (*OnDecryptOutput, error) -} - type ICryptographicMaterialsCache interface { PutCacheEntry(PutCacheEntryInput) error @@ -2355,3 +2349,9 @@ type ICryptographicMaterialsManager interface { DecryptMaterials(DecryptMaterialsInput) (*DecryptMaterialsOutput, error) } + +type IKeyring interface { + OnEncrypt(OnEncryptInput) (*OnEncryptOutput, error) + + OnDecrypt(OnDecryptInput) (*OnDecryptOutput, error) +} diff --git a/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go b/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go index 6727ffcb6..fd1b2f724 100644 --- a/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go +++ b/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go @@ -9,317 +9,317 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func GenerateRandomBytesInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput) AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { +func AESDecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput) AwsCryptographyPrimitivesTypes.AESDecryptInput { - return func() AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { + return func() AwsCryptographyPrimitivesTypes.AESDecryptInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateRandomBytesInput_.Create_GenerateRandomBytesInput_(aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(nativeInput.Length)) + return AwsCryptographyPrimitivesTypes.Companion_AESDecryptInput_.Create_AESDecryptInput_(aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESDecryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(nativeInput.CipherTxt), aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(nativeInput.AuthTag), aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(nativeInput.Aad)) }() } -func DigestInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DigestInput) AwsCryptographyPrimitivesTypes.DigestInput { +func AESEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput) AwsCryptographyPrimitivesTypes.AESEncryptInput { - return func() AwsCryptographyPrimitivesTypes.DigestInput { + return func() AwsCryptographyPrimitivesTypes.AESEncryptInput { - return AwsCryptographyPrimitivesTypes.Companion_DigestInput_.Create_DigestInput_(aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_DigestInput_message_ToDafny(nativeInput.Message)) + return AwsCryptographyPrimitivesTypes.Companion_AESEncryptInput_.Create_AESEncryptInput_(aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESEncryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(nativeInput.Msg), aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(nativeInput.Aad)) }() } -func HMacInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HMacInput) AwsCryptographyPrimitivesTypes.HMacInput { +func AESEncryptOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput) AwsCryptographyPrimitivesTypes.AESEncryptOutput { - return func() AwsCryptographyPrimitivesTypes.HMacInput { + return func() AwsCryptographyPrimitivesTypes.AESEncryptOutput { - return AwsCryptographyPrimitivesTypes.Companion_HMacInput_.Create_HMacInput_(aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HMacInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_HMacInput_message_ToDafny(nativeInput.Message)) + return AwsCryptographyPrimitivesTypes.Companion_AESEncryptOutput_.Create_AESEncryptOutput_(aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(nativeOutput.CipherText), aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(nativeOutput.AuthTag)) }() } -func HkdfExtractInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput) AwsCryptographyPrimitivesTypes.HkdfExtractInput { +func AesKdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput) AwsCryptographyPrimitivesTypes.AesKdfCtrInput { - return func() AwsCryptographyPrimitivesTypes.HkdfExtractInput { + return func() AwsCryptographyPrimitivesTypes.AesKdfCtrInput { - return AwsCryptographyPrimitivesTypes.Companion_HkdfExtractInput_.Create_HkdfExtractInput_(aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExtractInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(nativeInput.Ikm)) + return AwsCryptographyPrimitivesTypes.Companion_AesKdfCtrInput_.Create_AesKdfCtrInput_(aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) }() } -func HkdfExpandInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput) AwsCryptographyPrimitivesTypes.HkdfExpandInput { +func CompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput) AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.HkdfExpandInput { + return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_HkdfExpandInput_.Create_HkdfExpandInput_(aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(nativeInput.Prk), aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) + return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyInput_.Create_CompressPublicKeyInput_(aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) }() } -func HkdfInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfInput) AwsCryptographyPrimitivesTypes.HkdfInput { +func CompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.HkdfInput { + return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_HkdfInput_.Create_HkdfInput_(aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_HkdfInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) + return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyOutput_.Create_CompressPublicKeyOutput_(aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(nativeOutput.CompressedPublicKey)) }() } -func KdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput) AwsCryptographyPrimitivesTypes.KdfCtrInput { +func DecompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.KdfCtrInput { + return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_KdfCtrInput_.Create_KdfCtrInput_(aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(nativeInput.Purpose), aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) + return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyInput_.Create_DecompressPublicKeyInput_(aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(nativeInput.CompressedPublicKey), aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) }() } -func AesKdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput) AwsCryptographyPrimitivesTypes.AesKdfCtrInput { +func DecompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.AesKdfCtrInput { + return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_AesKdfCtrInput_.Create_AesKdfCtrInput_(aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) + return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyOutput_.Create_DecompressPublicKeyOutput_(aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func AESEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput) AwsCryptographyPrimitivesTypes.AESEncryptInput { +func DeriveSharedSecretInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { - return func() AwsCryptographyPrimitivesTypes.AESEncryptInput { + return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { - return AwsCryptographyPrimitivesTypes.Companion_AESEncryptInput_.Create_AESEncryptInput_(aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESEncryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(nativeInput.Msg), aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(nativeInput.Aad)) + return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretInput_.Create_DeriveSharedSecretInput_(aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func AESEncryptOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput) AwsCryptographyPrimitivesTypes.AESEncryptOutput { +func DeriveSharedSecretOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { - return func() AwsCryptographyPrimitivesTypes.AESEncryptOutput { + return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { - return AwsCryptographyPrimitivesTypes.Companion_AESEncryptOutput_.Create_AESEncryptOutput_(aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(nativeOutput.CipherText), aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(nativeOutput.AuthTag)) + return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretOutput_.Create_DeriveSharedSecretOutput_(aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(nativeOutput.SharedSecret)) }() } -func AESDecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput) AwsCryptographyPrimitivesTypes.AESDecryptInput { +func DigestInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DigestInput) AwsCryptographyPrimitivesTypes.DigestInput { - return func() AwsCryptographyPrimitivesTypes.AESDecryptInput { + return func() AwsCryptographyPrimitivesTypes.DigestInput { - return AwsCryptographyPrimitivesTypes.Companion_AESDecryptInput_.Create_AESDecryptInput_(aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESDecryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(nativeInput.CipherTxt), aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(nativeInput.AuthTag), aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(nativeInput.Aad)) + return AwsCryptographyPrimitivesTypes.Companion_DigestInput_.Create_DigestInput_(aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_DigestInput_message_ToDafny(nativeInput.Message)) }() } -func GenerateRSAKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { +func ECDSASignInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput) AwsCryptographyPrimitivesTypes.ECDSASignInput { - return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { + return func() AwsCryptographyPrimitivesTypes.ECDSASignInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairInput_.Create_GenerateRSAKeyPairInput_(aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(nativeInput.LengthBits)) + return AwsCryptographyPrimitivesTypes.Companion_ECDSASignInput_.Create_ECDSASignInput_(aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_primitives_ECDSASignInput_message_ToDafny(nativeInput.Message)) }() } -func GenerateRSAKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { +func ECDSAVerifyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput) AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { - return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { + return func() AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairOutput_.Create_GenerateRSAKeyPairOutput_(aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey), aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey)) + return AwsCryptographyPrimitivesTypes.Companion_ECDSAVerifyInput_.Create_ECDSAVerifyInput_(aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(nativeInput.VerificationKey), aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(nativeInput.Message), aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(nativeInput.Signature)) }() } -func GetRSAKeyModulusLengthInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { +func GenerateECCKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { - return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { + return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { - return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthInput_.Create_GetRSAKeyModulusLengthInput_(aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairInput_.Create_GenerateECCKeyPairInput_(aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(nativeInput.EccCurve)) }() } -func GetRSAKeyModulusLengthOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { +func GenerateECCKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { - return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { + return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { - return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthOutput_.Create_GetRSAKeyModulusLengthOutput_(aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(nativeOutput.Length)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairOutput_.Create_GenerateECCKeyPairOutput_(aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func RSADecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput) AwsCryptographyPrimitivesTypes.RSADecryptInput { +func GenerateECDSASignatureKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyInput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { - return func() AwsCryptographyPrimitivesTypes.RSADecryptInput { + return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_RSADecryptInput_.Create_RSADecryptInput_(aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(nativeInput.CipherText)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyInput_.Create_GenerateECDSASignatureKeyInput_(aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm)) }() } -func RSAEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput) AwsCryptographyPrimitivesTypes.RSAEncryptInput { +func GenerateECDSASignatureKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyOutput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { - return func() AwsCryptographyPrimitivesTypes.RSAEncryptInput { + return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_RSAEncryptInput_.Create_RSAEncryptInput_(aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(nativeInput.Plaintext)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyOutput_.Create_GenerateECDSASignatureKeyOutput_(aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(nativeOutput.SignatureAlgorithm), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(nativeOutput.VerificationKey), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(nativeOutput.SigningKey)) }() } -func GenerateECDSASignatureKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyInput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { +func GenerateRandomBytesInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput) AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { - return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { + return func() AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyInput_.Create_GenerateECDSASignatureKeyInput_(aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateRandomBytesInput_.Create_GenerateRandomBytesInput_(aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(nativeInput.Length)) }() } -func GenerateECDSASignatureKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyOutput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { +func GenerateRSAKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { - return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { + return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyOutput_.Create_GenerateECDSASignatureKeyOutput_(aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(nativeOutput.SignatureAlgorithm), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(nativeOutput.VerificationKey), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(nativeOutput.SigningKey)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairInput_.Create_GenerateRSAKeyPairInput_(aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(nativeInput.LengthBits)) }() } -func ECDSASignInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput) AwsCryptographyPrimitivesTypes.ECDSASignInput { +func GenerateRSAKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { - return func() AwsCryptographyPrimitivesTypes.ECDSASignInput { + return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { - return AwsCryptographyPrimitivesTypes.Companion_ECDSASignInput_.Create_ECDSASignInput_(aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_primitives_ECDSASignInput_message_ToDafny(nativeInput.Message)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairOutput_.Create_GenerateRSAKeyPairOutput_(aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey), aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey)) }() } -func ECDSAVerifyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput) AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { +func GetPublicKeyFromPrivateKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyInput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { - return func() AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { + return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_ECDSAVerifyInput_.Create_ECDSAVerifyInput_(aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(nativeInput.VerificationKey), aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(nativeInput.Message), aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(nativeInput.Signature)) + return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyInput_.Create_GetPublicKeyFromPrivateKeyInput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(nativeInput.PrivateKey)) }() } -func GenerateECCKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { +func GetPublicKeyFromPrivateKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyOutput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { - return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { + return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairInput_.Create_GenerateECCKeyPairInput_(aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(nativeInput.EccCurve)) + return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyOutput_.Create_GetPublicKeyFromPrivateKeyOutput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func GenerateECCKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { +func GetRSAKeyModulusLengthInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { - return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { + return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairOutput_.Create_GenerateECCKeyPairOutput_(aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthInput_.Create_GetRSAKeyModulusLengthInput_(aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func GetPublicKeyFromPrivateKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyInput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { +func GetRSAKeyModulusLengthOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { - return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { + return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { - return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyInput_.Create_GetPublicKeyFromPrivateKeyInput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(nativeInput.PrivateKey)) + return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthOutput_.Create_GetRSAKeyModulusLengthOutput_(aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(nativeOutput.Length)) }() } -func GetPublicKeyFromPrivateKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyOutput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { +func HkdfInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfInput) AwsCryptographyPrimitivesTypes.HkdfInput { - return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { + return func() AwsCryptographyPrimitivesTypes.HkdfInput { - return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyOutput_.Create_GetPublicKeyFromPrivateKeyOutput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_HkdfInput_.Create_HkdfInput_(aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_HkdfInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) }() } -func ValidatePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { +func HkdfExpandInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput) AwsCryptographyPrimitivesTypes.HkdfExpandInput { - return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.HkdfExpandInput { - return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyInput_.Create_ValidatePublicKeyInput_(aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_HkdfExpandInput_.Create_HkdfExpandInput_(aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(nativeInput.Prk), aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) }() } -func ValidatePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { +func HkdfExtractInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput) AwsCryptographyPrimitivesTypes.HkdfExtractInput { - return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.HkdfExtractInput { - return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyOutput_.Create_ValidatePublicKeyOutput_(aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(nativeOutput.Success)) + return AwsCryptographyPrimitivesTypes.Companion_HkdfExtractInput_.Create_HkdfExtractInput_(aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExtractInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(nativeInput.Ikm)) }() } -func DeriveSharedSecretInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { +func HMacInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HMacInput) AwsCryptographyPrimitivesTypes.HMacInput { - return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { + return func() AwsCryptographyPrimitivesTypes.HMacInput { - return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretInput_.Create_DeriveSharedSecretInput_(aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_HMacInput_.Create_HMacInput_(aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HMacInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_HMacInput_message_ToDafny(nativeInput.Message)) }() } -func DeriveSharedSecretOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { +func KdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput) AwsCryptographyPrimitivesTypes.KdfCtrInput { - return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { + return func() AwsCryptographyPrimitivesTypes.KdfCtrInput { - return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretOutput_.Create_DeriveSharedSecretOutput_(aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(nativeOutput.SharedSecret)) + return AwsCryptographyPrimitivesTypes.Companion_KdfCtrInput_.Create_KdfCtrInput_(aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(nativeInput.Purpose), aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) }() } -func CompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput) AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { +func ParsePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput) AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyInput_.Create_CompressPublicKeyInput_(aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) + return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyInput_.Create_ParsePublicKeyInput_(aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func CompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { +func ParsePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput) AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyOutput_.Create_CompressPublicKeyOutput_(aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(nativeOutput.CompressedPublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyOutput_.Create_ParsePublicKeyOutput_(aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func DecompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { +func RSADecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput) AwsCryptographyPrimitivesTypes.RSADecryptInput { - return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.RSADecryptInput { - return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyInput_.Create_DecompressPublicKeyInput_(aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(nativeInput.CompressedPublicKey), aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) + return AwsCryptographyPrimitivesTypes.Companion_RSADecryptInput_.Create_RSADecryptInput_(aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(nativeInput.CipherText)) }() } -func DecompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { +func RSAEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput) AwsCryptographyPrimitivesTypes.RSAEncryptInput { - return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.RSAEncryptInput { - return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyOutput_.Create_DecompressPublicKeyOutput_(aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_RSAEncryptInput_.Create_RSAEncryptInput_(aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(nativeInput.Plaintext)) }() } -func ParsePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput) AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { +func ValidatePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyInput_.Create_ParsePublicKeyInput_(aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyInput_.Create_ValidatePublicKeyInput_(aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func ParsePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput) AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { +func ValidatePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyOutput_.Create_ParsePublicKeyOutput_(aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyOutput_.Create_ValidatePublicKeyOutput_(aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(nativeOutput.Success)) }() } @@ -372,7 +372,35 @@ func CryptoConfig_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedty } -func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { + return func() AwsCryptographyPrimitivesTypes.AES__GCM { + + return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) + }() +} + +func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_AESDecryptInput_key_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -385,7 +413,7 @@ func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_ToDafny(input [] }() } -func aws_cryptography_primitives_AESDecryptInput_key_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -398,7 +426,7 @@ func aws_cryptography_primitives_AESDecryptInput_key_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -411,49 +439,7 @@ func aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(input []byte) }() } -func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - }() -} - -func aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) - }() -} - -func aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -466,21 +452,7 @@ func aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(input []byte }() } -func aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func Aws_cryptography_primitives_ECDSAVerifyOutput_success_ToDafny(input bool) bool { - return func() bool { - - return input - }() -} - -func Aws_cryptography_primitives_HkdfOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -493,21 +465,7 @@ func Aws_cryptography_primitives_HkdfOutput_okm_ToDafny(input []byte) dafny.Sequ }() } -func aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_AESDecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -520,29 +478,14 @@ func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDa }() } -func aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { + return func() AwsCryptographyPrimitivesTypes.AES__GCM { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) }() } -func Aws_cryptography_primitives_AESDecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -555,7 +498,7 @@ func Aws_cryptography_primitives_AESDecryptOutput_plaintext_ToDafny(input []byte }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_key_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -568,14 +511,7 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(input }() } -func aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -588,7 +524,7 @@ func aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(input []byte) d }() } -func aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -601,7 +537,7 @@ func aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(input []byte) }() } -func Aws_cryptography_primitives_KdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -614,7 +550,7 @@ func Aws_cryptography_primitives_KdfCtrOutput_okm_ToDafny(input []byte) dafny.Se }() } -func aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -627,36 +563,7 @@ func aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(input []byte) dafny.Seq }() } -func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - }() -} - -func aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -669,14 +576,14 @@ func aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(input []byte) dafn }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(input int32) int32 { +func aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -689,28 +596,7 @@ func aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(input []byte) Wrapp }() } -func aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) - }() -} - -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_AesKdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -723,20 +609,14 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDa }() } -func aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) }() } -func aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -749,7 +629,7 @@ func aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int @@ -771,7 +651,7 @@ func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(input }() } -func Aws_cryptography_primitives_ECDSASignOutput_signature_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -784,7 +664,20 @@ func Aws_cryptography_primitives_ECDSASignOutput_signature_ToDafny(input []byte) }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int @@ -806,6 +699,13 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(input a }() } +func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) + }() +} + func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { @@ -828,14 +728,14 @@ func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(input }() } -func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return input + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) }() } -func aws_cryptography_primitives_HkdfInput_info_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -848,7 +748,14 @@ func aws_cryptography_primitives_HkdfInput_info_ToDafny(input []byte) dafny.Sequ }() } -func aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) + }() +} + +func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -861,20 +768,29 @@ func aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(input []byte) dafn }() } -func aws_cryptography_primitives_HMacInput_key_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func Aws_cryptography_primitives_DigestOutput_digest_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_DigestInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -887,7 +803,7 @@ func Aws_cryptography_primitives_DigestOutput_digest_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_DigestOutput_digest_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -900,34 +816,29 @@ func aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(input []byt }() } -func aws_cryptography_primitives_AESEncryptInput_key_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) - }() -} - -func aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return input + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) }() } -func aws_cryptography_primitives_DigestInput_message_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -940,7 +851,7 @@ func aws_cryptography_primitives_DigestInput_message_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSASignInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -953,7 +864,7 @@ func aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input []byte) dafny.Se }() } -func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_ECDSASignOutput_signature_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -966,20 +877,29 @@ func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(input []b }() } -func aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -992,14 +912,7 @@ func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(i }() } -func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey) AwsCryptographyPrimitivesTypes.RSAPublicKey { - return func() AwsCryptographyPrimitivesTypes.RSAPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_RSAPublicKey_.Create_RSAPublicKey_(aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input.Pem)) - }() -} - -func aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1012,7 +925,7 @@ func aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1025,40 +938,116 @@ func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_To }() } -func aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func Aws_cryptography_primitives_ECDSAVerifyOutput_success_ToDafny(input bool) bool { + return func() bool { + + return input + }() +} + +func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPrivateKey) AwsCryptographyPrimitivesTypes.RSAPrivateKey { - return func() AwsCryptographyPrimitivesTypes.RSAPrivateKey { +func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return AwsCryptographyPrimitivesTypes.Companion_RSAPrivateKey_.Create_RSAPrivateKey_(aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input.Pem)) + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) }() } -func aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) + }() +} + +func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + }() +} + +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + }() +} + +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1071,7 +1060,7 @@ func aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(input []byte) }() } -func aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1084,7 +1073,14 @@ func aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(input []byte) }() } -func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1097,20 +1093,28 @@ func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(input }() } -func aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) +func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_primitives_HMacInput_message_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey) AwsCryptographyPrimitivesTypes.RSAPublicKey { + return func() AwsCryptographyPrimitivesTypes.RSAPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_RSAPublicKey_.Create_RSAPublicKey_(aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input.Pem)) + }() +} + +func aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1123,51 +1127,35 @@ func aws_cryptography_primitives_HMacInput_message_ToDafny(input []byte) dafny.S }() } -func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPrivateKey) AwsCryptographyPrimitivesTypes.RSAPrivateKey { + return func() AwsCryptographyPrimitivesTypes.RSAPrivateKey { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return AwsCryptographyPrimitivesTypes.Companion_RSAPrivateKey_.Create_RSAPrivateKey_(aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input.Pem)) }() } -func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { +func aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(input bool) bool { - return func() bool { - - return input +func aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int for _, enumVal := range input.Values() { @@ -1177,19 +1165,26 @@ func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(input } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { - return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) + }() +} + +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int for _, enumVal := range input.Values() { @@ -1199,31 +1194,25 @@ func aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(input awscrypto } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func Aws_cryptography_primitives_HkdfExtractOutput_prk_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) }() } -func Aws_cryptography_primitives_RSADecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1236,14 +1225,7 @@ func Aws_cryptography_primitives_RSADecryptOutput_plaintext_ToDafny(input []byte }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) - }() -} - -func aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1256,14 +1238,14 @@ func aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(input []byte }() } -func aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { - return func() AwsCryptographyPrimitivesTypes.AES__GCM { +func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(input int32) int32 { + return func() int32 { - return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) + return input }() } -func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int @@ -1285,7 +1267,20 @@ func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(input a }() } -func Aws_cryptography_primitives_HkdfExpandOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfInput_salt_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func aws_cryptography_primitives_HkdfInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1298,30 +1293,41 @@ func Aws_cryptography_primitives_HkdfExpandOutput_okm_ToDafny(input []byte) dafn }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_HkdfInput_info_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func Aws_cryptography_primitives_HkdfOutput_okm_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { - return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { +func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int for _, enumVal := range input.Values() { @@ -1331,25 +1337,18 @@ func aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(input awscrypto } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) - }() -} - -func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1362,7 +1361,7 @@ func aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input []byte) dafny.Se }() } -func aws_cryptography_primitives_HkdfInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1375,29 +1374,14 @@ func aws_cryptography_primitives_HkdfInput_ikm_ToDafny(input []byte) dafny.Seque }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(input int32) int32 { + return func() int32 { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return input }() } -func aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_HkdfExpandOutput_okm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1410,7 +1394,7 @@ func aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(input []byte) }() } -func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int @@ -1445,7 +1429,7 @@ func aws_cryptography_primitives_HkdfExtractInput_salt_ToDafny(input []byte) Wra }() } -func Aws_cryptography_primitives_HMacOutput_digest_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1458,21 +1442,21 @@ func Aws_cryptography_primitives_HMacOutput_digest_ToDafny(input []byte) dafny.S }() } -func aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func Aws_cryptography_primitives_HkdfExtractOutput_prk_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int for _, enumVal := range input.Values() { @@ -1482,40 +1466,31 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgori } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func aws_cryptography_primitives_HMacInput_key_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HMacInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1528,14 +1503,20 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey }() } -func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) +func Aws_cryptography_primitives_HMacOutput_digest_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int @@ -1557,7 +1538,7 @@ func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(input }() } -func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1570,29 +1551,27 @@ func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_ToDafny(input []byt }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(input int32) int32 { + return func() int32 { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + return input + }() +} + +func aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_primitives_HkdfInput_salt_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -1605,7 +1584,7 @@ func aws_cryptography_primitives_HkdfInput_salt_ToDafny(input []byte) Wrappers.O }() } -func aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_KdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1618,7 +1597,7 @@ func aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input []byte) dafny.S }() } -func aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1631,22 +1610,15 @@ func aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - return input + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) }() } -func aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { + return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { var index int for _, enumVal := range input.Values() { @@ -1656,18 +1628,18 @@ func aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(input awscryp } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) }() } -func aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1680,8 +1652,34 @@ func aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(input []byte) dafny. }() } -func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func Aws_cryptography_primitives_RSADecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { + return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { var index int for _, enumVal := range input.Values() { @@ -1691,25 +1689,18 @@ func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(input } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - }() -} - -func aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { - return func() AwsCryptographyPrimitivesTypes.AES__GCM { - - return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) + return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) }() } -func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1722,7 +1713,7 @@ func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToD }() } -func aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1735,14 +1726,7 @@ func aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(input []byte) dafny. }() } -func aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_ECDSASignInput_message_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1755,20 +1739,29 @@ func aws_cryptography_primitives_ECDSASignInput_message_ToDafny(input []byte) da }() } -func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func Aws_cryptography_primitives_AesKdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1781,9 +1774,16 @@ func Aws_cryptography_primitives_AesKdfCtrOutput_okm_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { +func aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(input bool) bool { + return func() bool { - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) + return input + }() +} + +func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } diff --git a/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go b/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go index b33c76b63..0cb121c76 100644 --- a/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go +++ b/AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go @@ -8,150 +8,127 @@ import ( "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" ) -func GenerateRandomBytesInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput { - - return awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput{Length: aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(dafnyInput.Dtor_length())} - -} - -func DigestInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DigestInput) awscryptographyprimitivessmithygeneratedtypes.DigestInput { - - return awscryptographyprimitivessmithygeneratedtypes.DigestInput{DigestAlgorithm: aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Message: aws_cryptography_primitives_DigestInput_message_FromDafny(dafnyInput.Dtor_message()), - } - -} - -func HMacInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HMacInput) awscryptographyprimitivessmithygeneratedtypes.HMacInput { +func AESDecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESDecryptInput) awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput { - return awscryptographyprimitivessmithygeneratedtypes.HMacInput{DigestAlgorithm: aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Key: aws_cryptography_primitives_HMacInput_key_FromDafny(dafnyInput.Dtor_key()), - Message: aws_cryptography_primitives_HMacInput_message_FromDafny(dafnyInput.Dtor_message()), + return awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput{EncAlg: aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), + Key: aws_cryptography_primitives_AESDecryptInput_key_FromDafny(dafnyInput.Dtor_key()), + CipherTxt: aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(dafnyInput.Dtor_cipherTxt()), + AuthTag: aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(dafnyInput.Dtor_authTag()), + Iv: aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), + Aad: aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), } } -func HkdfExtractInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExtractInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput { +func AESEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESEncryptInput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput { - return awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Salt: aws_cryptography_primitives_HkdfExtractInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), - Ikm: aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + return awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput{EncAlg: aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), + Iv: aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), + Key: aws_cryptography_primitives_AESEncryptInput_key_FromDafny(dafnyInput.Dtor_key()), + Msg: aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(dafnyInput.Dtor_msg()), + Aad: aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), } } -func HkdfExpandInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExpandInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput { +func AESEncryptOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.AESEncryptOutput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput { - return awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Prk: aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(dafnyInput.Dtor_prk()), - Info: aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(dafnyInput.Dtor_info()), - ExpectedLength: aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + return awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput{CipherText: aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(dafnyOutput.Dtor_cipherText()), + AuthTag: aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(dafnyOutput.Dtor_authTag()), } } -func HkdfInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfInput) awscryptographyprimitivessmithygeneratedtypes.HkdfInput { +func AesKdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AesKdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput { - return awscryptographyprimitivessmithygeneratedtypes.HkdfInput{DigestAlgorithm: aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Salt: aws_cryptography_primitives_HkdfInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), - Ikm: aws_cryptography_primitives_HkdfInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), - Info: aws_cryptography_primitives_HkdfInput_info_FromDafny(dafnyInput.Dtor_info()), - ExpectedLength: aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + return awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput{Ikm: aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + ExpectedLength: aws_cryptography_primitives_AesKdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + Nonce: aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), } } -func KdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.KdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput { +func CompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.CompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput{DigestAlgorithm: aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Ikm: aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), - ExpectedLength: aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), - Purpose: aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(dafnyInput.Dtor_purpose().UnwrapOr(nil)), - Nonce: aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), + return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput{PublicKey: aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + EccCurve: aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), } } -func AesKdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AesKdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput { +func CompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput{Ikm: aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), - ExpectedLength: aws_cryptography_primitives_AesKdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), - Nonce: aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), - } + return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput{CompressedPublicKey: aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(dafnyOutput.Dtor_compressedPublicKey())} } -func AESEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESEncryptInput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput { +func DecompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput{EncAlg: aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), - Iv: aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), - Key: aws_cryptography_primitives_AESEncryptInput_key_FromDafny(dafnyInput.Dtor_key()), - Msg: aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(dafnyInput.Dtor_msg()), - Aad: aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), + return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput{CompressedPublicKey: aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(dafnyInput.Dtor_compressedPublicKey()), + EccCurve: aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), } } -func AESEncryptOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.AESEncryptOutput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput { +func DecompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput{CipherText: aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(dafnyOutput.Dtor_cipherText()), - AuthTag: aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(dafnyOutput.Dtor_authTag()), - } + return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput{PublicKey: aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} } -func AESDecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESDecryptInput) awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput { +func DeriveSharedSecretInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput { - return awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput{EncAlg: aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), - Key: aws_cryptography_primitives_AESDecryptInput_key_FromDafny(dafnyInput.Dtor_key()), - CipherTxt: aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(dafnyInput.Dtor_cipherTxt()), - AuthTag: aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(dafnyInput.Dtor_authTag()), - Iv: aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), - Aad: aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), + return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput{EccCurve: aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + PrivateKey: aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), + PublicKey: aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), } } -func GenerateRSAKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput { +func DeriveSharedSecretOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput{LengthBits: aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(dafnyInput.Dtor_lengthBits())} + return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput{SharedSecret: aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(dafnyOutput.Dtor_sharedSecret())} } -func GenerateRSAKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput { +func DigestInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DigestInput) awscryptographyprimitivessmithygeneratedtypes.DigestInput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput{PublicKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), - PrivateKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), + return awscryptographyprimitivessmithygeneratedtypes.DigestInput{DigestAlgorithm: aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Message: aws_cryptography_primitives_DigestInput_message_FromDafny(dafnyInput.Dtor_message()), } } -func GetRSAKeyModulusLengthInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput { +func ECDSASignInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSASignInput) awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput { - return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput{PublicKey: aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), + SigningKey: aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey()), + Message: aws_cryptography_primitives_ECDSASignInput_message_FromDafny(dafnyInput.Dtor_message()), + } } -func GetRSAKeyModulusLengthOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput { +func ECDSAVerifyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSAVerifyInput) awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput { - return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput{Length: aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(dafnyOutput.Dtor_length())} + return awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), + VerificationKey: aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey()), + Message: aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(dafnyInput.Dtor_message()), + Signature: aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(dafnyInput.Dtor_signature()), + } } -func RSADecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSADecryptInput) awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput { +func GenerateECCKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput { - return awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput{Padding: aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), - PrivateKey: aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), - CipherText: aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(dafnyInput.Dtor_cipherText()), - } + return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve())} } -func RSAEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSAEncryptInput) awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput { +func GenerateECCKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput { - return awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput{Padding: aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), - PublicKey: aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), - Plaintext: aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(dafnyInput.Dtor_plaintext()), + return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(dafnyOutput.Dtor_eccCurve()), + PrivateKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), + PublicKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), } } @@ -171,36 +148,22 @@ func GenerateECDSASignatureKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimit } -func ECDSASignInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSASignInput) awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput { - - return awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), - SigningKey: aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey()), - Message: aws_cryptography_primitives_ECDSASignInput_message_FromDafny(dafnyInput.Dtor_message()), - } - -} - -func ECDSAVerifyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSAVerifyInput) awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput { +func GenerateRandomBytesInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput { - return awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), - VerificationKey: aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey()), - Message: aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(dafnyInput.Dtor_message()), - Signature: aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(dafnyInput.Dtor_signature()), - } + return awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput{Length: aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(dafnyInput.Dtor_length())} } -func GenerateECCKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput { +func GenerateRSAKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve())} + return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput{LengthBits: aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(dafnyInput.Dtor_lengthBits())} } -func GenerateECCKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput { +func GenerateRSAKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(dafnyOutput.Dtor_eccCurve()), - PrivateKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), - PublicKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), + return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput{PublicKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), + PrivateKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), } } @@ -222,72 +185,109 @@ func GetPublicKeyFromPrivateKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimi } -func ValidatePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput { +func GetRSAKeyModulusLengthInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput { - return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput{EccCurve: aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), - PublicKey: aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput{PublicKey: aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} + +} + +func GetRSAKeyModulusLengthOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput { + + return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput{Length: aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(dafnyOutput.Dtor_length())} + +} + +func HkdfInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfInput) awscryptographyprimitivessmithygeneratedtypes.HkdfInput { + + return awscryptographyprimitivessmithygeneratedtypes.HkdfInput{DigestAlgorithm: aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Salt: aws_cryptography_primitives_HkdfInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), + Ikm: aws_cryptography_primitives_HkdfInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + Info: aws_cryptography_primitives_HkdfInput_info_FromDafny(dafnyInput.Dtor_info()), + ExpectedLength: aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), } } -func ValidatePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput { +func HkdfExpandInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExpandInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput { - return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput{Success: aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(dafnyOutput.Dtor_success())} + return awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Prk: aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(dafnyInput.Dtor_prk()), + Info: aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(dafnyInput.Dtor_info()), + ExpectedLength: aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + } } -func DeriveSharedSecretInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput { +func HkdfExtractInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExtractInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput { - return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput{EccCurve: aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), - PrivateKey: aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), - PublicKey: aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + return awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Salt: aws_cryptography_primitives_HkdfExtractInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), + Ikm: aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), } } -func DeriveSharedSecretOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput { +func HMacInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HMacInput) awscryptographyprimitivessmithygeneratedtypes.HMacInput { - return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput{SharedSecret: aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(dafnyOutput.Dtor_sharedSecret())} + return awscryptographyprimitivessmithygeneratedtypes.HMacInput{DigestAlgorithm: aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Key: aws_cryptography_primitives_HMacInput_key_FromDafny(dafnyInput.Dtor_key()), + Message: aws_cryptography_primitives_HMacInput_message_FromDafny(dafnyInput.Dtor_message()), + } } -func CompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.CompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput { +func KdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.KdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput { - return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput{PublicKey: aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), - EccCurve: aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + return awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput{DigestAlgorithm: aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Ikm: aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + ExpectedLength: aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + Purpose: aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(dafnyInput.Dtor_purpose().UnwrapOr(nil)), + Nonce: aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), } } -func CompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput { +func ParsePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ParsePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput{CompressedPublicKey: aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(dafnyOutput.Dtor_compressedPublicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput{PublicKey: aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} } -func DecompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput { +func ParsePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput{CompressedPublicKey: aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(dafnyInput.Dtor_compressedPublicKey()), - EccCurve: aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput{PublicKey: aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} + +} + +func RSADecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSADecryptInput) awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput { + + return awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput{Padding: aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), + PrivateKey: aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), + CipherText: aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(dafnyInput.Dtor_cipherText()), } } -func DecompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput { +func RSAEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSAEncryptInput) awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput { - return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput{PublicKey: aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput{Padding: aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), + PublicKey: aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + Plaintext: aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(dafnyInput.Dtor_plaintext()), + } } -func ParsePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ParsePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput { +func ValidatePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput{PublicKey: aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput{EccCurve: aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + PublicKey: aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + } } -func ParsePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput { +func ValidatePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput{PublicKey: aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput{Success: aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(dafnyOutput.Dtor_success())} } @@ -349,39 +349,31 @@ func CryptoConfig_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.CryptoCon } -func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { + return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), + TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), + IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + } +} +func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_AESDecryptInput_key_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_AESDecryptInput_key_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -397,28 +389,7 @@ func aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(input interf } }() } -func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} -} -func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -434,7 +405,7 @@ func aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -450,16 +421,7 @@ func aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(input inte } }() } -func aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func Aws_cryptography_primitives_ECDSAVerifyOutput_success_FromDafny(input interface{}) bool { - return input.(bool) -} -func Aws_cryptography_primitives_HkdfOutput_okm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -475,16 +437,7 @@ func Aws_cryptography_primitives_HkdfOutput_okm_FromDafny(input interface{}) []b } }() } -func aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} -} -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -500,24 +453,6 @@ func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_From } }() } -func aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} func Aws_cryptography_primitives_AESDecryptOutput_plaintext_FromDafny(input interface{}) []byte { return func() []byte { var b []byte @@ -534,7 +469,13 @@ func Aws_cryptography_primitives_AESDecryptOutput_plaintext_FromDafny(input inte } }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { + return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), + TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), + IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + } +} +func aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -550,13 +491,7 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(inpu } }() } -func aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_key_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -572,7 +507,7 @@ func aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(input interfa } }() } -func aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -588,7 +523,7 @@ func aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(input inter } }() } -func Aws_cryptography_primitives_KdfCtrOutput_okm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -604,7 +539,7 @@ func Aws_cryptography_primitives_KdfCtrOutput_okm_FromDafny(input interface{}) [ } }() } -func aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -620,28 +555,7 @@ func aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(input interface{}) [] } }() } -func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} -} -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -657,13 +571,7 @@ func aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -685,16 +593,7 @@ func aws_cryptography_primitives_AesKdfCtrInput_expectedLength_FromDafny(input i return b }() } -func aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} -} -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -710,7 +609,7 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_From } }() } -func aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_AesKdfCtrOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -726,7 +625,10 @@ func aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(input inte } }() } -func aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} +func aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -742,7 +644,7 @@ func aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { +func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) @@ -760,7 +662,7 @@ func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(inp return u.Values()[index] }() } -func Aws_cryptography_primitives_ECDSASignOutput_signature_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -776,7 +678,23 @@ func Aws_cryptography_primitives_ECDSASignOutput_signature_FromDafny(input inter } }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { +func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) @@ -794,6 +712,9 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(input return u.Values()[index] }() } +func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec @@ -812,13 +733,10 @@ func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(inpu return u.Values()[index] }() } -func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() +func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} } -func aws_cryptography_primitives_HkdfInput_info_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -834,7 +752,10 @@ func aws_cryptography_primitives_HkdfInput_info_FromDafny(input interface{}) []b } }() } -func aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} +func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -850,7 +771,25 @@ func aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_HMacInput_key_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_DigestInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -882,7 +821,25 @@ func Aws_cryptography_primitives_DigestOutput_digest_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -898,7 +855,7 @@ func aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(input int } }() } -func aws_cryptography_primitives_AESEncryptInput_key_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSASignInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -914,19 +871,41 @@ func aws_cryptography_primitives_AESEncryptInput_key_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_RSAPrivateKey_lengthBits_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func Aws_cryptography_primitives_ECDSASignOutput_signature_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() } -func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] }() } -func aws_cryptography_primitives_DigestInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -942,7 +921,7 @@ func aws_cryptography_primitives_DigestInput_message_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -958,7 +937,7 @@ func aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input interface{}) [ } }() } -func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -974,7 +953,88 @@ func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(input i } }() } -func aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_ECDSAVerifyOutput_success_FromDafny(input interface{}) bool { + return input.(bool) +} +func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +} +func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} +func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -990,7 +1050,7 @@ func aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1006,12 +1066,13 @@ func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny } }() } -func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey{LengthBits: aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_lengthBits()), - Pem: aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_pem()), - } +func aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() } -func aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1027,39 +1088,24 @@ func aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey{LengthBits: aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_lengthBits()), + Pem: aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_pem()), + } +} +func aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_RSAPrivateKey_pem_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1080,7 +1126,13 @@ func aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_FromDafny(i Pem: aws_cryptography_primitives_RSAPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPrivateKey).Dtor_pem()), } } -func aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAPrivateKey_lengthBits_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_RSAPrivateKey_pem_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1096,39 +1148,49 @@ func aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(input interf } }() } -func aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } -func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +} +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } -func aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +} +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1144,7 +1206,7 @@ func aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_HMacInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1160,10 +1222,13 @@ func aws_cryptography_primitives_HMacInput_message_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() } -func aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) @@ -1181,52 +1246,7 @@ func aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(input int return u.Values()[index] }() } -func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(input interface{}) bool { - return input.(bool) -} -func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode - inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func Aws_cryptography_primitives_HkdfExtractOutput_prk_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfInput_salt_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1242,7 +1262,7 @@ func Aws_cryptography_primitives_HkdfExtractOutput_prk_FromDafny(input interface } }() } -func Aws_cryptography_primitives_RSADecryptOutput_plaintext_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1258,10 +1278,7 @@ func Aws_cryptography_primitives_RSADecryptOutput_plaintext_FromDafny(input inte } }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} -} -func aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfInput_info_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1277,31 +1294,13 @@ func aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(input inte } }() } -func aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { - return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), - TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), - IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), - } -} -func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] +func aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func Aws_cryptography_primitives_HkdfExpandOutput_okm_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_HkdfOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1317,46 +1316,25 @@ func Aws_cryptography_primitives_HkdfExpandOutput_okm_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode - inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) +func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { break } } } - return u.Values()[index] - }() -} -func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} + return u.Values()[index] + }() } -func aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1372,7 +1350,7 @@ func aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input interface{}) [ } }() } -func aws_cryptography_primitives_HkdfInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1388,25 +1366,13 @@ func aws_cryptography_primitives_HkdfInput_ikm_FromDafny(input interface{}) []by } }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] +func aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_HkdfExpandOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1422,7 +1388,7 @@ func aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(input inter } }() } -func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) @@ -1456,7 +1422,7 @@ func aws_cryptography_primitives_HkdfExtractInput_salt_FromDafny(input interface } }() } -func Aws_cryptography_primitives_HMacOutput_digest_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1472,7 +1438,7 @@ func Aws_cryptography_primitives_HMacOutput_digest_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_HkdfExtractOutput_prk_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1488,16 +1454,16 @@ func aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) +func aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { break } } @@ -1506,25 +1472,23 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgori return u.Values()[index] }() } -func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } +func aws_cryptography_primitives_HMacInput_key_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - - return u.Values()[index] }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HMacInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1540,10 +1504,23 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey } }() } -func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +func Aws_cryptography_primitives_HMacOutput_digest_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() } -func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { +func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) @@ -1561,7 +1538,7 @@ func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(inpu return u.Values()[index] }() } -func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1577,25 +1554,13 @@ func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_FromDafny(input int } }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] +func aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_HkdfInput_salt_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1611,7 +1576,7 @@ func aws_cryptography_primitives_HkdfInput_salt_FromDafny(input interface{}) []b } }() } -func aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1627,7 +1592,7 @@ func aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_KdfCtrOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1643,35 +1608,35 @@ func aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() +func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} } -func aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) +func aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode + inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { break } } @@ -1680,7 +1645,7 @@ func aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(input inter return u.Values()[index] }() } -func aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1696,31 +1661,23 @@ func aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } +func aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - - return u.Values()[index] }() } -func aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { - return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), - TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), - IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), - } -} -func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_RSADecryptOutput_plaintext_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1736,7 +1693,25 @@ func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_Fro } }() } -func aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode + inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1752,13 +1727,7 @@ func aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_ECDSASignInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1774,7 +1743,7 @@ func aws_cryptography_primitives_ECDSASignInput_message_FromDafny(input interfac } }() } -func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1790,7 +1759,25 @@ func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny } }() } -func Aws_cryptography_primitives_AesKdfCtrOutput_okm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1806,6 +1793,19 @@ func Aws_cryptography_primitives_AesKdfCtrOutput_okm_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +func aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(input interface{}) bool { + return input.(bool) +} +func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } diff --git a/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go b/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go index 6727ffcb6..fd1b2f724 100644 --- a/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go +++ b/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_dafny.go @@ -9,317 +9,317 @@ import ( "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" ) -func GenerateRandomBytesInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput) AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { +func AESDecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput) AwsCryptographyPrimitivesTypes.AESDecryptInput { - return func() AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { + return func() AwsCryptographyPrimitivesTypes.AESDecryptInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateRandomBytesInput_.Create_GenerateRandomBytesInput_(aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(nativeInput.Length)) + return AwsCryptographyPrimitivesTypes.Companion_AESDecryptInput_.Create_AESDecryptInput_(aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESDecryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(nativeInput.CipherTxt), aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(nativeInput.AuthTag), aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(nativeInput.Aad)) }() } -func DigestInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DigestInput) AwsCryptographyPrimitivesTypes.DigestInput { +func AESEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput) AwsCryptographyPrimitivesTypes.AESEncryptInput { - return func() AwsCryptographyPrimitivesTypes.DigestInput { + return func() AwsCryptographyPrimitivesTypes.AESEncryptInput { - return AwsCryptographyPrimitivesTypes.Companion_DigestInput_.Create_DigestInput_(aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_DigestInput_message_ToDafny(nativeInput.Message)) + return AwsCryptographyPrimitivesTypes.Companion_AESEncryptInput_.Create_AESEncryptInput_(aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESEncryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(nativeInput.Msg), aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(nativeInput.Aad)) }() } -func HMacInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HMacInput) AwsCryptographyPrimitivesTypes.HMacInput { +func AESEncryptOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput) AwsCryptographyPrimitivesTypes.AESEncryptOutput { - return func() AwsCryptographyPrimitivesTypes.HMacInput { + return func() AwsCryptographyPrimitivesTypes.AESEncryptOutput { - return AwsCryptographyPrimitivesTypes.Companion_HMacInput_.Create_HMacInput_(aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HMacInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_HMacInput_message_ToDafny(nativeInput.Message)) + return AwsCryptographyPrimitivesTypes.Companion_AESEncryptOutput_.Create_AESEncryptOutput_(aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(nativeOutput.CipherText), aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(nativeOutput.AuthTag)) }() } -func HkdfExtractInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput) AwsCryptographyPrimitivesTypes.HkdfExtractInput { +func AesKdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput) AwsCryptographyPrimitivesTypes.AesKdfCtrInput { - return func() AwsCryptographyPrimitivesTypes.HkdfExtractInput { + return func() AwsCryptographyPrimitivesTypes.AesKdfCtrInput { - return AwsCryptographyPrimitivesTypes.Companion_HkdfExtractInput_.Create_HkdfExtractInput_(aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExtractInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(nativeInput.Ikm)) + return AwsCryptographyPrimitivesTypes.Companion_AesKdfCtrInput_.Create_AesKdfCtrInput_(aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) }() } -func HkdfExpandInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput) AwsCryptographyPrimitivesTypes.HkdfExpandInput { +func CompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput) AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.HkdfExpandInput { + return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_HkdfExpandInput_.Create_HkdfExpandInput_(aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(nativeInput.Prk), aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) + return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyInput_.Create_CompressPublicKeyInput_(aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) }() } -func HkdfInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfInput) AwsCryptographyPrimitivesTypes.HkdfInput { +func CompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.HkdfInput { + return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_HkdfInput_.Create_HkdfInput_(aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_HkdfInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) + return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyOutput_.Create_CompressPublicKeyOutput_(aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(nativeOutput.CompressedPublicKey)) }() } -func KdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput) AwsCryptographyPrimitivesTypes.KdfCtrInput { +func DecompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.KdfCtrInput { + return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_KdfCtrInput_.Create_KdfCtrInput_(aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(nativeInput.Purpose), aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) + return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyInput_.Create_DecompressPublicKeyInput_(aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(nativeInput.CompressedPublicKey), aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) }() } -func AesKdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput) AwsCryptographyPrimitivesTypes.AesKdfCtrInput { +func DecompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.AesKdfCtrInput { + return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_AesKdfCtrInput_.Create_AesKdfCtrInput_(aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) + return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyOutput_.Create_DecompressPublicKeyOutput_(aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func AESEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput) AwsCryptographyPrimitivesTypes.AESEncryptInput { +func DeriveSharedSecretInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { - return func() AwsCryptographyPrimitivesTypes.AESEncryptInput { + return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { - return AwsCryptographyPrimitivesTypes.Companion_AESEncryptInput_.Create_AESEncryptInput_(aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESEncryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(nativeInput.Msg), aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(nativeInput.Aad)) + return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretInput_.Create_DeriveSharedSecretInput_(aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func AESEncryptOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput) AwsCryptographyPrimitivesTypes.AESEncryptOutput { +func DeriveSharedSecretOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { - return func() AwsCryptographyPrimitivesTypes.AESEncryptOutput { + return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { - return AwsCryptographyPrimitivesTypes.Companion_AESEncryptOutput_.Create_AESEncryptOutput_(aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(nativeOutput.CipherText), aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(nativeOutput.AuthTag)) + return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretOutput_.Create_DeriveSharedSecretOutput_(aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(nativeOutput.SharedSecret)) }() } -func AESDecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput) AwsCryptographyPrimitivesTypes.AESDecryptInput { +func DigestInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DigestInput) AwsCryptographyPrimitivesTypes.DigestInput { - return func() AwsCryptographyPrimitivesTypes.AESDecryptInput { + return func() AwsCryptographyPrimitivesTypes.DigestInput { - return AwsCryptographyPrimitivesTypes.Companion_AESDecryptInput_.Create_AESDecryptInput_(aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(nativeInput.EncAlg), aws_cryptography_primitives_AESDecryptInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(nativeInput.CipherTxt), aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(nativeInput.AuthTag), aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(nativeInput.Iv), aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(nativeInput.Aad)) + return AwsCryptographyPrimitivesTypes.Companion_DigestInput_.Create_DigestInput_(aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_DigestInput_message_ToDafny(nativeInput.Message)) }() } -func GenerateRSAKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { +func ECDSASignInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput) AwsCryptographyPrimitivesTypes.ECDSASignInput { - return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { + return func() AwsCryptographyPrimitivesTypes.ECDSASignInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairInput_.Create_GenerateRSAKeyPairInput_(aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(nativeInput.LengthBits)) + return AwsCryptographyPrimitivesTypes.Companion_ECDSASignInput_.Create_ECDSASignInput_(aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_primitives_ECDSASignInput_message_ToDafny(nativeInput.Message)) }() } -func GenerateRSAKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { +func ECDSAVerifyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput) AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { - return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { + return func() AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairOutput_.Create_GenerateRSAKeyPairOutput_(aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey), aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey)) + return AwsCryptographyPrimitivesTypes.Companion_ECDSAVerifyInput_.Create_ECDSAVerifyInput_(aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(nativeInput.VerificationKey), aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(nativeInput.Message), aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(nativeInput.Signature)) }() } -func GetRSAKeyModulusLengthInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { +func GenerateECCKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { - return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { + return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { - return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthInput_.Create_GetRSAKeyModulusLengthInput_(aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairInput_.Create_GenerateECCKeyPairInput_(aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(nativeInput.EccCurve)) }() } -func GetRSAKeyModulusLengthOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { +func GenerateECCKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { - return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { + return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { - return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthOutput_.Create_GetRSAKeyModulusLengthOutput_(aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(nativeOutput.Length)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairOutput_.Create_GenerateECCKeyPairOutput_(aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func RSADecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput) AwsCryptographyPrimitivesTypes.RSADecryptInput { +func GenerateECDSASignatureKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyInput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { - return func() AwsCryptographyPrimitivesTypes.RSADecryptInput { + return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_RSADecryptInput_.Create_RSADecryptInput_(aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(nativeInput.CipherText)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyInput_.Create_GenerateECDSASignatureKeyInput_(aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm)) }() } -func RSAEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput) AwsCryptographyPrimitivesTypes.RSAEncryptInput { +func GenerateECDSASignatureKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyOutput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { - return func() AwsCryptographyPrimitivesTypes.RSAEncryptInput { + return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_RSAEncryptInput_.Create_RSAEncryptInput_(aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(nativeInput.Plaintext)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyOutput_.Create_GenerateECDSASignatureKeyOutput_(aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(nativeOutput.SignatureAlgorithm), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(nativeOutput.VerificationKey), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(nativeOutput.SigningKey)) }() } -func GenerateECDSASignatureKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyInput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { +func GenerateRandomBytesInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput) AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { - return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyInput { + return func() AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyInput_.Create_GenerateECDSASignatureKeyInput_(aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateRandomBytesInput_.Create_GenerateRandomBytesInput_(aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(nativeInput.Length)) }() } -func GenerateECDSASignatureKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECDSASignatureKeyOutput) AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { +func GenerateRSAKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { - return func() AwsCryptographyPrimitivesTypes.GenerateECDSASignatureKeyOutput { + return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECDSASignatureKeyOutput_.Create_GenerateECDSASignatureKeyOutput_(aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(nativeOutput.SignatureAlgorithm), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(nativeOutput.VerificationKey), aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(nativeOutput.SigningKey)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairInput_.Create_GenerateRSAKeyPairInput_(aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(nativeInput.LengthBits)) }() } -func ECDSASignInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput) AwsCryptographyPrimitivesTypes.ECDSASignInput { +func GenerateRSAKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { - return func() AwsCryptographyPrimitivesTypes.ECDSASignInput { + return func() AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput { - return AwsCryptographyPrimitivesTypes.Companion_ECDSASignInput_.Create_ECDSASignInput_(aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(nativeInput.SigningKey), aws_cryptography_primitives_ECDSASignInput_message_ToDafny(nativeInput.Message)) + return AwsCryptographyPrimitivesTypes.Companion_GenerateRSAKeyPairOutput_.Create_GenerateRSAKeyPairOutput_(aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey), aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey)) }() } -func ECDSAVerifyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput) AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { +func GetPublicKeyFromPrivateKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyInput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { - return func() AwsCryptographyPrimitivesTypes.ECDSAVerifyInput { + return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_ECDSAVerifyInput_.Create_ECDSAVerifyInput_(aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(nativeInput.SignatureAlgorithm), aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(nativeInput.VerificationKey), aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(nativeInput.Message), aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(nativeInput.Signature)) + return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyInput_.Create_GetPublicKeyFromPrivateKeyInput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(nativeInput.PrivateKey)) }() } -func GenerateECCKeyPairInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { +func GetPublicKeyFromPrivateKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyOutput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { - return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput { + return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairInput_.Create_GenerateECCKeyPairInput_(aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(nativeInput.EccCurve)) + return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyOutput_.Create_GetPublicKeyFromPrivateKeyOutput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func GenerateECCKeyPairOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput) AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { +func GetRSAKeyModulusLengthInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { - return func() AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput { + return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput { - return AwsCryptographyPrimitivesTypes.Companion_GenerateECCKeyPairOutput_.Create_GenerateECCKeyPairOutput_(aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthInput_.Create_GetRSAKeyModulusLengthInput_(aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func GetPublicKeyFromPrivateKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyInput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { +func GetRSAKeyModulusLengthOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput) AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { - return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyInput { + return func() AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput { - return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyInput_.Create_GetPublicKeyFromPrivateKeyInput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(nativeInput.PrivateKey)) + return AwsCryptographyPrimitivesTypes.Companion_GetRSAKeyModulusLengthOutput_.Create_GetRSAKeyModulusLengthOutput_(aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(nativeOutput.Length)) }() } -func GetPublicKeyFromPrivateKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.GetPublicKeyFromPrivateKeyOutput) AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { +func HkdfInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfInput) AwsCryptographyPrimitivesTypes.HkdfInput { - return func() AwsCryptographyPrimitivesTypes.GetPublicKeyFromPrivateKeyOutput { + return func() AwsCryptographyPrimitivesTypes.HkdfInput { - return AwsCryptographyPrimitivesTypes.Companion_GetPublicKeyFromPrivateKeyOutput_.Create_GetPublicKeyFromPrivateKeyOutput_(aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(nativeOutput.EccCurve), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(nativeOutput.PrivateKey), aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_HkdfInput_.Create_HkdfInput_(aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_HkdfInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) }() } -func ValidatePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { +func HkdfExpandInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput) AwsCryptographyPrimitivesTypes.HkdfExpandInput { - return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.HkdfExpandInput { - return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyInput_.Create_ValidatePublicKeyInput_(aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_HkdfExpandInput_.Create_HkdfExpandInput_(aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(nativeInput.Prk), aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(nativeInput.Info), aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(nativeInput.ExpectedLength)) }() } -func ValidatePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { +func HkdfExtractInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput) AwsCryptographyPrimitivesTypes.HkdfExtractInput { - return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.HkdfExtractInput { - return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyOutput_.Create_ValidatePublicKeyOutput_(aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(nativeOutput.Success)) + return AwsCryptographyPrimitivesTypes.Companion_HkdfExtractInput_.Create_HkdfExtractInput_(aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HkdfExtractInput_salt_ToDafny(nativeInput.Salt), aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(nativeInput.Ikm)) }() } -func DeriveSharedSecretInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { +func HMacInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.HMacInput) AwsCryptographyPrimitivesTypes.HMacInput { - return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput { + return func() AwsCryptographyPrimitivesTypes.HMacInput { - return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretInput_.Create_DeriveSharedSecretInput_(aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_HMacInput_.Create_HMacInput_(aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_HMacInput_key_ToDafny(nativeInput.Key), aws_cryptography_primitives_HMacInput_message_ToDafny(nativeInput.Message)) }() } -func DeriveSharedSecretOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput) AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { +func KdfCtrInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput) AwsCryptographyPrimitivesTypes.KdfCtrInput { - return func() AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput { + return func() AwsCryptographyPrimitivesTypes.KdfCtrInput { - return AwsCryptographyPrimitivesTypes.Companion_DeriveSharedSecretOutput_.Create_DeriveSharedSecretOutput_(aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(nativeOutput.SharedSecret)) + return AwsCryptographyPrimitivesTypes.Companion_KdfCtrInput_.Create_KdfCtrInput_(aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(nativeInput.DigestAlgorithm), aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(nativeInput.Ikm), aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(nativeInput.ExpectedLength), aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(nativeInput.Purpose), aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(nativeInput.Nonce)) }() } -func CompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput) AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { +func ParsePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput) AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyInput_.Create_CompressPublicKeyInput_(aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) + return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyInput_.Create_ParsePublicKeyInput_(aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func CompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { +func ParsePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput) AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_CompressPublicKeyOutput_.Create_CompressPublicKeyOutput_(aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(nativeOutput.CompressedPublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyOutput_.Create_ParsePublicKeyOutput_(aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) }() } -func DecompressPublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { +func RSADecryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput) AwsCryptographyPrimitivesTypes.RSADecryptInput { - return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.RSADecryptInput { - return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyInput_.Create_DecompressPublicKeyInput_(aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(nativeInput.CompressedPublicKey), aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve)) + return AwsCryptographyPrimitivesTypes.Companion_RSADecryptInput_.Create_RSADecryptInput_(aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(nativeInput.PrivateKey), aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(nativeInput.CipherText)) }() } -func DecompressPublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput) AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { +func RSAEncryptInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput) AwsCryptographyPrimitivesTypes.RSAEncryptInput { - return func() AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.RSAEncryptInput { - return AwsCryptographyPrimitivesTypes.Companion_DecompressPublicKeyOutput_.Create_DecompressPublicKeyOutput_(aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_RSAEncryptInput_.Create_RSAEncryptInput_(aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(nativeInput.Padding), aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(nativeInput.PublicKey), aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(nativeInput.Plaintext)) }() } -func ParsePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput) AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { +func ValidatePublicKeyInput_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { - return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyInput { + return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput { - return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyInput_.Create_ParsePublicKeyInput_(aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyInput_.Create_ValidatePublicKeyInput_(aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(nativeInput.EccCurve), aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(nativeInput.PublicKey)) }() } -func ParsePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput) AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { +func ValidatePublicKeyOutput_ToDafny(nativeOutput awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput) AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { - return func() AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput { + return func() AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput { - return AwsCryptographyPrimitivesTypes.Companion_ParsePublicKeyOutput_.Create_ParsePublicKeyOutput_(aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(nativeOutput.PublicKey)) + return AwsCryptographyPrimitivesTypes.Companion_ValidatePublicKeyOutput_.Create_ValidatePublicKeyOutput_(aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(nativeOutput.Success)) }() } @@ -372,7 +372,35 @@ func CryptoConfig_ToDafny(nativeInput awscryptographyprimitivessmithygeneratedty } -func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { + return func() AwsCryptographyPrimitivesTypes.AES__GCM { + + return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) + }() +} + +func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_AESDecryptInput_key_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -385,7 +413,7 @@ func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_ToDafny(input [] }() } -func aws_cryptography_primitives_AESDecryptInput_key_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -398,7 +426,7 @@ func aws_cryptography_primitives_AESDecryptInput_key_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -411,49 +439,7 @@ func aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(input []byte) }() } -func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - }() -} - -func aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) - }() -} - -func aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -466,21 +452,7 @@ func aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(input []byte }() } -func aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func Aws_cryptography_primitives_ECDSAVerifyOutput_success_ToDafny(input bool) bool { - return func() bool { - - return input - }() -} - -func Aws_cryptography_primitives_HkdfOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -493,21 +465,7 @@ func Aws_cryptography_primitives_HkdfOutput_okm_ToDafny(input []byte) dafny.Sequ }() } -func aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_AESDecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -520,29 +478,14 @@ func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDa }() } -func aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { + return func() AwsCryptographyPrimitivesTypes.AES__GCM { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) }() } -func Aws_cryptography_primitives_AESDecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_iv_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -555,7 +498,7 @@ func Aws_cryptography_primitives_AESDecryptOutput_plaintext_ToDafny(input []byte }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_key_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -568,14 +511,7 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(input }() } -func aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -588,7 +524,7 @@ func aws_cryptography_primitives_AESDecryptInput_authTag_ToDafny(input []byte) d }() } -func aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -601,7 +537,7 @@ func aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(input []byte) }() } -func Aws_cryptography_primitives_KdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -614,7 +550,7 @@ func Aws_cryptography_primitives_KdfCtrOutput_okm_ToDafny(input []byte) dafny.Se }() } -func aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -627,36 +563,7 @@ func aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(input []byte) dafny.Seq }() } -func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - }() -} - -func aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -669,14 +576,14 @@ func aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(input []byte) dafn }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(input int32) int32 { +func aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -689,28 +596,7 @@ func aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(input []byte) Wrapp }() } -func aws_cryptography_primitives_AesKdfCtrInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) - }() -} - -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_AesKdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -723,20 +609,14 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDa }() } -func aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) }() } -func aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -749,7 +629,7 @@ func aws_cryptography_primitives_AESEncryptInput_aad_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int @@ -771,7 +651,7 @@ func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(input }() } -func Aws_cryptography_primitives_ECDSASignOutput_signature_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -784,7 +664,20 @@ func Aws_cryptography_primitives_ECDSASignOutput_signature_ToDafny(input []byte) }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int @@ -806,6 +699,13 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(input a }() } +func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) + }() +} + func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { @@ -828,14 +728,14 @@ func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_ToDafny(input }() } -func aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return input + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) }() } -func aws_cryptography_primitives_HkdfInput_info_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -848,7 +748,14 @@ func aws_cryptography_primitives_HkdfInput_info_ToDafny(input []byte) dafny.Sequ }() } -func aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) + }() +} + +func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -861,20 +768,29 @@ func aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(input []byte) dafn }() } -func aws_cryptography_primitives_HMacInput_key_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func Aws_cryptography_primitives_DigestOutput_digest_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_DigestInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -887,7 +803,7 @@ func Aws_cryptography_primitives_DigestOutput_digest_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_DigestOutput_digest_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -900,34 +816,29 @@ func aws_cryptography_primitives_AESEncryptOutput_cipherText_ToDafny(input []byt }() } -func aws_cryptography_primitives_AESEncryptInput_key_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) - }() -} - -func aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return input + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) }() } -func aws_cryptography_primitives_DigestInput_message_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -940,7 +851,7 @@ func aws_cryptography_primitives_DigestInput_message_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSASignInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -953,7 +864,7 @@ func aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input []byte) dafny.Se }() } -func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_ECDSASignOutput_signature_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -966,20 +877,29 @@ func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(input []b }() } -func aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -992,14 +912,7 @@ func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(i }() } -func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey) AwsCryptographyPrimitivesTypes.RSAPublicKey { - return func() AwsCryptographyPrimitivesTypes.RSAPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_RSAPublicKey_.Create_RSAPublicKey_(aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input.Pem)) - }() -} - -func aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSAVerifyInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1012,7 +925,7 @@ func aws_cryptography_primitives_AESEncryptInput_msg_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1025,40 +938,116 @@ func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_To }() } -func aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func Aws_cryptography_primitives_ECDSAVerifyOutput_success_ToDafny(input bool) bool { + return func() bool { + + return input + }() +} + +func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPrivateKey) AwsCryptographyPrimitivesTypes.RSAPrivateKey { - return func() AwsCryptographyPrimitivesTypes.RSAPrivateKey { +func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return AwsCryptographyPrimitivesTypes.Companion_RSAPrivateKey_.Create_RSAPrivateKey_(aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input.Pem)) + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) }() } -func aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) + }() +} + +func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + }() +} + +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + }() +} + +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1071,7 +1060,7 @@ func aws_cryptography_primitives_AESEncryptOutput_authTag_ToDafny(input []byte) }() } -func aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1084,7 +1073,14 @@ func aws_cryptography_primitives_ECDSASignInput_signingKey_ToDafny(input []byte) }() } -func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateRandomBytesInput_length_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1097,20 +1093,28 @@ func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_ToDafny(input }() } -func aws_cryptography_primitives_AesKdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) +func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_ToDafny(input int32) int32 { + return func() int32 { + + return input }() } -func aws_cryptography_primitives_HMacInput_message_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey) AwsCryptographyPrimitivesTypes.RSAPublicKey { + return func() AwsCryptographyPrimitivesTypes.RSAPublicKey { + + return AwsCryptographyPrimitivesTypes.Companion_RSAPublicKey_.Create_RSAPublicKey_(aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input.Pem)) + }() +} + +func aws_cryptography_primitives_RSAPublicKey_lengthBits_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func aws_cryptography_primitives_RSAPublicKey_pem_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1123,51 +1127,35 @@ func aws_cryptography_primitives_HMacInput_message_ToDafny(input []byte) dafny.S }() } -func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) - }() -} - -func aws_cryptography_primitives_DigestInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPrivateKey) AwsCryptographyPrimitivesTypes.RSAPrivateKey { + return func() AwsCryptographyPrimitivesTypes.RSAPrivateKey { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return AwsCryptographyPrimitivesTypes.Companion_RSAPrivateKey_.Create_RSAPrivateKey_(aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input.LengthBits), aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input.Pem)) }() } -func aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input int32) int32 { +func aws_cryptography_primitives_RSAPrivateKey_lengthBits_ToDafny(input int32) int32 { return func() int32 { return input }() } -func aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(input bool) bool { - return func() bool { - - return input +func aws_cryptography_primitives_RSAPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int for _, enumVal := range input.Values() { @@ -1177,19 +1165,26 @@ func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_ToDafny(input } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { - return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) + }() +} + +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { var index int for _, enumVal := range input.Values() { @@ -1199,31 +1194,25 @@ func aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(input awscrypto } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func Aws_cryptography_primitives_HkdfExtractOutput_prk_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { + return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { + + return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) }() } -func Aws_cryptography_primitives_RSADecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1236,14 +1225,7 @@ func Aws_cryptography_primitives_RSADecryptOutput_plaintext_ToDafny(input []byte }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) - }() -} - -func aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1256,14 +1238,14 @@ func aws_cryptography_primitives_ECDSAVerifyInput_signature_ToDafny(input []byte }() } -func aws_cryptography_primitives_AESDecryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { - return func() AwsCryptographyPrimitivesTypes.AES__GCM { +func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_ToDafny(input int32) int32 { + return func() int32 { - return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) + return input }() } -func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int @@ -1285,7 +1267,20 @@ func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(input a }() } -func Aws_cryptography_primitives_HkdfExpandOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfInput_salt_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func aws_cryptography_primitives_HkdfInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1298,30 +1293,41 @@ func Aws_cryptography_primitives_HkdfExpandOutput_okm_ToDafny(input []byte) dafn }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_HkdfInput_info_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func aws_cryptography_primitives_HkdfInput_expectedLength_ToDafny(input int32) int32 { + return func() int32 { + + return input + }() +} + +func Aws_cryptography_primitives_HkdfOutput_okm_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { - return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { +func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int for _, enumVal := range input.Values() { @@ -1331,25 +1337,18 @@ func aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(input awscrypto } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) - }() -} - -func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfExpandInput_prk_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1362,7 +1361,7 @@ func aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input []byte) dafny.Se }() } -func aws_cryptography_primitives_HkdfInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfExpandInput_info_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1375,29 +1374,14 @@ func aws_cryptography_primitives_HkdfInput_ikm_ToDafny(input []byte) dafny.Seque }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_primitives_HkdfExpandInput_expectedLength_ToDafny(input int32) int32 { + return func() int32 { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return input }() } -func aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_HkdfExpandOutput_okm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1410,7 +1394,7 @@ func aws_cryptography_primitives_AESDecryptInput_cipherTxt_ToDafny(input []byte) }() } -func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int @@ -1445,7 +1429,7 @@ func aws_cryptography_primitives_HkdfExtractInput_salt_ToDafny(input []byte) Wra }() } -func Aws_cryptography_primitives_HMacOutput_digest_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HkdfExtractInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1458,21 +1442,21 @@ func Aws_cryptography_primitives_HMacOutput_digest_ToDafny(input []byte) dafny.S }() } -func aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func Aws_cryptography_primitives_HkdfExtractOutput_prk_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm) AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { - return func() AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm { +func aws_cryptography_primitives_HMacInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { + return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int for _, enumVal := range input.Values() { @@ -1482,40 +1466,31 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgori } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) }() } -func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func aws_cryptography_primitives_HMacInput_key_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_HMacInput_message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1528,14 +1503,20 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey }() } -func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { - return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - - return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) +func Aws_cryptography_primitives_HMacOutput_digest_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { var index int @@ -1557,7 +1538,7 @@ func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_ToDafny(input }() } -func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_KdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1570,29 +1551,27 @@ func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_ToDafny(input []byt }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(input int32) int32 { + return func() int32 { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + return input + }() +} + +func aws_cryptography_primitives_KdfCtrInput_purpose_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func aws_cryptography_primitives_HkdfInput_salt_ToDafny(input []byte) Wrappers.Option { +func aws_cryptography_primitives_KdfCtrInput_nonce_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -1605,7 +1584,7 @@ func aws_cryptography_primitives_HkdfInput_salt_ToDafny(input []byte) Wrappers.O }() } -func aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_KdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1618,7 +1597,7 @@ func aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input []byte) dafny.S }() } -func aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1631,22 +1610,15 @@ func aws_cryptography_primitives_AESDecryptInput_aad_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input int32) int32 { - return func() int32 { +func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey) AwsCryptographyPrimitivesTypes.ECCPublicKey { + return func() AwsCryptographyPrimitivesTypes.ECCPublicKey { - return input + return AwsCryptographyPrimitivesTypes.Companion_ECCPublicKey_.Create_ECCPublicKey_(aws_cryptography_primitives_ECCPublicKey_der_ToDafny(input.Der)) }() } -func aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm) AwsCryptographyPrimitivesTypes.DigestAlgorithm { - return func() AwsCryptographyPrimitivesTypes.DigestAlgorithm { +func aws_cryptography_primitives_RSADecryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { + return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { var index int for _, enumVal := range input.Values() { @@ -1656,18 +1628,18 @@ func aws_cryptography_primitives_HkdfInput_digestAlgorithm_ToDafny(input awscryp } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) }() } -func aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_RSADecryptInput_privateKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1680,8 +1652,34 @@ func aws_cryptography_primitives_AesKdfCtrInput_ikm_ToDafny(input []byte) dafny. }() } -func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { - return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { +func aws_cryptography_primitives_RSADecryptInput_cipherText_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func Aws_cryptography_primitives_RSADecryptOutput_plaintext_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func aws_cryptography_primitives_RSAEncryptInput_padding_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode) AwsCryptographyPrimitivesTypes.RSAPaddingMode { + return func() AwsCryptographyPrimitivesTypes.RSAPaddingMode { var index int for _, enumVal := range input.Values() { @@ -1691,25 +1689,18 @@ func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_ToDafny(input } } var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - }() -} - -func aws_cryptography_primitives_AESEncryptInput_encAlg_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.AES_GCM) AwsCryptographyPrimitivesTypes.AES__GCM { - return func() AwsCryptographyPrimitivesTypes.AES__GCM { - - return AwsCryptographyPrimitivesTypes.Companion_AES__GCM_.Create_AES__GCM_(aws_cryptography_primitives_AES_GCM_keyLength_ToDafny(input.KeyLength), aws_cryptography_primitives_AES_GCM_tagLength_ToDafny(input.TagLength), aws_cryptography_primitives_AES_GCM_ivLength_ToDafny(input.IvLength)) + return enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) }() } -func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_RSAEncryptInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1722,7 +1713,7 @@ func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_ToD }() } -func aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_RSAEncryptInput_plaintext_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1735,14 +1726,7 @@ func aws_cryptography_primitives_AESDecryptInput_iv_ToDafny(input []byte) dafny. }() } -func aws_cryptography_primitives_KdfCtrInput_expectedLength_ToDafny(input int32) int32 { - return func() int32 { - - return input - }() -} - -func aws_cryptography_primitives_ECDSASignInput_message_ToDafny(input []byte) dafny.Sequence { +func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1755,20 +1739,29 @@ func aws_cryptography_primitives_ECDSASignInput_message_ToDafny(input []byte) da }() } -func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec) AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + return func() AwsCryptographyPrimitivesTypes.ECDHCurveSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) }() } -func Aws_cryptography_primitives_AesKdfCtrOutput_okm_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -1781,9 +1774,16 @@ func Aws_cryptography_primitives_AesKdfCtrOutput_okm_ToDafny(input []byte) dafny }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_ToDafny(input awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey) AwsCryptographyPrimitivesTypes.ECCPrivateKey { - return func() AwsCryptographyPrimitivesTypes.ECCPrivateKey { +func aws_cryptography_primitives_ValidatePublicKeyOutput_success_ToDafny(input bool) bool { + return func() bool { - return AwsCryptographyPrimitivesTypes.Companion_ECCPrivateKey_.Create_ECCPrivateKey_(aws_cryptography_primitives_ECCPrivateKey_pem_ToDafny(input.Pem)) + return input + }() +} + +func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } diff --git a/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go b/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go index b33c76b63..0cb121c76 100644 --- a/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go +++ b/AwsCryptographyPrimitives/runtimes/go/TestsFromDafny-go/awscryptographyprimitivessmithygenerated/to_native.go @@ -8,150 +8,127 @@ import ( "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" ) -func GenerateRandomBytesInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput { - - return awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput{Length: aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(dafnyInput.Dtor_length())} - -} - -func DigestInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DigestInput) awscryptographyprimitivessmithygeneratedtypes.DigestInput { - - return awscryptographyprimitivessmithygeneratedtypes.DigestInput{DigestAlgorithm: aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Message: aws_cryptography_primitives_DigestInput_message_FromDafny(dafnyInput.Dtor_message()), - } - -} - -func HMacInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HMacInput) awscryptographyprimitivessmithygeneratedtypes.HMacInput { +func AESDecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESDecryptInput) awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput { - return awscryptographyprimitivessmithygeneratedtypes.HMacInput{DigestAlgorithm: aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Key: aws_cryptography_primitives_HMacInput_key_FromDafny(dafnyInput.Dtor_key()), - Message: aws_cryptography_primitives_HMacInput_message_FromDafny(dafnyInput.Dtor_message()), + return awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput{EncAlg: aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), + Key: aws_cryptography_primitives_AESDecryptInput_key_FromDafny(dafnyInput.Dtor_key()), + CipherTxt: aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(dafnyInput.Dtor_cipherTxt()), + AuthTag: aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(dafnyInput.Dtor_authTag()), + Iv: aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), + Aad: aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), } } -func HkdfExtractInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExtractInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput { +func AESEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESEncryptInput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput { - return awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Salt: aws_cryptography_primitives_HkdfExtractInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), - Ikm: aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + return awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput{EncAlg: aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), + Iv: aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), + Key: aws_cryptography_primitives_AESEncryptInput_key_FromDafny(dafnyInput.Dtor_key()), + Msg: aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(dafnyInput.Dtor_msg()), + Aad: aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), } } -func HkdfExpandInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExpandInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput { +func AESEncryptOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.AESEncryptOutput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput { - return awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Prk: aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(dafnyInput.Dtor_prk()), - Info: aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(dafnyInput.Dtor_info()), - ExpectedLength: aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + return awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput{CipherText: aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(dafnyOutput.Dtor_cipherText()), + AuthTag: aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(dafnyOutput.Dtor_authTag()), } } -func HkdfInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfInput) awscryptographyprimitivessmithygeneratedtypes.HkdfInput { +func AesKdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AesKdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput { - return awscryptographyprimitivessmithygeneratedtypes.HkdfInput{DigestAlgorithm: aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Salt: aws_cryptography_primitives_HkdfInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), - Ikm: aws_cryptography_primitives_HkdfInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), - Info: aws_cryptography_primitives_HkdfInput_info_FromDafny(dafnyInput.Dtor_info()), - ExpectedLength: aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + return awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput{Ikm: aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + ExpectedLength: aws_cryptography_primitives_AesKdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + Nonce: aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), } } -func KdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.KdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput { +func CompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.CompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput{DigestAlgorithm: aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), - Ikm: aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), - ExpectedLength: aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), - Purpose: aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(dafnyInput.Dtor_purpose().UnwrapOr(nil)), - Nonce: aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), + return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput{PublicKey: aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + EccCurve: aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), } } -func AesKdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AesKdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput { +func CompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.AesKdfCtrInput{Ikm: aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), - ExpectedLength: aws_cryptography_primitives_AesKdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), - Nonce: aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), - } + return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput{CompressedPublicKey: aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(dafnyOutput.Dtor_compressedPublicKey())} } -func AESEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESEncryptInput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput { +func DecompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.AESEncryptInput{EncAlg: aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), - Iv: aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), - Key: aws_cryptography_primitives_AESEncryptInput_key_FromDafny(dafnyInput.Dtor_key()), - Msg: aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(dafnyInput.Dtor_msg()), - Aad: aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), + return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput{CompressedPublicKey: aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(dafnyInput.Dtor_compressedPublicKey()), + EccCurve: aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), } } -func AESEncryptOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.AESEncryptOutput) awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput { +func DecompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.AESEncryptOutput{CipherText: aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(dafnyOutput.Dtor_cipherText()), - AuthTag: aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(dafnyOutput.Dtor_authTag()), - } + return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput{PublicKey: aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} } -func AESDecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.AESDecryptInput) awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput { +func DeriveSharedSecretInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput { - return awscryptographyprimitivessmithygeneratedtypes.AESDecryptInput{EncAlg: aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(dafnyInput.Dtor_encAlg()), - Key: aws_cryptography_primitives_AESDecryptInput_key_FromDafny(dafnyInput.Dtor_key()), - CipherTxt: aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(dafnyInput.Dtor_cipherTxt()), - AuthTag: aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(dafnyInput.Dtor_authTag()), - Iv: aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(dafnyInput.Dtor_iv()), - Aad: aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(dafnyInput.Dtor_aad()), + return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput{EccCurve: aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + PrivateKey: aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), + PublicKey: aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), } } -func GenerateRSAKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput { +func DeriveSharedSecretOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput{LengthBits: aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(dafnyInput.Dtor_lengthBits())} + return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput{SharedSecret: aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(dafnyOutput.Dtor_sharedSecret())} } -func GenerateRSAKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput { +func DigestInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DigestInput) awscryptographyprimitivessmithygeneratedtypes.DigestInput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput{PublicKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), - PrivateKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), + return awscryptographyprimitivessmithygeneratedtypes.DigestInput{DigestAlgorithm: aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Message: aws_cryptography_primitives_DigestInput_message_FromDafny(dafnyInput.Dtor_message()), } } -func GetRSAKeyModulusLengthInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput { +func ECDSASignInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSASignInput) awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput { - return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput{PublicKey: aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), + SigningKey: aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey()), + Message: aws_cryptography_primitives_ECDSASignInput_message_FromDafny(dafnyInput.Dtor_message()), + } } -func GetRSAKeyModulusLengthOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput { +func ECDSAVerifyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSAVerifyInput) awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput { - return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput{Length: aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(dafnyOutput.Dtor_length())} + return awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), + VerificationKey: aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey()), + Message: aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(dafnyInput.Dtor_message()), + Signature: aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(dafnyInput.Dtor_signature()), + } } -func RSADecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSADecryptInput) awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput { +func GenerateECCKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput { - return awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput{Padding: aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), - PrivateKey: aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), - CipherText: aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(dafnyInput.Dtor_cipherText()), - } + return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve())} } -func RSAEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSAEncryptInput) awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput { +func GenerateECCKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput { - return awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput{Padding: aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), - PublicKey: aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), - Plaintext: aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(dafnyInput.Dtor_plaintext()), + return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(dafnyOutput.Dtor_eccCurve()), + PrivateKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), + PublicKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), } } @@ -171,36 +148,22 @@ func GenerateECDSASignatureKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimit } -func ECDSASignInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSASignInput) awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput { - - return awscryptographyprimitivessmithygeneratedtypes.ECDSASignInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), - SigningKey: aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey()), - Message: aws_cryptography_primitives_ECDSASignInput_message_FromDafny(dafnyInput.Dtor_message()), - } - -} - -func ECDSAVerifyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ECDSAVerifyInput) awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput { +func GenerateRandomBytesInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRandomBytesInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput { - return awscryptographyprimitivessmithygeneratedtypes.ECDSAVerifyInput{SignatureAlgorithm: aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(dafnyInput.Dtor_signatureAlgorithm()), - VerificationKey: aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey()), - Message: aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(dafnyInput.Dtor_message()), - Signature: aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(dafnyInput.Dtor_signature()), - } + return awscryptographyprimitivessmithygeneratedtypes.GenerateRandomBytesInput{Length: aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(dafnyInput.Dtor_length())} } -func GenerateECCKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput { +func GenerateRSAKeyPairInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairInput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairInput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve())} + return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairInput{LengthBits: aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(dafnyInput.Dtor_lengthBits())} } -func GenerateECCKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateECCKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput { +func GenerateRSAKeyPairOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GenerateRSAKeyPairOutput) awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput { - return awscryptographyprimitivessmithygeneratedtypes.GenerateECCKeyPairOutput{EccCurve: aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(dafnyOutput.Dtor_eccCurve()), - PrivateKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), - PublicKey: aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), + return awscryptographyprimitivessmithygeneratedtypes.GenerateRSAKeyPairOutput{PublicKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey()), + PrivateKey: aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_FromDafny(dafnyOutput.Dtor_privateKey()), } } @@ -222,72 +185,109 @@ func GetPublicKeyFromPrivateKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimi } -func ValidatePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput { +func GetRSAKeyModulusLengthInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthInput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput { - return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput{EccCurve: aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), - PublicKey: aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthInput{PublicKey: aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} + +} + +func GetRSAKeyModulusLengthOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.GetRSAKeyModulusLengthOutput) awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput { + + return awscryptographyprimitivessmithygeneratedtypes.GetRSAKeyModulusLengthOutput{Length: aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(dafnyOutput.Dtor_length())} + +} + +func HkdfInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfInput) awscryptographyprimitivessmithygeneratedtypes.HkdfInput { + + return awscryptographyprimitivessmithygeneratedtypes.HkdfInput{DigestAlgorithm: aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Salt: aws_cryptography_primitives_HkdfInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), + Ikm: aws_cryptography_primitives_HkdfInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + Info: aws_cryptography_primitives_HkdfInput_info_FromDafny(dafnyInput.Dtor_info()), + ExpectedLength: aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), } } -func ValidatePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput { +func HkdfExpandInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExpandInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput { - return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput{Success: aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(dafnyOutput.Dtor_success())} + return awscryptographyprimitivessmithygeneratedtypes.HkdfExpandInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Prk: aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(dafnyInput.Dtor_prk()), + Info: aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(dafnyInput.Dtor_info()), + ExpectedLength: aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + } } -func DeriveSharedSecretInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DeriveSharedSecretInput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput { +func HkdfExtractInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HkdfExtractInput) awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput { - return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretInput{EccCurve: aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), - PrivateKey: aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), - PublicKey: aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + return awscryptographyprimitivessmithygeneratedtypes.HkdfExtractInput{DigestAlgorithm: aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Salt: aws_cryptography_primitives_HkdfExtractInput_salt_FromDafny(dafnyInput.Dtor_salt().UnwrapOr(nil)), + Ikm: aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), } } -func DeriveSharedSecretOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DeriveSharedSecretOutput) awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput { +func HMacInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.HMacInput) awscryptographyprimitivessmithygeneratedtypes.HMacInput { - return awscryptographyprimitivessmithygeneratedtypes.DeriveSharedSecretOutput{SharedSecret: aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(dafnyOutput.Dtor_sharedSecret())} + return awscryptographyprimitivessmithygeneratedtypes.HMacInput{DigestAlgorithm: aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Key: aws_cryptography_primitives_HMacInput_key_FromDafny(dafnyInput.Dtor_key()), + Message: aws_cryptography_primitives_HMacInput_message_FromDafny(dafnyInput.Dtor_message()), + } } -func CompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.CompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput { +func KdfCtrInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.KdfCtrInput) awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput { - return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyInput{PublicKey: aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), - EccCurve: aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + return awscryptographyprimitivessmithygeneratedtypes.KdfCtrInput{DigestAlgorithm: aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(dafnyInput.Dtor_digestAlgorithm()), + Ikm: aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(dafnyInput.Dtor_ikm()), + ExpectedLength: aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(dafnyInput.Dtor_expectedLength()), + Purpose: aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(dafnyInput.Dtor_purpose().UnwrapOr(nil)), + Nonce: aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(dafnyInput.Dtor_nonce().UnwrapOr(nil)), } } -func CompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.CompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput { +func ParsePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ParsePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.CompressPublicKeyOutput{CompressedPublicKey: aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(dafnyOutput.Dtor_compressedPublicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput{PublicKey: aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} } -func DecompressPublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.DecompressPublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput { +func ParsePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyInput{CompressedPublicKey: aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(dafnyInput.Dtor_compressedPublicKey()), - EccCurve: aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput{PublicKey: aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} + +} + +func RSADecryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSADecryptInput) awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput { + + return awscryptographyprimitivessmithygeneratedtypes.RSADecryptInput{Padding: aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), + PrivateKey: aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey()), + CipherText: aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(dafnyInput.Dtor_cipherText()), } } -func DecompressPublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.DecompressPublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput { +func RSAEncryptInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.RSAEncryptInput) awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput { - return awscryptographyprimitivessmithygeneratedtypes.DecompressPublicKeyOutput{PublicKey: aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.RSAEncryptInput{Padding: aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(dafnyInput.Dtor_padding()), + PublicKey: aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + Plaintext: aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(dafnyInput.Dtor_plaintext()), + } } -func ParsePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ParsePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput { +func ValidatePublicKeyInput_FromDafny(dafnyInput AwsCryptographyPrimitivesTypes.ValidatePublicKeyInput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput { - return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyInput{PublicKey: aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyInput{EccCurve: aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(dafnyInput.Dtor_eccCurve()), + PublicKey: aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey()), + } } -func ParsePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ParsePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput { +func ValidatePublicKeyOutput_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.ValidatePublicKeyOutput) awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput { - return awscryptographyprimitivessmithygeneratedtypes.ParsePublicKeyOutput{PublicKey: aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(dafnyOutput.Dtor_publicKey())} + return awscryptographyprimitivessmithygeneratedtypes.ValidatePublicKeyOutput{Success: aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(dafnyOutput.Dtor_success())} } @@ -349,39 +349,31 @@ func CryptoConfig_FromDafny(dafnyOutput AwsCryptographyPrimitivesTypes.CryptoCon } -func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { + return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), + TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), + IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + } +} +func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_AESDecryptInput_key_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_AESDecryptInput_key_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -397,28 +389,7 @@ func aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(input interf } }() } -func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} -} -func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -434,7 +405,7 @@ func aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -450,16 +421,7 @@ func aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(input inte } }() } -func aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func Aws_cryptography_primitives_ECDSAVerifyOutput_success_FromDafny(input interface{}) bool { - return input.(bool) -} -func Aws_cryptography_primitives_HkdfOutput_okm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -475,16 +437,7 @@ func Aws_cryptography_primitives_HkdfOutput_okm_FromDafny(input interface{}) []b } }() } -func aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} -} -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -500,24 +453,6 @@ func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_From } }() } -func aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} func Aws_cryptography_primitives_AESDecryptOutput_plaintext_FromDafny(input interface{}) []byte { return func() []byte { var b []byte @@ -534,7 +469,13 @@ func Aws_cryptography_primitives_AESDecryptOutput_plaintext_FromDafny(input inte } }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { + return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), + TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), + IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), + } +} +func aws_cryptography_primitives_AESEncryptInput_iv_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -550,13 +491,7 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(inpu } }() } -func aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_key_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -572,7 +507,7 @@ func aws_cryptography_primitives_AESDecryptInput_authTag_FromDafny(input interfa } }() } -func aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -588,7 +523,7 @@ func aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(input inter } }() } -func Aws_cryptography_primitives_KdfCtrOutput_okm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -604,7 +539,7 @@ func Aws_cryptography_primitives_KdfCtrOutput_okm_FromDafny(input interface{}) [ } }() } -func aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -620,28 +555,7 @@ func aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(input interface{}) [] } }() } -func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} -} -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -657,13 +571,7 @@ func aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -685,16 +593,7 @@ func aws_cryptography_primitives_AesKdfCtrInput_expectedLength_FromDafny(input i return b }() } -func aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} -} -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -710,7 +609,7 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_From } }() } -func aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_AesKdfCtrOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -726,7 +625,10 @@ func aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(input inte } }() } -func aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} +func aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -742,7 +644,7 @@ func aws_cryptography_primitives_AESEncryptInput_aad_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { +func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) @@ -760,7 +662,7 @@ func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(inp return u.Values()[index] }() } -func Aws_cryptography_primitives_ECDSASignOutput_signature_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -776,7 +678,23 @@ func Aws_cryptography_primitives_ECDSASignOutput_signature_FromDafny(input inter } }() } -func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { +func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func aws_cryptography_primitives_DecompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) @@ -794,6 +712,9 @@ func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(input return u.Values()[index] }() } +func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec @@ -812,13 +733,10 @@ func aws_cryptography_primitives_DeriveSharedSecretInput_eccCurve_FromDafny(inpu return u.Values()[index] }() } -func aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() +func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} } -func aws_cryptography_primitives_HkdfInput_info_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -834,7 +752,10 @@ func aws_cryptography_primitives_HkdfInput_info_FromDafny(input interface{}) []b } }() } -func aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_DeriveSharedSecretInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} +func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -850,7 +771,25 @@ func aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_HMacInput_key_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_DigestInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -882,7 +821,25 @@ func Aws_cryptography_primitives_DigestOutput_digest_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -898,7 +855,7 @@ func aws_cryptography_primitives_AESEncryptOutput_cipherText_FromDafny(input int } }() } -func aws_cryptography_primitives_AESEncryptInput_key_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSASignInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -914,19 +871,41 @@ func aws_cryptography_primitives_AESEncryptInput_key_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_RSAPrivateKey_lengthBits_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func Aws_cryptography_primitives_ECDSASignOutput_signature_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() } -func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b +func aws_cryptography_primitives_ECDSAVerifyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] }() } -func aws_cryptography_primitives_DigestInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -942,7 +921,7 @@ func aws_cryptography_primitives_DigestInput_message_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSAVerifyInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -958,7 +937,7 @@ func aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input interface{}) [ } }() } -func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -974,7 +953,88 @@ func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(input i } }() } -func aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_ECDSAVerifyOutput_success_FromDafny(input interface{}) bool { + return input.(bool) +} +func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +} +func aws_cryptography_primitives_GenerateECCKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +} +func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -990,7 +1050,7 @@ func aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signingKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1006,12 +1066,13 @@ func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny } }() } -func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey{LengthBits: aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_lengthBits()), - Pem: aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_pem()), - } +func aws_cryptography_primitives_GenerateRandomBytesInput_length_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() } -func aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_GenerateRandomBytesOutput_data_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1027,39 +1088,24 @@ func aws_cryptography_primitives_AESEncryptInput_msg_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_DecompressPublicKeyInput_compressedPublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_GenerateRSAKeyPairInput_lengthBits_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } +func aws_cryptography_primitives_GenerateRSAKeyPairOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.RSAPublicKey{LengthBits: aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_lengthBits()), + Pem: aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPublicKey).Dtor_pem()), + } +} +func aws_cryptography_primitives_RSAPublicKey_lengthBits_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_RSAPrivateKey_pem_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAPublicKey_pem_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1080,7 +1126,13 @@ func aws_cryptography_primitives_GenerateRSAKeyPairOutput_privateKey_FromDafny(i Pem: aws_cryptography_primitives_RSAPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.RSAPrivateKey).Dtor_pem()), } } -func aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAPrivateKey_lengthBits_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() +} +func aws_cryptography_primitives_RSAPrivateKey_pem_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1096,39 +1148,49 @@ func aws_cryptography_primitives_AESEncryptOutput_authTag_FromDafny(input interf } }() } -func aws_cryptography_primitives_ECDSASignInput_signingKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } -func aws_cryptography_primitives_ECDSAVerifyInput_verificationKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +} +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } } } + + return u.Values()[index] }() } -func aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +} +func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1144,7 +1206,7 @@ func aws_cryptography_primitives_AesKdfCtrInput_nonce_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_HMacInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_GetRSAKeyModulusLengthInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1160,10 +1222,13 @@ func aws_cryptography_primitives_HMacInput_message_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_CompressPublicKeyInput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +func aws_cryptography_primitives_GetRSAKeyModulusLengthOutput_length_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b + }() } -func aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) @@ -1181,52 +1246,7 @@ func aws_cryptography_primitives_DigestInput_digestAlgorithm_FromDafny(input int return u.Values()[index] }() } -func aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(input interface{}) bool { - return input.(bool) -} -func aws_cryptography_primitives_ECDSASignInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode - inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func Aws_cryptography_primitives_HkdfExtractOutput_prk_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfInput_salt_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1242,7 +1262,7 @@ func Aws_cryptography_primitives_HkdfExtractOutput_prk_FromDafny(input interface } }() } -func Aws_cryptography_primitives_RSADecryptOutput_plaintext_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1258,10 +1278,7 @@ func Aws_cryptography_primitives_RSADecryptOutput_plaintext_FromDafny(input inte } }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} -} -func aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfInput_info_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1277,31 +1294,13 @@ func aws_cryptography_primitives_ECDSAVerifyInput_signature_FromDafny(input inte } }() } -func aws_cryptography_primitives_AESDecryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { - return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), - TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), - IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), - } -} -func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] +func aws_cryptography_primitives_HkdfInput_expectedLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func Aws_cryptography_primitives_HkdfExpandOutput_okm_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_HkdfOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1317,46 +1316,25 @@ func Aws_cryptography_primitives_HkdfExpandOutput_okm_FromDafny(input interface{ } }() } -func aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { - var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode - inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) +func aws_cryptography_primitives_HkdfExpandInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { break } } } - return u.Values()[index] - }() -} -func aws_cryptography_primitives_DeriveSharedSecretInput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} + return u.Values()[index] + }() } -func aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfExpandInput_prk_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1372,7 +1350,7 @@ func aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input interface{}) [ } }() } -func aws_cryptography_primitives_HkdfInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfExpandInput_info_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1388,25 +1366,13 @@ func aws_cryptography_primitives_HkdfInput_ikm_FromDafny(input interface{}) []by } }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyInput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] +func aws_cryptography_primitives_HkdfExpandInput_expectedLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_HkdfExpandOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1422,7 +1388,7 @@ func aws_cryptography_primitives_AESDecryptInput_cipherTxt_FromDafny(input inter } }() } -func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { +func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) @@ -1456,7 +1422,7 @@ func aws_cryptography_primitives_HkdfExtractInput_salt_FromDafny(input interface } }() } -func Aws_cryptography_primitives_HMacOutput_digest_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HkdfExtractInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1472,7 +1438,7 @@ func Aws_cryptography_primitives_HMacOutput_digest_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_HkdfExtractOutput_prk_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1488,16 +1454,16 @@ func aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) +func aws_cryptography_primitives_HMacInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { + var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm + inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { break } } @@ -1506,25 +1472,23 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_signatureAlgori return u.Values()[index] }() } -func aws_cryptography_primitives_CompressPublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } +func aws_cryptography_primitives_HMacInput_key_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - - return u.Values()[index] }() } -func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_HMacInput_message_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1540,10 +1504,23 @@ func aws_cryptography_primitives_GenerateECDSASignatureKeyOutput_verificationKey } }() } -func aws_cryptography_primitives_DecompressPublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} +func Aws_cryptography_primitives_HMacOutput_digest_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() } -func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { +func aws_cryptography_primitives_KdfCtrInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) @@ -1561,7 +1538,7 @@ func aws_cryptography_primitives_HkdfExtractInput_digestAlgorithm_FromDafny(inpu return u.Values()[index] }() } -func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_KdfCtrInput_ikm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1577,25 +1554,13 @@ func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_FromDafny(input int } }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] +func aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(input interface{}) int32 { + return func() int32 { + var b = input.(int32) + return b }() } -func aws_cryptography_primitives_HkdfInput_salt_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_KdfCtrInput_purpose_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1611,7 +1576,7 @@ func aws_cryptography_primitives_HkdfInput_salt_FromDafny(input interface{}) []b } }() } -func aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_KdfCtrInput_nonce_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1627,7 +1592,7 @@ func aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_KdfCtrOutput_okm_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1643,35 +1608,35 @@ func aws_cryptography_primitives_AESDecryptInput_aad_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_FromDafny(input interface{}) string { - return func() string { - var s string +func aws_cryptography_primitives_ParsePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() +func aws_cryptography_primitives_ParsePublicKeyOutput_publicKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey { + return awscryptographyprimitivessmithygeneratedtypes.ECCPublicKey{Der: aws_cryptography_primitives_ECCPublicKey_der_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPublicKey).Dtor_der())} } -func aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { - var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm - inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) +func aws_cryptography_primitives_RSADecryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode + inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { + if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { break } } @@ -1680,7 +1645,7 @@ func aws_cryptography_primitives_HkdfInput_digestAlgorithm_FromDafny(input inter return u.Values()[index] }() } -func aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSADecryptInput_privateKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1696,31 +1661,23 @@ func aws_cryptography_primitives_AesKdfCtrInput_ikm_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_GenerateECCKeyPairInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { - var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec - inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { - break - } +func aws_cryptography_primitives_RSADecryptInput_cipherText_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - - return u.Values()[index] }() } -func aws_cryptography_primitives_AESEncryptInput_encAlg_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { - return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), - TagLength: aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), - IvLength: aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), - } -} -func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_RSADecryptOutput_plaintext_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1736,7 +1693,25 @@ func aws_cryptography_primitives_CompressPublicKeyOutput_compressedPublicKey_Fro } }() } -func aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAEncryptInput_padding_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + return func() awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode { + var u awscryptographyprimitivessmithygeneratedtypes.RSAPaddingMode + inputEnum := input.(AwsCryptographyPrimitivesTypes.RSAPaddingMode) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_RSAPaddingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.RSAPaddingMode).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_RSAEncryptInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1752,13 +1727,7 @@ func aws_cryptography_primitives_AESDecryptInput_iv_FromDafny(input interface{}) } }() } -func aws_cryptography_primitives_KdfCtrInput_expectedLength_FromDafny(input interface{}) int32 { - return func() int32 { - var b = input.(int32) - return b - }() -} -func aws_cryptography_primitives_ECDSASignInput_message_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_RSAEncryptInput_plaintext_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1774,7 +1743,7 @@ func aws_cryptography_primitives_ECDSASignInput_message_FromDafny(input interfac } }() } -func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny(input interface{}) []byte { +func Aws_cryptography_primitives_RSAEncryptOutput_cipherText_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1790,7 +1759,25 @@ func aws_cryptography_primitives_DeriveSharedSecretOutput_sharedSecret_FromDafny } }() } -func Aws_cryptography_primitives_AesKdfCtrOutput_okm_FromDafny(input interface{}) []byte { +func aws_cryptography_primitives_ValidatePublicKeyInput_eccCurve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { + var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec + inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_primitives_ValidatePublicKeyInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1806,6 +1793,19 @@ func Aws_cryptography_primitives_AesKdfCtrOutput_okm_FromDafny(input interface{} } }() } -func aws_cryptography_primitives_GenerateECCKeyPairOutput_privateKey_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey { - return awscryptographyprimitivessmithygeneratedtypes.ECCPrivateKey{Pem: aws_cryptography_primitives_ECCPrivateKey_pem_FromDafny(input.(AwsCryptographyPrimitivesTypes.ECCPrivateKey).Dtor_pem())} +func aws_cryptography_primitives_ValidatePublicKeyOutput_success_FromDafny(input interface{}) bool { + return input.(bool) +} +func aws_cryptography_primitives_AwsCryptographicPrimitivesError_message_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() } diff --git a/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go b/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go index f901e897d..b1d4d98d3 100644 --- a/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go +++ b/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go @@ -1023,242 +1023,242 @@ func UpdateTimeToLiveOutput_ToDafny(nativeOutput dynamodb.UpdateTimeToLiveOutput } -func GlobalTableAlreadyExistsException_ToDafny(nativeInput types.GlobalTableAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { +func BackupInUseException_ToDafny(nativeInput types.BackupInUseException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_GlobalTableAlreadyExistsException_(com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_BackupInUseException_(com_amazonaws_dynamodb_BackupInUseException_message_ToDafny(nativeInput.Message)) }() } -func InternalServerError_ToDafny(nativeInput types.InternalServerError) ComAmazonawsDynamodbTypes.Error { +func BackupNotFoundException_ToDafny(nativeInput types.BackupNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InternalServerError_(com_amazonaws_dynamodb_InternalServerError_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_BackupNotFoundException_(com_amazonaws_dynamodb_BackupNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func IdempotentParameterMismatchException_ToDafny(nativeInput types.IdempotentParameterMismatchException) ComAmazonawsDynamodbTypes.Error { +func ConditionalCheckFailedException_ToDafny(nativeInput types.ConditionalCheckFailedException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_IdempotentParameterMismatchException_(com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ConditionalCheckFailedException_(com_amazonaws_dynamodb_ConditionalCheckFailedException_message_ToDafny(nativeInput.Message), com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_ToDafny(nativeInput.Item)) }() } -func TransactionInProgressException_ToDafny(nativeInput types.TransactionInProgressException) ComAmazonawsDynamodbTypes.Error { +func ContinuousBackupsUnavailableException_ToDafny(nativeInput types.ContinuousBackupsUnavailableException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TransactionInProgressException_(com_amazonaws_dynamodb_TransactionInProgressException_Message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ContinuousBackupsUnavailableException_(com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_ToDafny(nativeInput.Message)) }() } -func InvalidRestoreTimeException_ToDafny(nativeInput types.InvalidRestoreTimeException) ComAmazonawsDynamodbTypes.Error { +func DuplicateItemException_ToDafny(nativeInput types.DuplicateItemException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidRestoreTimeException_(com_amazonaws_dynamodb_InvalidRestoreTimeException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_DuplicateItemException_(com_amazonaws_dynamodb_DuplicateItemException_message_ToDafny(nativeInput.Message)) }() } -func ImportNotFoundException_ToDafny(nativeInput types.ImportNotFoundException) ComAmazonawsDynamodbTypes.Error { +func ExportConflictException_ToDafny(nativeInput types.ExportConflictException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ImportNotFoundException_(com_amazonaws_dynamodb_ImportNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ExportConflictException_(com_amazonaws_dynamodb_ExportConflictException_message_ToDafny(nativeInput.Message)) }() } -func BackupNotFoundException_ToDafny(nativeInput types.BackupNotFoundException) ComAmazonawsDynamodbTypes.Error { +func ExportNotFoundException_ToDafny(nativeInput types.ExportNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_BackupNotFoundException_(com_amazonaws_dynamodb_BackupNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ExportNotFoundException_(com_amazonaws_dynamodb_ExportNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func ProvisionedThroughputExceededException_ToDafny(nativeInput types.ProvisionedThroughputExceededException) ComAmazonawsDynamodbTypes.Error { +func GlobalTableAlreadyExistsException_ToDafny(nativeInput types.GlobalTableAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ProvisionedThroughputExceededException_(com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_GlobalTableAlreadyExistsException_(com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_ToDafny(nativeInput.Message)) }() } -func InvalidEndpointException_ToDafny(nativeInput types.InvalidEndpointException) ComAmazonawsDynamodbTypes.Error { +func GlobalTableNotFoundException_ToDafny(nativeInput types.GlobalTableNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidEndpointException_(com_amazonaws_dynamodb_InvalidEndpointException_Message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_GlobalTableNotFoundException_(com_amazonaws_dynamodb_GlobalTableNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func ImportConflictException_ToDafny(nativeInput types.ImportConflictException) ComAmazonawsDynamodbTypes.Error { +func IdempotentParameterMismatchException_ToDafny(nativeInput types.IdempotentParameterMismatchException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ImportConflictException_(com_amazonaws_dynamodb_ImportConflictException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_IdempotentParameterMismatchException_(com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_ToDafny(nativeInput.Message)) }() } -func ContinuousBackupsUnavailableException_ToDafny(nativeInput types.ContinuousBackupsUnavailableException) ComAmazonawsDynamodbTypes.Error { +func ImportConflictException_ToDafny(nativeInput types.ImportConflictException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ContinuousBackupsUnavailableException_(com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ImportConflictException_(com_amazonaws_dynamodb_ImportConflictException_message_ToDafny(nativeInput.Message)) }() } -func ReplicaAlreadyExistsException_ToDafny(nativeInput types.ReplicaAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { +func ImportNotFoundException_ToDafny(nativeInput types.ImportNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ReplicaAlreadyExistsException_(com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ImportNotFoundException_(com_amazonaws_dynamodb_ImportNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func PolicyNotFoundException_ToDafny(nativeInput types.PolicyNotFoundException) ComAmazonawsDynamodbTypes.Error { +func IndexNotFoundException_ToDafny(nativeInput types.IndexNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_PolicyNotFoundException_(com_amazonaws_dynamodb_PolicyNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_IndexNotFoundException_(com_amazonaws_dynamodb_IndexNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func TableNotFoundException_ToDafny(nativeInput types.TableNotFoundException) ComAmazonawsDynamodbTypes.Error { +func InternalServerError_ToDafny(nativeInput types.InternalServerError) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableNotFoundException_(com_amazonaws_dynamodb_TableNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InternalServerError_(com_amazonaws_dynamodb_InternalServerError_message_ToDafny(nativeInput.Message)) }() } -func PointInTimeRecoveryUnavailableException_ToDafny(nativeInput types.PointInTimeRecoveryUnavailableException) ComAmazonawsDynamodbTypes.Error { +func InvalidEndpointException_ToDafny(nativeInput types.InvalidEndpointException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_PointInTimeRecoveryUnavailableException_(com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidEndpointException_(com_amazonaws_dynamodb_InvalidEndpointException_Message_ToDafny(nativeInput.Message)) }() } -func ExportNotFoundException_ToDafny(nativeInput types.ExportNotFoundException) ComAmazonawsDynamodbTypes.Error { +func InvalidExportTimeException_ToDafny(nativeInput types.InvalidExportTimeException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ExportNotFoundException_(com_amazonaws_dynamodb_ExportNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidExportTimeException_(com_amazonaws_dynamodb_InvalidExportTimeException_message_ToDafny(nativeInput.Message)) }() } -func RequestLimitExceeded_ToDafny(nativeInput types.RequestLimitExceeded) ComAmazonawsDynamodbTypes.Error { +func InvalidRestoreTimeException_ToDafny(nativeInput types.InvalidRestoreTimeException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_RequestLimitExceeded_(com_amazonaws_dynamodb_RequestLimitExceeded_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidRestoreTimeException_(com_amazonaws_dynamodb_InvalidRestoreTimeException_message_ToDafny(nativeInput.Message)) }() } -func ResourceNotFoundException_ToDafny(nativeInput types.ResourceNotFoundException) ComAmazonawsDynamodbTypes.Error { +func ItemCollectionSizeLimitExceededException_ToDafny(nativeInput types.ItemCollectionSizeLimitExceededException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ResourceNotFoundException_(com_amazonaws_dynamodb_ResourceNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ItemCollectionSizeLimitExceededException_(com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_ToDafny(nativeInput.Message)) }() } -func BackupInUseException_ToDafny(nativeInput types.BackupInUseException) ComAmazonawsDynamodbTypes.Error { +func LimitExceededException_ToDafny(nativeInput types.LimitExceededException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_BackupInUseException_(com_amazonaws_dynamodb_BackupInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_LimitExceededException_(com_amazonaws_dynamodb_LimitExceededException_message_ToDafny(nativeInput.Message)) }() } -func ConditionalCheckFailedException_ToDafny(nativeInput types.ConditionalCheckFailedException) ComAmazonawsDynamodbTypes.Error { +func PointInTimeRecoveryUnavailableException_ToDafny(nativeInput types.PointInTimeRecoveryUnavailableException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ConditionalCheckFailedException_(com_amazonaws_dynamodb_ConditionalCheckFailedException_message_ToDafny(nativeInput.Message), com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_ToDafny(nativeInput.Item)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_PointInTimeRecoveryUnavailableException_(com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_ToDafny(nativeInput.Message)) }() } -func IndexNotFoundException_ToDafny(nativeInput types.IndexNotFoundException) ComAmazonawsDynamodbTypes.Error { +func PolicyNotFoundException_ToDafny(nativeInput types.PolicyNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_IndexNotFoundException_(com_amazonaws_dynamodb_IndexNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_PolicyNotFoundException_(com_amazonaws_dynamodb_PolicyNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func ResourceInUseException_ToDafny(nativeInput types.ResourceInUseException) ComAmazonawsDynamodbTypes.Error { +func ProvisionedThroughputExceededException_ToDafny(nativeInput types.ProvisionedThroughputExceededException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ResourceInUseException_(com_amazonaws_dynamodb_ResourceInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ProvisionedThroughputExceededException_(com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_ToDafny(nativeInput.Message)) }() } -func ItemCollectionSizeLimitExceededException_ToDafny(nativeInput types.ItemCollectionSizeLimitExceededException) ComAmazonawsDynamodbTypes.Error { +func ReplicaAlreadyExistsException_ToDafny(nativeInput types.ReplicaAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ItemCollectionSizeLimitExceededException_(com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ReplicaAlreadyExistsException_(com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_ToDafny(nativeInput.Message)) }() } -func TableInUseException_ToDafny(nativeInput types.TableInUseException) ComAmazonawsDynamodbTypes.Error { +func ReplicaNotFoundException_ToDafny(nativeInput types.ReplicaNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableInUseException_(com_amazonaws_dynamodb_TableInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ReplicaNotFoundException_(com_amazonaws_dynamodb_ReplicaNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func ReplicaNotFoundException_ToDafny(nativeInput types.ReplicaNotFoundException) ComAmazonawsDynamodbTypes.Error { +func RequestLimitExceeded_ToDafny(nativeInput types.RequestLimitExceeded) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ReplicaNotFoundException_(com_amazonaws_dynamodb_ReplicaNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_RequestLimitExceeded_(com_amazonaws_dynamodb_RequestLimitExceeded_message_ToDafny(nativeInput.Message)) }() } -func DuplicateItemException_ToDafny(nativeInput types.DuplicateItemException) ComAmazonawsDynamodbTypes.Error { +func ResourceInUseException_ToDafny(nativeInput types.ResourceInUseException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_DuplicateItemException_(com_amazonaws_dynamodb_DuplicateItemException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ResourceInUseException_(com_amazonaws_dynamodb_ResourceInUseException_message_ToDafny(nativeInput.Message)) }() } -func LimitExceededException_ToDafny(nativeInput types.LimitExceededException) ComAmazonawsDynamodbTypes.Error { +func ResourceNotFoundException_ToDafny(nativeInput types.ResourceNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_LimitExceededException_(com_amazonaws_dynamodb_LimitExceededException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ResourceNotFoundException_(com_amazonaws_dynamodb_ResourceNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func TransactionConflictException_ToDafny(nativeInput types.TransactionConflictException) ComAmazonawsDynamodbTypes.Error { +func TableAlreadyExistsException_ToDafny(nativeInput types.TableAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TransactionConflictException_(com_amazonaws_dynamodb_TransactionConflictException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableAlreadyExistsException_(com_amazonaws_dynamodb_TableAlreadyExistsException_message_ToDafny(nativeInput.Message)) }() } -func GlobalTableNotFoundException_ToDafny(nativeInput types.GlobalTableNotFoundException) ComAmazonawsDynamodbTypes.Error { +func TableInUseException_ToDafny(nativeInput types.TableInUseException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_GlobalTableNotFoundException_(com_amazonaws_dynamodb_GlobalTableNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableInUseException_(com_amazonaws_dynamodb_TableInUseException_message_ToDafny(nativeInput.Message)) }() } -func ExportConflictException_ToDafny(nativeInput types.ExportConflictException) ComAmazonawsDynamodbTypes.Error { +func TableNotFoundException_ToDafny(nativeInput types.TableNotFoundException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ExportConflictException_(com_amazonaws_dynamodb_ExportConflictException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableNotFoundException_(com_amazonaws_dynamodb_TableNotFoundException_message_ToDafny(nativeInput.Message)) }() } @@ -1271,18 +1271,18 @@ func TransactionCanceledException_ToDafny(nativeInput types.TransactionCanceledE } -func InvalidExportTimeException_ToDafny(nativeInput types.InvalidExportTimeException) ComAmazonawsDynamodbTypes.Error { +func TransactionConflictException_ToDafny(nativeInput types.TransactionConflictException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidExportTimeException_(com_amazonaws_dynamodb_InvalidExportTimeException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TransactionConflictException_(com_amazonaws_dynamodb_TransactionConflictException_message_ToDafny(nativeInput.Message)) }() } -func TableAlreadyExistsException_ToDafny(nativeInput types.TableAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { +func TransactionInProgressException_ToDafny(nativeInput types.TransactionInProgressException) ComAmazonawsDynamodbTypes.Error { return func() ComAmazonawsDynamodbTypes.Error { - return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableAlreadyExistsException_(com_amazonaws_dynamodb_TableAlreadyExistsException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TransactionInProgressException_(com_amazonaws_dynamodb_TransactionInProgressException_Message_ToDafny(nativeInput.Message)) }() } @@ -1293,14 +1293,49 @@ func OpaqueError_Input_ToDafny(nativeInput error) ComAmazonawsDynamodbTypes.Erro func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { // Service Errors + var BackupInUseException *types.BackupInUseException + if errors.As(err, &BackupInUseException) { + return BackupInUseException_ToDafny(*BackupInUseException) + } + + var BackupNotFoundException *types.BackupNotFoundException + if errors.As(err, &BackupNotFoundException) { + return BackupNotFoundException_ToDafny(*BackupNotFoundException) + } + + var ConditionalCheckFailedException *types.ConditionalCheckFailedException + if errors.As(err, &ConditionalCheckFailedException) { + return ConditionalCheckFailedException_ToDafny(*ConditionalCheckFailedException) + } + + var ContinuousBackupsUnavailableException *types.ContinuousBackupsUnavailableException + if errors.As(err, &ContinuousBackupsUnavailableException) { + return ContinuousBackupsUnavailableException_ToDafny(*ContinuousBackupsUnavailableException) + } + + var DuplicateItemException *types.DuplicateItemException + if errors.As(err, &DuplicateItemException) { + return DuplicateItemException_ToDafny(*DuplicateItemException) + } + + var ExportConflictException *types.ExportConflictException + if errors.As(err, &ExportConflictException) { + return ExportConflictException_ToDafny(*ExportConflictException) + } + + var ExportNotFoundException *types.ExportNotFoundException + if errors.As(err, &ExportNotFoundException) { + return ExportNotFoundException_ToDafny(*ExportNotFoundException) + } + var GlobalTableAlreadyExistsException *types.GlobalTableAlreadyExistsException if errors.As(err, &GlobalTableAlreadyExistsException) { return GlobalTableAlreadyExistsException_ToDafny(*GlobalTableAlreadyExistsException) } - var InternalServerError *types.InternalServerError - if errors.As(err, &InternalServerError) { - return InternalServerError_ToDafny(*InternalServerError) + var GlobalTableNotFoundException *types.GlobalTableNotFoundException + if errors.As(err, &GlobalTableNotFoundException) { + return GlobalTableNotFoundException_ToDafny(*GlobalTableNotFoundException) } var IdempotentParameterMismatchException *types.IdempotentParameterMismatchException @@ -1308,14 +1343,9 @@ func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { return IdempotentParameterMismatchException_ToDafny(*IdempotentParameterMismatchException) } - var TransactionInProgressException *types.TransactionInProgressException - if errors.As(err, &TransactionInProgressException) { - return TransactionInProgressException_ToDafny(*TransactionInProgressException) - } - - var InvalidRestoreTimeException *types.InvalidRestoreTimeException - if errors.As(err, &InvalidRestoreTimeException) { - return InvalidRestoreTimeException_ToDafny(*InvalidRestoreTimeException) + var ImportConflictException *types.ImportConflictException + if errors.As(err, &ImportConflictException) { + return ImportConflictException_ToDafny(*ImportConflictException) } var ImportNotFoundException *types.ImportNotFoundException @@ -1323,14 +1353,14 @@ func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { return ImportNotFoundException_ToDafny(*ImportNotFoundException) } - var BackupNotFoundException *types.BackupNotFoundException - if errors.As(err, &BackupNotFoundException) { - return BackupNotFoundException_ToDafny(*BackupNotFoundException) + var IndexNotFoundException *types.IndexNotFoundException + if errors.As(err, &IndexNotFoundException) { + return IndexNotFoundException_ToDafny(*IndexNotFoundException) } - var ProvisionedThroughputExceededException *types.ProvisionedThroughputExceededException - if errors.As(err, &ProvisionedThroughputExceededException) { - return ProvisionedThroughputExceededException_ToDafny(*ProvisionedThroughputExceededException) + var InternalServerError *types.InternalServerError + if errors.As(err, &InternalServerError) { + return InternalServerError_ToDafny(*InternalServerError) } var InvalidEndpointException *types.InvalidEndpointException @@ -1338,19 +1368,29 @@ func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { return InvalidEndpointException_ToDafny(*InvalidEndpointException) } - var ImportConflictException *types.ImportConflictException - if errors.As(err, &ImportConflictException) { - return ImportConflictException_ToDafny(*ImportConflictException) + var InvalidExportTimeException *types.InvalidExportTimeException + if errors.As(err, &InvalidExportTimeException) { + return InvalidExportTimeException_ToDafny(*InvalidExportTimeException) } - var ContinuousBackupsUnavailableException *types.ContinuousBackupsUnavailableException - if errors.As(err, &ContinuousBackupsUnavailableException) { - return ContinuousBackupsUnavailableException_ToDafny(*ContinuousBackupsUnavailableException) + var InvalidRestoreTimeException *types.InvalidRestoreTimeException + if errors.As(err, &InvalidRestoreTimeException) { + return InvalidRestoreTimeException_ToDafny(*InvalidRestoreTimeException) } - var ReplicaAlreadyExistsException *types.ReplicaAlreadyExistsException - if errors.As(err, &ReplicaAlreadyExistsException) { - return ReplicaAlreadyExistsException_ToDafny(*ReplicaAlreadyExistsException) + var ItemCollectionSizeLimitExceededException *types.ItemCollectionSizeLimitExceededException + if errors.As(err, &ItemCollectionSizeLimitExceededException) { + return ItemCollectionSizeLimitExceededException_ToDafny(*ItemCollectionSizeLimitExceededException) + } + + var LimitExceededException *types.LimitExceededException + if errors.As(err, &LimitExceededException) { + return LimitExceededException_ToDafny(*LimitExceededException) + } + + var PointInTimeRecoveryUnavailableException *types.PointInTimeRecoveryUnavailableException + if errors.As(err, &PointInTimeRecoveryUnavailableException) { + return PointInTimeRecoveryUnavailableException_ToDafny(*PointInTimeRecoveryUnavailableException) } var PolicyNotFoundException *types.PolicyNotFoundException @@ -1358,19 +1398,19 @@ func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { return PolicyNotFoundException_ToDafny(*PolicyNotFoundException) } - var TableNotFoundException *types.TableNotFoundException - if errors.As(err, &TableNotFoundException) { - return TableNotFoundException_ToDafny(*TableNotFoundException) + var ProvisionedThroughputExceededException *types.ProvisionedThroughputExceededException + if errors.As(err, &ProvisionedThroughputExceededException) { + return ProvisionedThroughputExceededException_ToDafny(*ProvisionedThroughputExceededException) } - var PointInTimeRecoveryUnavailableException *types.PointInTimeRecoveryUnavailableException - if errors.As(err, &PointInTimeRecoveryUnavailableException) { - return PointInTimeRecoveryUnavailableException_ToDafny(*PointInTimeRecoveryUnavailableException) + var ReplicaAlreadyExistsException *types.ReplicaAlreadyExistsException + if errors.As(err, &ReplicaAlreadyExistsException) { + return ReplicaAlreadyExistsException_ToDafny(*ReplicaAlreadyExistsException) } - var ExportNotFoundException *types.ExportNotFoundException - if errors.As(err, &ExportNotFoundException) { - return ExportNotFoundException_ToDafny(*ExportNotFoundException) + var ReplicaNotFoundException *types.ReplicaNotFoundException + if errors.As(err, &ReplicaNotFoundException) { + return ReplicaNotFoundException_ToDafny(*ReplicaNotFoundException) } var RequestLimitExceeded *types.RequestLimitExceeded @@ -1378,69 +1418,29 @@ func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { return RequestLimitExceeded_ToDafny(*RequestLimitExceeded) } + var ResourceInUseException *types.ResourceInUseException + if errors.As(err, &ResourceInUseException) { + return ResourceInUseException_ToDafny(*ResourceInUseException) + } + var ResourceNotFoundException *types.ResourceNotFoundException if errors.As(err, &ResourceNotFoundException) { return ResourceNotFoundException_ToDafny(*ResourceNotFoundException) } - var BackupInUseException *types.BackupInUseException - if errors.As(err, &BackupInUseException) { - return BackupInUseException_ToDafny(*BackupInUseException) + var TableAlreadyExistsException *types.TableAlreadyExistsException + if errors.As(err, &TableAlreadyExistsException) { + return TableAlreadyExistsException_ToDafny(*TableAlreadyExistsException) } - var ConditionalCheckFailedException *types.ConditionalCheckFailedException - if errors.As(err, &ConditionalCheckFailedException) { - return ConditionalCheckFailedException_ToDafny(*ConditionalCheckFailedException) + var TableInUseException *types.TableInUseException + if errors.As(err, &TableInUseException) { + return TableInUseException_ToDafny(*TableInUseException) } - var IndexNotFoundException *types.IndexNotFoundException - if errors.As(err, &IndexNotFoundException) { - return IndexNotFoundException_ToDafny(*IndexNotFoundException) - } - - var ResourceInUseException *types.ResourceInUseException - if errors.As(err, &ResourceInUseException) { - return ResourceInUseException_ToDafny(*ResourceInUseException) - } - - var ItemCollectionSizeLimitExceededException *types.ItemCollectionSizeLimitExceededException - if errors.As(err, &ItemCollectionSizeLimitExceededException) { - return ItemCollectionSizeLimitExceededException_ToDafny(*ItemCollectionSizeLimitExceededException) - } - - var TableInUseException *types.TableInUseException - if errors.As(err, &TableInUseException) { - return TableInUseException_ToDafny(*TableInUseException) - } - - var ReplicaNotFoundException *types.ReplicaNotFoundException - if errors.As(err, &ReplicaNotFoundException) { - return ReplicaNotFoundException_ToDafny(*ReplicaNotFoundException) - } - - var DuplicateItemException *types.DuplicateItemException - if errors.As(err, &DuplicateItemException) { - return DuplicateItemException_ToDafny(*DuplicateItemException) - } - - var LimitExceededException *types.LimitExceededException - if errors.As(err, &LimitExceededException) { - return LimitExceededException_ToDafny(*LimitExceededException) - } - - var TransactionConflictException *types.TransactionConflictException - if errors.As(err, &TransactionConflictException) { - return TransactionConflictException_ToDafny(*TransactionConflictException) - } - - var GlobalTableNotFoundException *types.GlobalTableNotFoundException - if errors.As(err, &GlobalTableNotFoundException) { - return GlobalTableNotFoundException_ToDafny(*GlobalTableNotFoundException) - } - - var ExportConflictException *types.ExportConflictException - if errors.As(err, &ExportConflictException) { - return ExportConflictException_ToDafny(*ExportConflictException) + var TableNotFoundException *types.TableNotFoundException + if errors.As(err, &TableNotFoundException) { + return TableNotFoundException_ToDafny(*TableNotFoundException) } var TransactionCanceledException *types.TransactionCanceledException @@ -1448,536 +1448,335 @@ func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { return TransactionCanceledException_ToDafny(*TransactionCanceledException) } - var InvalidExportTimeException *types.InvalidExportTimeException - if errors.As(err, &InvalidExportTimeException) { - return InvalidExportTimeException_ToDafny(*InvalidExportTimeException) + var TransactionConflictException *types.TransactionConflictException + if errors.As(err, &TransactionConflictException) { + return TransactionConflictException_ToDafny(*TransactionConflictException) } - var TableAlreadyExistsException *types.TableAlreadyExistsException - if errors.As(err, &TableAlreadyExistsException) { - return TableAlreadyExistsException_ToDafny(*TableAlreadyExistsException) + var TransactionInProgressException *types.TransactionInProgressException + if errors.As(err, &TransactionInProgressException) { + return TransactionInProgressException_ToDafny(*TransactionInProgressException) } - return OpaqueError_Input_ToDafny(err) -} - -func com_amazonaws_dynamodb_AttributeUpdates_value_ToDafny(input types.AttributeValueUpdate) ComAmazonawsDynamodbTypes.AttributeValueUpdate { - return func() ComAmazonawsDynamodbTypes.AttributeValueUpdate { - - return ComAmazonawsDynamodbTypes.Companion_AttributeValueUpdate_.Create_AttributeValueUpdate_(com_amazonaws_dynamodb_AttributeValueUpdate_Value_ToDafny(input.Value), com_amazonaws_dynamodb_AttributeValueUpdate_Action_ToDafny(input.Action)) - }() -} - -func com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input types.ExportStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportStatus)) - }() -} - -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) - }() -} - -func com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) - }() -} - -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_ToDafny(input types.ContributorInsightsAction) ComAmazonawsDynamodbTypes.ContributorInsightsAction { - return func() ComAmazonawsDynamodbTypes.ContributorInsightsAction { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsAction_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(ComAmazonawsDynamodbTypes.ContributorInsightsAction) - }() -} - -func com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_dynamodb_ScanInput_Limit_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_ExportSummaries_member_ToDafny(input types.ExportSummary) ComAmazonawsDynamodbTypes.ExportSummary { - return func() ComAmazonawsDynamodbTypes.ExportSummary { - - return ComAmazonawsDynamodbTypes.Companion_ExportSummary_.Create_ExportSummary_(com_amazonaws_dynamodb_ExportSummary_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportSummary_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportSummary_ExportType_ToDafny(input.ExportType)) - }() -} - -func com_amazonaws_dynamodb_AttributeDefinition_AttributeType_ToDafny(input types.ScalarAttributeType) ComAmazonawsDynamodbTypes.ScalarAttributeType { - return func() ComAmazonawsDynamodbTypes.ScalarAttributeType { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ScalarAttributeType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(ComAmazonawsDynamodbTypes.ScalarAttributeType) - }() -} - -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) - }() -} - -func com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input types.StreamViewType) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_StreamViewType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.StreamViewType)) - }() -} - -func com_amazonaws_dynamodb_ParameterizedStatements_member_ToDafny(input types.ParameterizedStatement) ComAmazonawsDynamodbTypes.ParameterizedStatement { - return func() ComAmazonawsDynamodbTypes.ParameterizedStatement { - - return ComAmazonawsDynamodbTypes.Companion_ParameterizedStatement_.Create_ParameterizedStatement_(com_amazonaws_dynamodb_ParameterizedStatement_Statement_ToDafny(input.Statement), com_amazonaws_dynamodb_ParameterizedStatement_Parameters_ToDafny(input.Parameters)) - }() -} - -func com_amazonaws_dynamodb_ExportSummary_ExportType_ToDafny(input types.ExportType) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) - }() -} - -func com_amazonaws_dynamodb_ReplicaUpdate_Create_ToDafny(input *types.CreateReplicaAction) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateReplicaAction_.Create_CreateReplicaAction_(com_amazonaws_dynamodb_CreateReplicaAction_RegionName_ToDafny(input.RegionName))) - }() + return OpaqueError_Input_ToDafny(err) } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_ToDafny(input []types.BatchStatementRequest) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_dynamodb_QueryInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PartiQLBatchRequest_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input types.SSEType) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEType)) +func com_amazonaws_dynamodb_PartiQLBatchRequest_member_ToDafny(input types.BatchStatementRequest) ComAmazonawsDynamodbTypes.BatchStatementRequest { + return func() ComAmazonawsDynamodbTypes.BatchStatementRequest { + + return ComAmazonawsDynamodbTypes.Companion_BatchStatementRequest_.Create_BatchStatementRequest_(com_amazonaws_dynamodb_BatchStatementRequest_Statement_ToDafny(input.Statement), com_amazonaws_dynamodb_BatchStatementRequest_Parameters_ToDafny(input.Parameters), com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_ToDafny(input.ConsistentRead)) }() } -func com_amazonaws_dynamodb_ResourceNotFoundException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_BatchStatementRequest_Statement_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_BatchStatementRequest_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_ToDafny(input *types.IncrementalExportSpecification) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_IncrementalExportSpecification_.Create_IncrementalExportSpecification_(com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input.ExportFromTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input.ExportToTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input.ExportViewType))) }() } -func com_amazonaws_dynamodb_QueryInput_KeyConditions_ToDafny(input map[string]types.Condition) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input string) Wrappers.Option { return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_KeyConditions_key_ToDafny(key), com_amazonaws_dynamodb_KeyConditions_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) }() } -func com_amazonaws_dynamodb_Put_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { +func com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input string) Wrappers.Option { + return func() Wrappers.Option { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) - } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) }() } -func com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input types.SSEStatus) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEStatus)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input *types.SourceTableDetails) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SourceTableDetails_.Create_SourceTableDetails_(com_amazonaws_dynamodb_SourceTableDetails_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_SourceTableDetails_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_SourceTableDetails_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_SourceTableDetails_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_ToDafny(input.TableCreationDateTime), com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_SourceTableDetails_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_SourceTableDetails_BillingMode_ToDafny(input.BillingMode))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_StringSetAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) +func com_amazonaws_dynamodb_StringSetAttributeValue_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input int64) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_NumberSetAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_NumberSetAttributeValue_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input [][]byte) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_BinarySetAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_BackupSummary_TableArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_BinarySetAttributeValue_member_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_MapAttributeValue_key_ToDafny(key), com_amazonaws_dynamodb_MapAttributeValue_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) +func com_amazonaws_dynamodb_MapAttributeValue_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_MapAttributeValue_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input *types.TableCreationParameters) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input []types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableCreationParameters_.Create_TableCreationParameters_(com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input.SSESpecification), com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) - }() -} - -func com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ListAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} +func com_amazonaws_dynamodb_ListAttributeValue_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) -func com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_FilterConditionMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input types.ExportType) Wrappers.Option { +func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -1987,48 +1786,48 @@ func com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input types.Exp } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_ToDafny(input []types.BatchStatementResponse) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PartiQLBatchResponse_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_PartiQLBatchResponse_member_ToDafny(input types.BatchStatementResponse) ComAmazonawsDynamodbTypes.BatchStatementResponse { + return func() ComAmazonawsDynamodbTypes.BatchStatementResponse { + + return ComAmazonawsDynamodbTypes.Companion_BatchStatementResponse_.Create_BatchStatementResponse_(com_amazonaws_dynamodb_BatchStatementResponse_Error_ToDafny(input.Error), com_amazonaws_dynamodb_BatchStatementResponse_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_BatchStatementResponse_Item_ToDafny(input.Item)) + }() +} + +func com_amazonaws_dynamodb_BatchStatementResponse_Error_ToDafny(input *types.BatchStatementError) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BatchStatementError_.Create_BatchStatementError_(com_amazonaws_dynamodb_BatchStatementError_Code_ToDafny(input.Code), com_amazonaws_dynamodb_BatchStatementError_Message_ToDafny(input.Message))) }() } -func com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_BatchStatementError_Code_ToDafny(input types.BatchStatementErrorCodeEnum) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2038,27 +1837,18 @@ func com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_ToDafny( } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BatchStatementErrorCodeEnum_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) - }() -} - -func com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum)) }() } -func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_BatchStatementError_Message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2067,16 +1857,7 @@ func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_ToDafny }() } -func com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_ToDafny(input *types.BackupDetails) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDetails_.Create_BackupDetails_(com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input.BackupSizeBytes), com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime))) - }() -} - -func com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_BatchStatementResponse_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2085,69 +1866,86 @@ func com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input *string) Wr }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_BatchStatementResponse_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_ToDafny(input types.ReplicaAutoScalingUpdate) ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate { - return func() ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate { +func com_amazonaws_dynamodb_AttributeMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return ComAmazonawsDynamodbTypes.Companion_ReplicaAutoScalingUpdate_.Create_ReplicaAutoScalingUpdate_(com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_ToDafny(input.ReplicaGlobalSecondaryIndexUpdates), com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingUpdate)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) - }() -} +func com_amazonaws_dynamodb_AttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) -func com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) - fieldValue = append(fieldValue, element) + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input *types.ArchivalSummary) Wrappers.Option { +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ArchivalSummary_.Create_ArchivalSummary_(com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_ToDafny(input.ArchivalDateTime), com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_ToDafny(input.ArchivalReason), com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_ToDafny(input.ArchivalBackupArn))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_TagList_member_ToDafny(input types.Tag) ComAmazonawsDynamodbTypes.Tag { - return func() ComAmazonawsDynamodbTypes.Tag { +func com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(input types.ConsumedCapacity) ComAmazonawsDynamodbTypes.ConsumedCapacity { + return func() ComAmazonawsDynamodbTypes.ConsumedCapacity { - return ComAmazonawsDynamodbTypes.Companion_Tag_.Create_Tag_(com_amazonaws_dynamodb_Tag_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Tag_Value_ToDafny(input.Value)) + return ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes)) }() } -func com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2156,259 +1954,275 @@ func com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_ToDafny(input *str }() } -func com_amazonaws_dynamodb_Get_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) +func com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input *float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return fieldValue.ToMap() + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { +func com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input *float64) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input *float64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input *types.Capacity) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Capacity_.Create_Capacity_(com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input.CapacityUnits))) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { +func com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input *float64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_dynamodb_ScanInput_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input *float64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input *float64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_dynamodb_DeleteRequest_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { +func com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input map[string]types.Capacity) Wrappers.Option { + return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(key), com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(val)) } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(input types.Capacity) ComAmazonawsDynamodbTypes.Capacity { + return func() ComAmazonawsDynamodbTypes.Capacity { + + return ComAmazonawsDynamodbTypes.Companion_Capacity_.Create_Capacity_(com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input.CapacityUnits)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input map[string]types.Capacity) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(key), com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ScanInput_FilterExpression_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_ToDafny(input map[string]types.KeysAndAttributes) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} -func com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input *float64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_ListExportsInput_TableArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) +func com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(input types.KeysAndAttributes) ComAmazonawsDynamodbTypes.KeysAndAttributes { + return func() ComAmazonawsDynamodbTypes.KeysAndAttributes { + + return ComAmazonawsDynamodbTypes.Companion_KeysAndAttributes_.Create_KeysAndAttributes_(com_amazonaws_dynamodb_KeysAndAttributes_Keys_ToDafny(input.Keys), com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_ToDafny(input.AttributesToGet), com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_ToDafny(input.ConsistentRead), com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_ToDafny(input.ProjectionExpression), com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames)) }() } -func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_KeysAndAttributes_Keys_ToDafny(input []map[string]types.AttributeValue) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_ListImportsInput_NextToken_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_KeyList_member_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_QueryInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) +func com_amazonaws_dynamodb_Key_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_SourceTableDetails_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } +func com_amazonaws_dynamodb_Key_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) +func com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { +func com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2417,34 +2231,32 @@ func com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_ToDafny(input }() } -func com_amazonaws_dynamodb_ImportSummary_S3BucketSource_ToDafny(input *types.S3BucketSource) Wrappers.Option { +func com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix))) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { +func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2454,131 +2266,212 @@ func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_ToDafny(inpu } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_ExportNotFoundException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_BatchGetItemOutput_Responses_ToDafny(input map[string][]map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchGetResponseMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetResponseMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_BatchGetResponseMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_BatchGetResponseMap_value_ToDafny(input []map[string]types.AttributeValue) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_ImportSummary_ImportStatus_ToDafny(input types.ImportStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func com_amazonaws_dynamodb_ItemList_member_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_ToDafny(input map[string]types.KeysAndAttributes) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ImportStatus)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_ToDafny(input *time.Time) dafny.Sequence { +func com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_ToDafny(input map[string][]types.WriteRequest) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(input []types.WriteRequest) dafny.Sequence { return func() dafny.Sequence { if input == nil { - return dafny.SeqOf() + return nil } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return dafny.SeqOfChars([]dafny.Char(formattedTime)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_WriteRequests_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(input types.AttributeDefinition) ComAmazonawsDynamodbTypes.AttributeDefinition { - return func() ComAmazonawsDynamodbTypes.AttributeDefinition { +func com_amazonaws_dynamodb_WriteRequests_member_ToDafny(input types.WriteRequest) ComAmazonawsDynamodbTypes.WriteRequest { + return func() ComAmazonawsDynamodbTypes.WriteRequest { - return ComAmazonawsDynamodbTypes.Companion_AttributeDefinition_.Create_AttributeDefinition_(com_amazonaws_dynamodb_AttributeDefinition_AttributeName_ToDafny(input.AttributeName), com_amazonaws_dynamodb_AttributeDefinition_AttributeType_ToDafny(input.AttributeType)) + return ComAmazonawsDynamodbTypes.Companion_WriteRequest_.Create_WriteRequest_(com_amazonaws_dynamodb_WriteRequest_PutRequest_ToDafny(input.PutRequest), com_amazonaws_dynamodb_WriteRequest_DeleteRequest_ToDafny(input.DeleteRequest)) }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { +func com_amazonaws_dynamodb_WriteRequest_PutRequest_ToDafny(input *types.PutRequest) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_PutRequest_.Create_PutRequest_(com_amazonaws_dynamodb_PutRequest_Item_ToDafny(input.Item))) + }() +} + +func com_amazonaws_dynamodb_PutRequest_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_QueryInput_ScanIndexForward_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_WriteRequest_DeleteRequest_ToDafny(input *types.DeleteRequest) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteRequest_.Create_DeleteRequest_(com_amazonaws_dynamodb_DeleteRequest_Key_ToDafny(input.Key))) }() } -func com_amazonaws_dynamodb_TransactWriteItem_Put_ToDafny(input *types.Put) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_DeleteRequest_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Put_.Create_Put_(com_amazonaws_dynamodb_Put_Item_ToDafny(input.Item), com_amazonaws_dynamodb_Put_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Put_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Put_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Put_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_ExportSummary_ExportStatus_ToDafny(input types.ExportStatus) Wrappers.Option { +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2588,18 +2481,18 @@ func com_amazonaws_dynamodb_ExportSummary_ExportStatus_ToDafny(input types.Expor } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportStatus)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_ToDafny(input types.InputCompressionType) Wrappers.Option { +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2609,158 +2502,118 @@ func com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_ToDafny(input } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputCompressionType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) }() } -func com_amazonaws_dynamodb_ListBackupsInput_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_ToDafny(input map[string][]types.WriteRequest) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_ToDafny(input map[string][]types.ItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) - fieldValue = append(fieldValue, element) + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_ToDafny(input int32) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(input) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_Update_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(input []types.ItemCollectionMetrics) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input *types.AutoScalingPolicyUpdate) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingPolicyUpdate_.Create_AutoScalingPolicyUpdate_(com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_ToDafny(input.PolicyName), com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_ToDafny(input.TargetTrackingScalingPolicyConfiguration))) + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input types.BackupStatus) ComAmazonawsDynamodbTypes.BackupStatus { - return func() ComAmazonawsDynamodbTypes.BackupStatus { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(ComAmazonawsDynamodbTypes.BackupStatus) +func com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_ToDafny(input types.ItemCollectionMetrics) ComAmazonawsDynamodbTypes.ItemCollectionMetrics { + return func() ComAmazonawsDynamodbTypes.ItemCollectionMetrics { + + return ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB)) }() } -func com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input types.TableClass) Wrappers.Option { +func com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} -func com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_AttributeValueUpdate_Value_ToDafny(input types.AttributeValue) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { switch input.(type) { case *types.AttributeValueMemberS: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) case *types.AttributeValueMemberN: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) case *types.AttributeValueMemberB: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) case *types.AttributeValueMemberSS: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) case *types.AttributeValueMemberNS: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) case *types.AttributeValueMemberBS: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) case *types.AttributeValueMemberM: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) case *types.AttributeValueMemberL: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) case *types.AttributeValueMemberNULL: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) case *types.AttributeValueMemberBOOL: var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool))) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) default: panic("Unhandled union type") @@ -2768,55 +2621,104 @@ func com_amazonaws_dynamodb_AttributeValueUpdate_Value_ToDafny(input types.Attri }() } -func com_amazonaws_dynamodb_PutRequest_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { +func com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input []float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) +func com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_ToDafny(input float64) dafny.Sequence { + return func() dafny.Sequence { + + var bits = math.Float64bits(input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) } - return fieldValue.ToMap() + return dafny.SeqOf(v...) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_RequestLimitExceeded_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_CreateBackupInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_CreateBackupInput_BackupName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_ToDafny(input *types.BackupDetails) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDetails_.Create_BackupDetails_(com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input.BackupSizeBytes), com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime))) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_ToDafny(input *types.UpdateKinesisStreamingConfiguration) Wrappers.Option { +func com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingConfiguration_.Create_UpdateKinesisStreamingConfiguration_(com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input types.BackupStatus) ComAmazonawsDynamodbTypes.BackupStatus { + return func() ComAmazonawsDynamodbTypes.BackupStatus { var index int for _, enumVal := range input.Values() { index++ @@ -2825,19 +2727,19 @@ func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_ToDafny(input types.Ret } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) + return enum.(ComAmazonawsDynamodbTypes.BackupStatus) }() } -func com_amazonaws_dynamodb_QueryInput_Select_ToDafny(input types.Select) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input types.BackupType) ComAmazonawsDynamodbTypes.BackupType { + return func() ComAmazonawsDynamodbTypes.BackupType { var index int for _, enumVal := range input.Values() { index++ @@ -2846,59 +2748,38 @@ func com_amazonaws_dynamodb_QueryInput_Select_ToDafny(input types.Select) Wrappe } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.Select)) - }() -} - -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_ToDafny(input []types.Tag) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return enum.(ComAmazonawsDynamodbTypes.BackupType) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input *time.Time) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return dafny.SeqOf() } - return Wrappers.Companion_Option_.Create_Some_(*input) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return dafny.SeqOfChars([]dafny.Char(formattedTime)...) }() } -func com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -2907,103 +2788,67 @@ func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_ToDafny(input *strin }() } -func com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(input []types.WriteRequest) dafny.Sequence { +func com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_ToDafny(input []types.Replica) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_WriteRequests_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_ToDafny(input *types.CreateGlobalSecondaryIndexAction) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateGlobalSecondaryIndexAction_.Create_CreateGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) - }() -} +func com_amazonaws_dynamodb_ReplicaList_member_ToDafny(input types.Replica) ComAmazonawsDynamodbTypes.Replica { + return func() ComAmazonawsDynamodbTypes.Replica { -func com_amazonaws_dynamodb_DuplicateItemException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return ComAmazonawsDynamodbTypes.Companion_Replica_.Create_Replica_(com_amazonaws_dynamodb_Replica_RegionName_ToDafny(input.RegionName)) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_Replica_RegionName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input []types.ReplicaDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_BatchGetResponseMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} +func com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(input types.ReplicaDescription) ComAmazonawsDynamodbTypes.ReplicaDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaDescription { -func com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return ComAmazonawsDynamodbTypes.Companion_ReplicaDescription_.Create_ReplicaDescription_(com_amazonaws_dynamodb_ReplicaDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_ToDafny(input.ReplicaStatus), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_ToDafny(input.ReplicaStatusDescription), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_ToDafny(input.ReplicaStatusPercentProgress), com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_ToDafny(input.ReplicaInaccessibleDateTime), com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_ToDafny(input.ReplicaTableClassSummary)) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_RegionName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3012,44 +2857,7 @@ func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_ToD }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) - }() -} - -func com_amazonaws_dynamodb_CancellationReasonList_member_ToDafny(input types.CancellationReason) ComAmazonawsDynamodbTypes.CancellationReason { - return func() ComAmazonawsDynamodbTypes.CancellationReason { - - return ComAmazonawsDynamodbTypes.Companion_CancellationReason_.Create_CancellationReason_(com_amazonaws_dynamodb_CancellationReason_Item_ToDafny(input.Item), com_amazonaws_dynamodb_CancellationReason_Code_ToDafny(input.Code), com_amazonaws_dynamodb_CancellationReason_Message_ToDafny(input.Message)) - }() -} - -func com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input types.TableStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableStatus)) - }() -} - -func com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3059,29 +2867,18 @@ func com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_ToDafny(input types } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) - }() -} - -func com_amazonaws_dynamodb_DeleteItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) - } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) }() } -func com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3090,23 +2887,7 @@ func com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_ToDafny(in }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_ToDafny(input *float64) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return dafny.SeqOf() - } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) - } - return dafny.SeqOf(v...) - }() -} - -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3115,173 +2896,119 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_ToDafny( }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) }() } -func com_amazonaws_dynamodb_TagResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input *types.S3BucketSource) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) }() } -func com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndexAutoScalingDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndexDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_UpdateItemInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription { -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexDescription_.Create_ReplicaGlobalSecondaryIndexDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride)) }() } -func com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) - }() -} - -func com_amazonaws_dynamodb_ConditionCheck_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) }() } -func com_amazonaws_dynamodb_LimitExceededException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_ToDafny(input *types.StreamSpecification) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) }() } -func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input types.TableClass) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3291,39 +3018,28 @@ func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_ToDafny(input } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) }() } -func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3332,25 +3048,38 @@ func com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_ToDafny(input *str }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input *types.BackupDetails) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input types.GlobalTableStatus) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDetails_.Create_BackupDetails_(com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input.BackupSizeBytes), com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_GlobalTableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.GlobalTableStatus)) }() } -func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3359,186 +3088,243 @@ func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input *strin }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_Limit_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(input types.AttributeDefinition) ComAmazonawsDynamodbTypes.AttributeDefinition { + return func() ComAmazonawsDynamodbTypes.AttributeDefinition { + + return ComAmazonawsDynamodbTypes.Companion_AttributeDefinition_.Create_AttributeDefinition_(com_amazonaws_dynamodb_AttributeDefinition_AttributeName_ToDafny(input.AttributeName), com_amazonaws_dynamodb_AttributeDefinition_AttributeType_ToDafny(input.AttributeType)) + }() +} + +func com_amazonaws_dynamodb_AttributeDefinition_AttributeName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_ToDafny(input types.LocalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription { - return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription { - - return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndexDescription_.Create_LocalSecondaryIndexDescription_(com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input.IndexSizeBytes), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_ToDafny(input.IndexArn)) +func com_amazonaws_dynamodb_AttributeDefinition_AttributeType_ToDafny(input types.ScalarAttributeType) ComAmazonawsDynamodbTypes.ScalarAttributeType { + return func() ComAmazonawsDynamodbTypes.ScalarAttributeType { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ScalarAttributeType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.ScalarAttributeType) }() } -func com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_ToDafny(input map[string][]types.ItemCollectionMetrics) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(val)) +func com_amazonaws_dynamodb_CreateTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndexDescription) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_ToDafny(val) + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_ImportNotFoundException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_KeySchema_member_ToDafny(input types.KeySchemaElement) ComAmazonawsDynamodbTypes.KeySchemaElement { + return func() ComAmazonawsDynamodbTypes.KeySchemaElement { + + return ComAmazonawsDynamodbTypes.Companion_KeySchemaElement_.Create_KeySchemaElement_(com_amazonaws_dynamodb_KeySchemaElement_AttributeName_ToDafny(input.AttributeName), com_amazonaws_dynamodb_KeySchemaElement_KeyType_ToDafny(input.KeyType)) + }() +} + +func com_amazonaws_dynamodb_KeySchemaElement_AttributeName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_KeySchemaElement_KeyType_ToDafny(input types.KeyType) ComAmazonawsDynamodbTypes.KeyType { + return func() ComAmazonawsDynamodbTypes.KeyType { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_KeyType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.KeyType) }() } -func com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input int64) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input map[string]types.Capacity) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(input types.LocalSecondaryIndex) ComAmazonawsDynamodbTypes.LocalSecondaryIndex { + return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndex { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(key), com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndex_.Create_LocalSecondaryIndex_(com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_ToDafny(input.Projection)) }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_SourceTableDetails_ItemCount_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { + return func() ComAmazonawsDynamodbTypes.Projection { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return ComAmazonawsDynamodbTypes.Projection{} } - return Wrappers.Companion_Option_.Create_Some_(*input) + return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) }() } -func com_amazonaws_dynamodb_TagResourceInput_Tags_ToDafny(input []types.Tag) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input types.ProjectionType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ProjectionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ProjectionType)) }() } -func com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndexDescription) Wrappers.Option { +func com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_ToDafny(val) + element := com_amazonaws_dynamodb_NonKeyAttributeNameList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) +func com_amazonaws_dynamodb_NonKeyAttributeNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_Put_ConditionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_Update_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(input types.GlobalSecondaryIndex) ComAmazonawsDynamodbTypes.GlobalSecondaryIndex { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndex { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndex_.Create_GlobalSecondaryIndex_(com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { +func com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -3552,166 +3338,157 @@ func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_ToDafny(i }() } -func com_amazonaws_dynamodb_DescribeEndpointsResponse_Endpoints_ToDafny(input []types.Endpoint) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { + return func() ComAmazonawsDynamodbTypes.Projection { if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_Endpoints_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return ComAmazonawsDynamodbTypes.Projection{} } - return dafny.SeqOf(fieldValue...) + return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) }() } -func com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_ToDafny(input *bool) bool { - return func() bool { +func com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input *int64) int64 { + return func() int64 { if input == nil { - return false + return 0 } return *input }() } -func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input *int64) int64 { + return func() int64 { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return 0 } - return Wrappers.Companion_Option_.Create_Some_(*input) + return *input }() } -func com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_ToDafny(input []types.ContributorInsightsSummary) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ContributorInsightsSummaries_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_ToDafny(input []types.BatchStatementRequest) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_PartiQLBatchRequest_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_BatchGetItemOutput_Responses_ToDafny(input map[string][]map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_BatchGetResponseMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetResponseMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) - }() -} - -func com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_Key_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_CreateTableInput_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_ToDafny(input *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_.Create_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_(com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_ToDafny(input.DisableScaleIn), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_ToDafny(input.ScaleInCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_ToDafny(input.ScaleOutCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_ToDafny(input.TargetValue))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input *bool) bool { + return func() bool { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return false } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return *input }() } -func com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input types.StreamViewType) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_StreamViewType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.StreamViewType)) }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_CreateTableInput_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) }() } -func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateTableInput_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { +func com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input types.SSEType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3721,36 +3498,48 @@ func com_amazonaws_dynamodb_UpdateTableInput_BillingMode_ToDafny(input types.Bil } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEType)) }() } -func com_amazonaws_dynamodb_CreateTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_Tags_ToDafny(input []types.Tag) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_TagList_member_ToDafny(input types.Tag) ComAmazonawsDynamodbTypes.Tag { + return func() ComAmazonawsDynamodbTypes.Tag { + + return ComAmazonawsDynamodbTypes.Companion_Tag_.Create_Tag_(com_amazonaws_dynamodb_Tag_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Tag_Value_ToDafny(input.Value)) + }() +} + +func com_amazonaws_dynamodb_Tag_Key_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -3759,23 +3548,16 @@ func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_ToDafny(input }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_Tag_Value_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(input types.ReplicaDescription) ComAmazonawsDynamodbTypes.ReplicaDescription { - return func() ComAmazonawsDynamodbTypes.ReplicaDescription { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaDescription_.Create_ReplicaDescription_(com_amazonaws_dynamodb_ReplicaDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_ToDafny(input.ReplicaStatus), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_ToDafny(input.ReplicaStatusDescription), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_ToDafny(input.ReplicaStatusPercentProgress), com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_ToDafny(input.ReplicaInaccessibleDateTime), com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_ToDafny(input.ReplicaTableClassSummary)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_TableClass_ToDafny(input types.TableClass) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3785,81 +3567,91 @@ func com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input types.B } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_Statement_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_CreateTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) }() } -func com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_ToDafny(input types.TableClass) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input types.TableStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3869,160 +3661,80 @@ func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverrid } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) - }() -} - -func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) - }() -} - -func com_amazonaws_dynamodb_ListAttributeValue_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) - - default: - panic("Unhandled union type") - } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableStatus)) }() } -func com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input *types.PointInTimeRecoveryDescription) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_PointInTimeRecoveryDescription_.Create_PointInTimeRecoveryDescription_(com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_ToDafny(input.PointInTimeRecoveryStatus), com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_ToDafny(input.EarliestRestorableDateTime), com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_ToDafny(input.LatestRestorableDateTime))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughputDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) - }() -} - -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputDescription_.Create_ProvisionedThroughputDescription_(com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input.LastIncreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input.LastDecreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input.NumberOfDecreasesToday), com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_GlobalTable_GlobalTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_SourceTableDetails_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_StringSetAttributeValue_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } @@ -4035,43 +3747,43 @@ func com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input *int64 }() } -func com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_ToDafny(input *types.BackupDescription) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDescription_.Create_BackupDescription_(com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input.BackupDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input.SourceTableDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input.SourceTableFeatureDetails))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ResourceInUseException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input *types.BillingModeSummary) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BillingModeSummary_.Create_BillingModeSummary_(com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input.LastUpdateToPayPerRequestDateTime))) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_ToDafny(input types.BillingMode) Wrappers.Option { +func com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -4086,172 +3798,156 @@ func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_ToDa enum, ok = allEnums() if !ok { break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) - }() -} - -func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input *int64) int64 { - return func() int64 { - if input == nil { - return 0 - } - return *input - }() -} - -func com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_ToDafny(input types.GlobalSecondaryIndexInfo) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo { - return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo { - - return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexInfo_.Create_GlobalSecondaryIndexInfo_(com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndexDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ContributorInsightsSummaries_member_ToDafny(input types.ContributorInsightsSummary) ComAmazonawsDynamodbTypes.ContributorInsightsSummary { - return func() ComAmazonawsDynamodbTypes.ContributorInsightsSummary { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_ToDafny(input types.LocalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription { + return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription { - return ComAmazonawsDynamodbTypes.Companion_ContributorInsightsSummary_.Create_ContributorInsightsSummary_(com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_ToDafny(input.ContributorInsightsStatus)) + return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndexDescription_.Create_LocalSecondaryIndexDescription_(com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input.IndexSizeBytes), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_ToDafny(input.IndexArn)) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription { - return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexDescription_.Create_ReplicaGlobalSecondaryIndexDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride)) +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ScanOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_ToDafny(input *types.ImportTableDescription) ComAmazonawsDynamodbTypes.ImportTableDescription { - return func() ComAmazonawsDynamodbTypes.ImportTableDescription { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_ToDafny(input *types.Projection) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.ImportTableDescription{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_ImportTableDescription_.Create_ImportTableDescription_(com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input.ErrorCount), com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input.InputFormatOptions), com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input.InputCompressionType), com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input.TableCreationParameters), com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input.ProcessedSizeBytes), com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input.ProcessedItemCount), com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input.ImportedItemCount), com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input.FailureMessage)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) }() } -func com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_BatchStatementResponse_Error_ToDafny(input *types.BatchStatementError) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndexDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BatchStatementError_.Create_BatchStatementError_(com_amazonaws_dynamodb_BatchStatementError_Code_ToDafny(input.Code), com_amazonaws_dynamodb_BatchStatementError_Message_ToDafny(input.Message))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_ToDafny(input types.GlobalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexDescription_.Create_GlobalSecondaryIndexDescription_(com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_ToDafny(input.Backfilling), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input.IndexSizeBytes), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_ToDafny(input.IndexArn), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_ToDafny(input *types.ConditionCheck) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_ToDafny(input *types.Projection) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConditionCheck_.Create_ConditionCheck_(com_amazonaws_dynamodb_ConditionCheck_Key_ToDafny(input.Key), com_amazonaws_dynamodb_ConditionCheck_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) }() } -func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -4261,45 +3957,45 @@ func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_ } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_TransactionConflictException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughputDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputDescription_.Create_ProvisionedThroughputDescription_(com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input.LastIncreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input.LastDecreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input.NumberOfDecreasesToday), com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_DescribeTableInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4308,64 +4004,52 @@ func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_ToDafny(input * }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_ToDafny(input []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(input types.ReplicaSettingsDescription) ComAmazonawsDynamodbTypes.ReplicaSettingsDescription { - return func() ComAmazonawsDynamodbTypes.ReplicaSettingsDescription { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaSettingsDescription_.Create_ReplicaSettingsDescription_(com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_ToDafny(input.ReplicaStatus), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_ToDafny(input.ReplicaBillingModeSummary), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_ToDafny(input.ReplicaProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_ToDafny(input.ReplicaProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedWriteCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_ToDafny(input.ReplicaGlobalSecondaryIndexSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_ToDafny(input.ReplicaTableClassSummary)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4374,37 +4058,30 @@ func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_ToDafny( }() } -func com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input []types.ReplicaDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input types.InputFormat) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input *types.RestoreSummary) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputFormat)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_RestoreSummary_.Create_RestoreSummary_(com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_ToDafny(input.SourceBackupArn), com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_ToDafny(input.SourceTableArn), com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_ToDafny(input.RestoreDateTime), com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_ToDafny(input.RestoreInProgress))) }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4413,7 +4090,7 @@ func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_T }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4422,76 +4099,115 @@ func com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_ToDafny(input *stri }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_ToDafny(input *time.Time) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return dafny.SeqOf() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return dafny.SeqOfChars([]dafny.Char(formattedTime)...) }() } -func com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_ToDafny(input *bool) bool { + return func() bool { + if input == nil { + return false + } + return *input + }() +} + +func com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input *types.SSEDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSEDescription_.Create_SSEDescription_(com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input.Status), com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input.KMSMasterKeyArn), com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input.InaccessibleEncryptionDateTime))) }() } -func com_amazonaws_dynamodb_PartiQLBatchRequest_member_ToDafny(input types.BatchStatementRequest) ComAmazonawsDynamodbTypes.BatchStatementRequest { - return func() ComAmazonawsDynamodbTypes.BatchStatementRequest { +func com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input types.SSEStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEStatus)) + }() +} - return ComAmazonawsDynamodbTypes.Companion_BatchStatementRequest_.Create_BatchStatementRequest_(com_amazonaws_dynamodb_BatchStatementRequest_Statement_ToDafny(input.Statement), com_amazonaws_dynamodb_BatchStatementRequest_Parameters_ToDafny(input.Parameters), com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_ToDafny(input.ConsistentRead)) +func com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input types.SSEType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEType)) }() } -func com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_ToDafny(input []types.ItemResponse) Wrappers.Option { +func com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_ToDafny(input []types.ReplicaGlobalSecondaryIndexSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input *types.ArchivalSummary) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ArchivalSummary_.Create_ArchivalSummary_(com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_ToDafny(input.ArchivalDateTime), com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_ToDafny(input.ArchivalReason), com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_ToDafny(input.ArchivalBackupArn))) }() } -func com_amazonaws_dynamodb_GlobalTableList_member_ToDafny(input types.GlobalTable) ComAmazonawsDynamodbTypes.GlobalTable { - return func() ComAmazonawsDynamodbTypes.GlobalTable { - - return ComAmazonawsDynamodbTypes.Companion_GlobalTable_.Create_GlobalTable_(com_amazonaws_dynamodb_GlobalTable_GlobalTableName_ToDafny(input.GlobalTableName), com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_ToDafny(input.ReplicationGroup)) +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_BackupInUseException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4500,148 +4216,166 @@ func com_amazonaws_dynamodb_BackupInUseException_message_ToDafny(input *string) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(input types.GlobalSecondaryIndex) ComAmazonawsDynamodbTypes.GlobalSecondaryIndex { - return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndex { - - return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndex_.Create_GlobalSecondaryIndex_(com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ScanInput_ScanFilter_ToDafny(input map[string]types.Condition) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_FilterConditionMap_key_ToDafny(key), com_amazonaws_dynamodb_FilterConditionMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) }() } -func com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input *bool) bool { - return func() bool { +func com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return false + return Wrappers.Companion_Option_.Create_None_() } - return *input + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_AttributeMap_key_ToDafny(input string) dafny.Sequence { +func com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_ToDafny(input *types.BackupDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDescription_.Create_BackupDescription_(com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input.BackupDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input.SourceTableDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input.SourceTableFeatureDetails))) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { +func com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input *types.BackupDetails) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDetails_.Create_BackupDetails_(com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input.BackupSizeBytes), com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime))) }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { +func com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input *types.SourceTableDetails) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SourceTableDetails_.Create_SourceTableDetails_(com_amazonaws_dynamodb_SourceTableDetails_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_SourceTableDetails_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_SourceTableDetails_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_SourceTableDetails_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_ToDafny(input.TableCreationDateTime), com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_SourceTableDetails_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_SourceTableDetails_BillingMode_ToDafny(input.BillingMode))) }() } -func com_amazonaws_dynamodb_IndexNotFoundException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableDetails_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(input types.KeysAndAttributes) ComAmazonawsDynamodbTypes.KeysAndAttributes { - return func() ComAmazonawsDynamodbTypes.KeysAndAttributes { - - return ComAmazonawsDynamodbTypes.Companion_KeysAndAttributes_.Create_KeysAndAttributes_(com_amazonaws_dynamodb_KeysAndAttributes_Keys_ToDafny(input.Keys), com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_ToDafny(input.AttributesToGet), com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_ToDafny(input.ConsistentRead), com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_ToDafny(input.ProjectionExpression), com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames)) +func com_amazonaws_dynamodb_SourceTableDetails_TableId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableDetails_TableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_DescribeExportInput_ExportArn_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_SourceTableDetails_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_ToDafny(input *time.Time) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return dafny.SeqOfChars([]dafny.Char(formattedTime)...) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) ComAmazonawsDynamodbTypes.ProvisionedThroughput { + return func() ComAmazonawsDynamodbTypes.ProvisionedThroughput { + if input == nil { + return ComAmazonawsDynamodbTypes.ProvisionedThroughput{} + } + return ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits)) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableDetails_ItemCount_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableDetails_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -4651,41 +4385,48 @@ func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_To } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input *types.SourceTableFeatureDetails) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SourceTableFeatureDetails_.Create_SourceTableFeatureDetails_(com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_ToDafny(input.StreamDescription), com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_ToDafny(input.TimeToLiveDescription), com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_ToDafny(input.SSEDescription))) + }() +} + +func com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndexInfo) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_NonKeyAttributeNameList_member_ToDafny(val) + element := com_amazonaws_dynamodb_LocalSecondaryIndexes_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) +func com_amazonaws_dynamodb_LocalSecondaryIndexes_member_ToDafny(input types.LocalSecondaryIndexInfo) ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo { + return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo { + + return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndexInfo_.Create_LocalSecondaryIndexInfo_(com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_ToDafny(input.Projection)) }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4694,124 +4435,119 @@ func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_To }() } -func com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_BatchStatementRequest_Statement_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_ToDafny(input *types.Projection) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndexInfo) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ContributorInsightsRuleList_member_ToDafny(val) + element := com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_ToDafny(input []types.ReplicationGroupUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_ToDafny(input types.GlobalSecondaryIndexInfo) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexInfo_.Create_GlobalSecondaryIndexInfo_(com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_ToDafny(val) + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_DescribeTableOutput_Table_ToDafny(input *types.TableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_ToDafny(input *types.Projection) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) - }() -} - -func com_amazonaws_dynamodb_KeySchemaElement_KeyType_ToDafny(input types.KeyType) ComAmazonawsDynamodbTypes.KeyType { - return func() ComAmazonawsDynamodbTypes.KeyType { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_KeyType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(ComAmazonawsDynamodbTypes.KeyType) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) }() } -func com_amazonaws_dynamodb_Delete_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_ToDafny(input []types.Replica) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_ToDafny(input *types.StreamSpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + }() +} + +func com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_ToDafny(input *types.TimeToLiveDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveDescription_.Create_TimeToLiveDescription_(com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input.TimeToLiveStatus), com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input.AttributeName))) }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_ToDafny(input types.ComparisonOperator) Wrappers.Option { +func com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input types.TimeToLiveStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -4821,122 +4557,130 @@ func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_ToDafny(in } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TimeToLiveStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ComparisonOperator)) - }() -} - -func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_ToDafny(input *types.TimeToLiveSpecification) ComAmazonawsDynamodbTypes.TimeToLiveSpecification { - return func() ComAmazonawsDynamodbTypes.TimeToLiveSpecification { - if input == nil { - return ComAmazonawsDynamodbTypes.TimeToLiveSpecification{} - } - return ComAmazonawsDynamodbTypes.Companion_TimeToLiveSpecification_.Create_TimeToLiveSpecification_(com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input.AttributeName)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TimeToLiveStatus)) }() } -func com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_ToDafny(input *types.SSEDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSEDescription_.Create_SSEDescription_(com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input.Status), com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input.KMSMasterKeyArn), com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input.InaccessibleEncryptionDateTime))) }() } -func com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input []float64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_ToDafny(input types.ReplicationGroupUpdate) ComAmazonawsDynamodbTypes.ReplicationGroupUpdate { - return func() ComAmazonawsDynamodbTypes.ReplicationGroupUpdate { +func com_amazonaws_dynamodb_DeleteItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { - return ComAmazonawsDynamodbTypes.Companion_ReplicationGroupUpdate_.Create_ReplicationGroupUpdate_(com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_ToDafny(input.Update), com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_ToDafny(input.Delete)) + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughputDescription) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputDescription_.Create_ProvisionedThroughputDescription_(com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input.LastIncreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input.LastDecreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input.NumberOfDecreasesToday), com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexAutoScalingDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription { - return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription { +func com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexAutoScalingDescription_.Create_ReplicaGlobalSecondaryIndexAutoScalingDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettings)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) +func com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(input types.ExpectedAttributeValue) ComAmazonawsDynamodbTypes.ExpectedAttributeValue { + return func() ComAmazonawsDynamodbTypes.ExpectedAttributeValue { + + return ComAmazonawsDynamodbTypes.Companion_ExpectedAttributeValue_.Create_ExpectedAttributeValue_(com_amazonaws_dynamodb_ExpectedAttributeValue_Value_ToDafny(input.Value), com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_ToDafny(input.Exists), com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_ToDafny(input.ComparisonOperator), com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_ToDafny(input.AttributeValueList)) }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_ToDafny(input types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map))) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool))) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool))) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { +func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_ToDafny(input types.ComparisonOperator) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -4946,84 +4690,156 @@ func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_Index } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) - }() -} - -func com_amazonaws_dynamodb_Delete_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) - } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ComparisonOperator)) }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_ToDafny(input []types.ReplicaAutoScalingUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_ToDafny(input []types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_ToDafny(val) + element := com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_ToDafny(input *types.InputFormatOptions) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_InputFormatOptions_.Create_InputFormatOptions_(com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input.Csv))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) }() } -func com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_QueryInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) }() } -func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5032,101 +4848,114 @@ func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_ToDafny(input *str }() } -func com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} -func com_amazonaws_dynamodb_KeyConditions_value_ToDafny(input types.Condition) ComAmazonawsDynamodbTypes.Condition { - return func() ComAmazonawsDynamodbTypes.Condition { - - return ComAmazonawsDynamodbTypes.Companion_Condition_.Create_Condition_(com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input.AttributeValueList), com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input.ComparisonOperator)) + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(input string) dafny.Sequence { +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_ToDafny(input []types.ImportSummary) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ImportSummaryList_member_ToDafny(val) - fieldValue = append(fieldValue, element) +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_ToDafny(input *types.Projection) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) }() } -func com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input *types.SourceTableFeatureDetails) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SourceTableFeatureDetails_.Create_SourceTableFeatureDetails_(com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_ToDafny(input.StreamDescription), com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_ToDafny(input.TimeToLiveDescription), com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_ToDafny(input.SSEDescription))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5135,7 +4964,7 @@ func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_ToDafny( }() } -func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5144,107 +4973,132 @@ func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_ }() } -func com_amazonaws_dynamodb_CancellationReason_Code_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DeleteTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_CsvOptions_HeaderList_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_ToDafny(input *types.BackupDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_CsvHeaderList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDescription_.Create_BackupDescription_(com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input.BackupDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input.SourceTableDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input.SourceTableFeatureDetails))) + }() +} + +func com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ScanInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(input *types.ContinuousBackupsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ContinuousBackupsDescription_.Create_ContinuousBackupsDescription_(com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input.ContinuousBackupsStatus), com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input.PointInTimeRecoveryDescription))) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input types.ContinuousBackupsStatus) ComAmazonawsDynamodbTypes.ContinuousBackupsStatus { + return func() ComAmazonawsDynamodbTypes.ContinuousBackupsStatus { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContinuousBackupsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(fieldValue...) + return enum.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus) }() } -func com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_ToDafny(input *types.UpdateReplicationGroupMemberAction) Wrappers.Option { +func com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input *types.PointInTimeRecoveryDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateReplicationGroupMemberAction_.Create_UpdateReplicationGroupMemberAction_(com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_ToDafny(input.TableClassOverride))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_PointInTimeRecoveryDescription_.Create_PointInTimeRecoveryDescription_(com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_ToDafny(input.PointInTimeRecoveryStatus), com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_ToDafny(input.EarliestRestorableDateTime), com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_ToDafny(input.LatestRestorableDateTime))) + }() +} + +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_ToDafny(input types.PointInTimeRecoveryStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_PointInTimeRecoveryStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus)) }() } -func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_ToDafny(input []types.KinesisDataStreamDestination) Wrappers.Option { +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_QueryOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5253,7 +5107,7 @@ func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_ToD }() } -func com_amazonaws_dynamodb_ListExportsInput_NextToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5262,7 +5116,7 @@ func com_amazonaws_dynamodb_ListExportsInput_NextToken_ToDafny(input *string) Wr }() } -func com_amazonaws_dynamodb_ListExportsOutput_NextToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5271,70 +5125,86 @@ func com_amazonaws_dynamodb_ListExportsOutput_NextToken_ToDafny(input *string) W }() } -func com_amazonaws_dynamodb_BinarySetAttributeValue_member_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(v...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ContributorInsightsRuleList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_KeyConditions_key_ToDafny(input string) dafny.Sequence { +func com_amazonaws_dynamodb_ContributorInsightsRuleList_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) }() } -func com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_ToDafny(input map[string]types.AttributeValueUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeUpdates_key_ToDafny(key), com_amazonaws_dynamodb_AttributeUpdates_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_ToDafny(input *types.FailureException) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_FailureException_.Create_FailureException_(com_amazonaws_dynamodb_FailureException_ExceptionName_ToDafny(input.ExceptionName), com_amazonaws_dynamodb_FailureException_ExceptionDescription_ToDafny(input.ExceptionDescription))) }() } -func com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_FailureException_ExceptionName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_BackupSummary_TableId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_FailureException_ExceptionDescription_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5343,53 +5213,28 @@ func com_amazonaws_dynamodb_BackupSummary_TableId_ToDafny(input *string) Wrapper }() } -func com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(input types.ExpectedAttributeValue) ComAmazonawsDynamodbTypes.ExpectedAttributeValue { - return func() ComAmazonawsDynamodbTypes.ExpectedAttributeValue { - - return ComAmazonawsDynamodbTypes.Companion_ExpectedAttributeValue_.Create_ExpectedAttributeValue_(com_amazonaws_dynamodb_ExpectedAttributeValue_Value_ToDafny(input.Value), com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_ToDafny(input.Exists), com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_ToDafny(input.ComparisonOperator), com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_ToDafny(input.AttributeValueList)) - }() -} - -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_DescribeEndpointsResponse_Endpoints_ToDafny(input []types.Endpoint) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_dynamodb_ListImportsOutput_NextToken_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_Endpoints_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_ImportTableInput_InputFormat_ToDafny(input types.InputFormat) ComAmazonawsDynamodbTypes.InputFormat { - return func() ComAmazonawsDynamodbTypes.InputFormat { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(ComAmazonawsDynamodbTypes.InputFormat) +func com_amazonaws_dynamodb_Endpoints_member_ToDafny(input types.Endpoint) ComAmazonawsDynamodbTypes.Endpoint { + return func() ComAmazonawsDynamodbTypes.Endpoint { + + return ComAmazonawsDynamodbTypes.Companion_Endpoint_.Create_Endpoint_(com_amazonaws_dynamodb_Endpoint_Address_ToDafny(input.Address), com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_ToDafny(input.CachePeriodInMinutes)) }() } -func com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_Endpoint_Address_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5398,30 +5243,14 @@ func com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input *string) dafn }() } -func com_amazonaws_dynamodb_KeySchema_member_ToDafny(input types.KeySchemaElement) ComAmazonawsDynamodbTypes.KeySchemaElement { - return func() ComAmazonawsDynamodbTypes.KeySchemaElement { - - return ComAmazonawsDynamodbTypes.Companion_KeySchemaElement_.Create_KeySchemaElement_(com_amazonaws_dynamodb_KeySchemaElement_AttributeName_ToDafny(input.AttributeName), com_amazonaws_dynamodb_KeySchemaElement_KeyType_ToDafny(input.KeyType)) - }() -} - -func com_amazonaws_dynamodb_QueryOutput_ScannedCount_ToDafny(input int32) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) - }() -} +func com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_ToDafny(input int64) int64 { + return func() int64 { -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) + return input }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_DescribeExportInput_ExportArn_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5430,39 +5259,26 @@ func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_ToDafny(input }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_ToDafny(input *types.ExportDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_KeyList_member_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) - } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ExportDescription_.Create_ExportDescription_(com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input.ExportManifest), com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input.ExportTime), com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input.S3Prefix), com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input.S3SseAlgorithm), com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input.S3SseKmsKeyId), com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input.FailureMessage), com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input.ExportFormat), com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input.BilledSizeBytes), com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input.ExportType), com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input.IncrementalExportSpecification))) }() } -func com_amazonaws_dynamodb_UpdateItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input types.ContinuousBackupsStatus) ComAmazonawsDynamodbTypes.ContinuousBackupsStatus { - return func() ComAmazonawsDynamodbTypes.ContinuousBackupsStatus { +func com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input types.ExportStatus) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -5471,48 +5287,38 @@ func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContinuousBackupsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus) - }() -} - -func com_amazonaws_dynamodb_ScanOutput_ScannedCount_ToDafny(input int32) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportStatus)) }() } -func com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_ToDafny(input *types.BackupDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDescription_.Create_BackupDescription_(com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input.BackupDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input.SourceTableDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input.SourceTableFeatureDetails))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndexInfo) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5521,7 +5327,7 @@ func com_amazonaws_dynamodb_SourceTableDetails_TableArn_ToDafny(input *string) W }() } -func com_amazonaws_dynamodb_PolicyNotFoundException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5530,39 +5336,44 @@ func com_amazonaws_dynamodb_PolicyNotFoundException_message_ToDafny(input *strin }() } -func com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_ToDafny(input []types.GlobalSecondaryIndexUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5571,50 +5382,64 @@ func com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input *string) Wr }() } -func com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_ToDafny(input *types.DeleteReplicationGroupMemberAction) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteReplicationGroupMemberAction_.Create_DeleteReplicationGroupMemberAction_(com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(input []types.ItemCollectionMetrics) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input types.S3SseAlgorithm) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm)) }() } -func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) +func com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_BackupSummary_BackupStatus_ToDafny(input types.BackupStatus) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input types.ExportFormat) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -5624,25 +5449,18 @@ func com_amazonaws_dynamodb_BackupSummary_BackupStatus_ToDafny(input types.Backu } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupStatus)) - }() -} - -func com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportFormat)) }() } -func com_amazonaws_dynamodb_ScanInput_Segment_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5651,61 +5469,66 @@ func com_amazonaws_dynamodb_ScanInput_Segment_ToDafny(input *int32) Wrappers.Opt }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_CancellationReason_Message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input types.ExportType) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input *types.IncrementalExportSpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_IncrementalExportSpecification_.Create_IncrementalExportSpecification_(com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input.ExportFromTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input.ExportToTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input.ExportViewType))) }() } -func com_amazonaws_dynamodb_BatchStatementResponse_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) - }() -} - -func com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input types.ExportViewType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -5715,27 +5538,18 @@ func com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_ToDafny(input type } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportViewType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) - }() -} - -func com_amazonaws_dynamodb_ImportSummary_ImportArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportViewType)) }() } -func com_amazonaws_dynamodb_CreateBackupInput_BackupName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5744,149 +5558,130 @@ func com_amazonaws_dynamodb_CreateBackupInput_BackupName_ToDafny(input *string) }() } -func com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndexDescription) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) + }() +} + +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndex) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_ToDafny(input []types.ReplicaSettingsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input *types.IncrementalExportSpecification) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_IncrementalExportSpecification_.Create_IncrementalExportSpecification_(com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input.ExportFromTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input.ExportToTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input.ExportViewType))) +func com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(input types.ReplicaSettingsDescription) ComAmazonawsDynamodbTypes.ReplicaSettingsDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaSettingsDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaSettingsDescription_.Create_ReplicaSettingsDescription_(com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_ToDafny(input.ReplicaStatus), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_ToDafny(input.ReplicaBillingModeSummary), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_ToDafny(input.ReplicaProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_ToDafny(input.ReplicaProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedWriteCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_ToDafny(input.ReplicaGlobalSecondaryIndexSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_ToDafny(input.ReplicaTableClassSummary)) }() } -func com_amazonaws_dynamodb_ConditionCheck_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) +func com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return fieldValue.ToMap() + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_Delete_ConditionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) }() } -func com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) - - default: - panic("Unhandled union type") +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_ToDafny(input *types.BillingModeSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BillingModeSummary_.Create_BillingModeSummary_(com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input.LastUpdateToPayPerRequestDateTime))) }() } -func com_amazonaws_dynamodb_BackupSummary_BackupName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_Get_ProjectionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) }() } -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { - return func() ComAmazonawsDynamodbTypes.Projection { +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.Projection{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_AttributeDefinition_AttributeName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5895,91 +5690,98 @@ func com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input *bool) Wrappe }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_ToDafny(input []types.GlobalSecondaryIndexAutoScalingUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input []types.AutoScalingPolicyDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(val) + element := com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_ToDafny(input types.AutoScalingPolicyDescription) ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription { + return func() ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription { + + return ComAmazonawsDynamodbTypes.Companion_AutoScalingPolicyDescription_.Create_AutoScalingPolicyDescription_(com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_ToDafny(input.PolicyName), com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_ToDafny(input.TargetTrackingScalingPolicyConfiguration)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_ToDafny(input types.TableClass) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_ToDafny(input *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_.Create_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_(com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_ToDafny(input.DisableScaleIn), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_ToDafny(input.ScaleInCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_ToDafny(input.ScaleOutCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_ToDafny(input.TargetValue))) }() } -func com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(input *types.TableAutoScalingDescription) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableAutoScalingDescription_.Create_TableAutoScalingDescription_(com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input.Replicas))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_ToDafny(input *float64) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5988,37 +5790,46 @@ func com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_ToDafny(input *int32) Wr }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_ToDafny(input *types.SSEDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSEDescription_.Create_SSEDescription_(com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input.Status), com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input.KMSMasterKeyArn), com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input.InaccessibleEncryptionDateTime))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_ToDafny(input types.TableClass) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_ToDafny(input []types.ReplicaGlobalSecondaryIndexSettingsDescription) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexSettingsDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexSettingsDescription_.Create_ReplicaGlobalSecondaryIndexSettingsDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_ToDafny(input.ProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_ToDafny(input.ProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettings)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6028,37 +5839,36 @@ func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_ToDafny(i } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) }() } -func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6067,84 +5877,82 @@ func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationD }() } -func com_amazonaws_dynamodb_ListImportsInput_PageSize_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) }() } -func com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_ToDafny(input map[string]types.KeysAndAttributes) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) }() } -func com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(input types.ConsumedCapacity) ComAmazonawsDynamodbTypes.ConsumedCapacity { - return func() ComAmazonawsDynamodbTypes.ConsumedCapacity { +func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} - return ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes)) +func com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_ToDafny(input *types.ImportTableDescription) ComAmazonawsDynamodbTypes.ImportTableDescription { + return func() ComAmazonawsDynamodbTypes.ImportTableDescription { + if input == nil { + return ComAmazonawsDynamodbTypes.ImportTableDescription{} + } + return ComAmazonawsDynamodbTypes.Companion_ImportTableDescription_.Create_ImportTableDescription_(com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input.ErrorCount), com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input.InputFormatOptions), com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input.InputCompressionType), com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input.TableCreationParameters), com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input.ProcessedSizeBytes), com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input.ProcessedItemCount), com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input.ImportedItemCount), com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input.FailureMessage)) }() } -func com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) +func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input types.ImportStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ImportStatus)) + }() +} - default: - panic("Unhandled union type") +func com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_BatchStatementError_Message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6153,17 +5961,34 @@ func com_amazonaws_dynamodb_BatchStatementError_Message_ToDafny(input *string) W }() } -func com_amazonaws_dynamodb_ImportSummary_StartTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input *types.S3BucketSource) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix))) + }() +} + +func com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -6172,23 +5997,32 @@ func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_ToDafny(input *str }() } -func com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input int64) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input types.InputFormat) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6198,39 +6032,36 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_ToDafny( } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputFormat)) }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input *types.InputFormatOptions) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_InputFormatOptions_.Create_InputFormatOptions_(com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input.Csv))) + }() +} + +func com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input *types.CsvOptions) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CsvOptions_.Create_CsvOptions_(com_amazonaws_dynamodb_CsvOptions_Delimiter_ToDafny(input.Delimiter), com_amazonaws_dynamodb_CsvOptions_HeaderList_ToDafny(input.HeaderList))) }() } -func com_amazonaws_dynamodb_QueryInput_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_CsvOptions_Delimiter_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6239,21 +6070,28 @@ func com_amazonaws_dynamodb_QueryInput_IndexName_ToDafny(input *string) Wrappers }() } -func com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_CsvOptions_HeaderList_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + element := com_amazonaws_dynamodb_CsvHeaderList_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_CsvHeaderList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input types.InputCompressionType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6263,18 +6101,27 @@ func com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_ToDafny(inp } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputCompressionType)) }() } -func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input *types.TableCreationParameters) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableCreationParameters_.Create_TableCreationParameters_(com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input.SSESpecification), com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -6283,7 +6130,35 @@ func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_ToDafny(i }() } -func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { +func com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6293,103 +6168,102 @@ func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_ToDafny(input []types.ReplicaUpdate) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaUpdateList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_ToDafny(input []types.ReplicaSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_ToDafny(val) + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input int64) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input int64) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_ExportConflictException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input int64) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6398,82 +6272,65 @@ func com_amazonaws_dynamodb_ExportConflictException_message_ToDafny(input *strin }() } -func com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_ToDafny(input types.ReplicaSettingsUpdate) ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate { - return func() ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaSettingsUpdate_.Create_ReplicaSettingsUpdate_(com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_ToDafny(input.ReplicaProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_ToDafny(input.ReplicaGlobalSecondaryIndexSettingsUpdate), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_ToDafny(input.ReplicaTableClass)) +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_ToDafny(input []types.TransactGetItem) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_ToDafny(input []types.KinesisDataStreamDestination) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_TransactGetItemList_member_ToDafny(val) + element := com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return dafny.SeqOf(fieldValue...) - }() -} - -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(input types.LocalSecondaryIndex) ComAmazonawsDynamodbTypes.LocalSecondaryIndex { - return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndex { +func com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_ToDafny(input types.KinesisDataStreamDestination) ComAmazonawsDynamodbTypes.KinesisDataStreamDestination { + return func() ComAmazonawsDynamodbTypes.KinesisDataStreamDestination { - return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndex_.Create_LocalSecondaryIndex_(com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_ToDafny(input.Projection)) + return ComAmazonawsDynamodbTypes.Companion_KinesisDataStreamDestination_.Create_KinesisDataStreamDestination_(com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_ToDafny(input.StreamArn), com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_ToDafny(input.DestinationStatus), com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_ToDafny(input.DestinationStatusDescription), com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input *types.InputFormatOptions) Wrappers.Option { +func com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_InputFormatOptions_.Create_InputFormatOptions_(com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input.Csv))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input types.ComparisonOperator) ComAmazonawsDynamodbTypes.ComparisonOperator { - return func() ComAmazonawsDynamodbTypes.ComparisonOperator { +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -6482,25 +6339,27 @@ func com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input types.Com } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsDynamodbTypes.ComparisonOperator) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) }() } -func com_amazonaws_dynamodb_QueryOutput_Count_ToDafny(input int32) Wrappers.Option { +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { +func com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6510,112 +6369,99 @@ func com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_ToDafny(i } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) }() } -func com_amazonaws_dynamodb_NumberSetAttributeValue_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input *float64) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_ToDafny(input *types.SSESpecification) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_DescribeTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeTableOutput_Table_ToDafny(input *types.TableDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input types.ExportFormat) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(input *types.TableAutoScalingDescription) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportFormat)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableAutoScalingDescription_.Create_TableAutoScalingDescription_(com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input.Replicas))) }() } -func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_ToDafny(input types.BillingMode) Wrappers.Option { +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input types.TableStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6625,72 +6471,78 @@ func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMod } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableStatus)) }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_ToDafny(input *types.ExportDescription) Wrappers.Option { +func com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input []types.ReplicaAutoScalingDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ExportDescription_.Create_ExportDescription_(com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input.ExportManifest), com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input.ExportTime), com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input.S3Prefix), com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input.S3SseAlgorithm), com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input.S3SseKmsKeyId), com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input.FailureMessage), com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input.ExportFormat), com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input.BilledSizeBytes), com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input.ExportType), com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input.IncrementalExportSpecification))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_ToDafny(input map[string][]types.WriteRequest) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_ToDafny(input types.ReplicaAutoScalingDescription) ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(val)) + return ComAmazonawsDynamodbTypes.Companion_ReplicaAutoScalingDescription_.Create_ReplicaAutoScalingDescription_(com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedWriteCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_ToDafny(input.ReplicaStatus)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_ToDafny(input []types.ReplicaSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndexAutoScalingDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_ToDafny(input map[string][]types.ItemCollectionMetrics) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexAutoScalingDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexAutoScalingDescription_.Create_ReplicaGlobalSecondaryIndexAutoScalingDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettings)) }() } -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6700,73 +6552,75 @@ func com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_ToDafny( } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) }() } -func com_amazonaws_dynamodb_BackupSummary_BackupType_ToDafny(input types.BackupType) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupType)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) }() } -func com_amazonaws_dynamodb_UpdateItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) }() } -func com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_ToDafny(input []types.Replica) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) }() } -func com_amazonaws_dynamodb_Get_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -6775,126 +6629,82 @@ func com_amazonaws_dynamodb_Get_TableName_ToDafny(input *string) dafny.Sequence }() } -func com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughputDescription) Wrappers.Option { +func com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_ToDafny(input *types.TimeToLiveDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputDescription_.Create_ProvisionedThroughputDescription_(com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input.LastIncreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input.LastDecreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input.NumberOfDecreasesToday), com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveDescription_.Create_TimeToLiveDescription_(com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input.TimeToLiveStatus), com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input.AttributeName))) }() } -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) - }() -} - -func com_amazonaws_dynamodb_Key_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) - - default: - panic("Unhandled union type") + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - }() -} - -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) }() } -func com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input []types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -6904,122 +6714,134 @@ func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_ToDafny(input types.Ret } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) }() } -func com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_ToDafny(input *types.DeleteGlobalSecondaryIndexAction) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteGlobalSecondaryIndexAction_.Create_DeleteGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_ToDafny(input []types.BackupSummary) Wrappers.Option { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_BackupSummaries_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) }() } -func com_amazonaws_dynamodb_KeySchemaElement_AttributeName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) }() } -func com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteStatementInput_Statement_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_FailureException_ExceptionName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ReplicaNotFoundException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_BackupSummary_BackupArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7028,60 +6850,69 @@ func com_amazonaws_dynamodb_BackupSummary_BackupArn_ToDafny(input *string) Wrapp }() } -func com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ExecuteStatementInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_ToDafny(input *types.S3BucketSource) ComAmazonawsDynamodbTypes.S3BucketSource { - return func() ComAmazonawsDynamodbTypes.S3BucketSource { +func com_amazonaws_dynamodb_ExecuteStatementOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.S3BucketSource{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaUpdate_Delete_ToDafny(input *types.DeleteReplicaAction) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteReplicaAction_.Create_DeleteReplicaAction_(com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_ToDafny(input.RegionName))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) }() } -func com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() @@ -7092,16 +6923,51 @@ func com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_ToDafny(input map[string }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_ToDafny(input []types.ParameterizedStatement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ParameterizedStatements_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_ParameterizedStatements_member_ToDafny(input types.ParameterizedStatement) ComAmazonawsDynamodbTypes.ParameterizedStatement { + return func() ComAmazonawsDynamodbTypes.ParameterizedStatement { + + return ComAmazonawsDynamodbTypes.Companion_ParameterizedStatement_.Create_ParameterizedStatement_(com_amazonaws_dynamodb_ParameterizedStatement_Statement_ToDafny(input.Statement), com_amazonaws_dynamodb_ParameterizedStatement_Parameters_ToDafny(input.Parameters)) + }() +} + +func com_amazonaws_dynamodb_ParameterizedStatement_Statement_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ParameterizedStatement_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7110,7 +6976,7 @@ func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_ToDaf }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -7120,59 +6986,73 @@ func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationS } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) - }() -} - -func com_amazonaws_dynamodb_FilterConditionMap_value_ToDafny(input types.Condition) ComAmazonawsDynamodbTypes.Condition { - return func() ComAmazonawsDynamodbTypes.Condition { - - return ComAmazonawsDynamodbTypes.Companion_Condition_.Create_Condition_(com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input.AttributeValueList), com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input.ComparisonOperator)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input *float64) Wrappers.Option { +func com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_ToDafny(input []types.ItemResponse) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(input types.ItemResponse) ComAmazonawsDynamodbTypes.ItemResponse { + return func() ComAmazonawsDynamodbTypes.ItemResponse { + + return ComAmazonawsDynamodbTypes.Companion_ItemResponse_.Create_ItemResponse_(com_amazonaws_dynamodb_ItemResponse_Item_ToDafny(input.Item)) + }() +} + +func com_amazonaws_dynamodb_ItemResponse_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_Endpoints_member_ToDafny(input types.Endpoint) ComAmazonawsDynamodbTypes.Endpoint { - return func() ComAmazonawsDynamodbTypes.Endpoint { +func com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} - return ComAmazonawsDynamodbTypes.Companion_Endpoint_.Create_Endpoint_(com_amazonaws_dynamodb_Endpoint_Address_ToDafny(input.Address), com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_ToDafny(input.CachePeriodInMinutes)) +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7182,7 +7062,7 @@ func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_ToDaf }() } -func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7191,28 +7071,34 @@ func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_ToDafny(input *string }() } -func com_amazonaws_dynamodb_BatchStatementError_Code_ToDafny(input types.BatchStatementErrorCodeEnum) Wrappers.Option { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BatchStatementErrorCodeEnum_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input types.InputCompressionType) Wrappers.Option { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_ToDafny(input types.S3SseAlgorithm) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -7222,36 +7108,28 @@ func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny( } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputCompressionType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm)) }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_ToDafny(input *time.Time) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return dafny.SeqOf() + return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return dafny.SeqOfChars([]dafny.Char(formattedTime)...) - }() -} - -func com_amazonaws_dynamodb_CsvHeaderList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input types.BackupType) ComAmazonawsDynamodbTypes.BackupType { - return func() ComAmazonawsDynamodbTypes.BackupType { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_ToDafny(input types.ExportFormat) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -7260,45 +7138,18 @@ func com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input types.BackupT } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsDynamodbTypes.BackupType) - }() -} - -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) - }() -} - -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_ToDafny(input *types.FailureException) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_FailureException_.Create_FailureException_(com_amazonaws_dynamodb_FailureException_ExceptionName_ToDafny(input.ExceptionName), com_amazonaws_dynamodb_FailureException_ExceptionDescription_ToDafny(input.ExceptionDescription))) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportFormat)) }() } -func com_amazonaws_dynamodb_CreateTableInput_TableClass_ToDafny(input types.TableClass) Wrappers.Option { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_ToDafny(input types.ExportType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -7308,27 +7159,36 @@ func com_amazonaws_dynamodb_CreateTableInput_TableClass_ToDafny(input types.Tabl } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_ToDafny(input *types.IncrementalExportSpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_IncrementalExportSpecification_.Create_IncrementalExportSpecification_(com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input.ExportFromTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input.ExportToTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input.ExportViewType))) }() } -func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_ToDafny(input *types.ExportDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ExportDescription_.Create_ExportDescription_(com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input.ExportManifest), com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input.ExportTime), com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input.S3Prefix), com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input.S3SseAlgorithm), com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input.S3SseKmsKeyId), com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input.FailureMessage), com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input.ExportFormat), com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input.BilledSizeBytes), com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input.ExportType), com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input.IncrementalExportSpecification))) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -7337,30 +7197,41 @@ func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_ToDafny(input *st }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_GetItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_KeysAndAttributes_Keys_ToDafny(input []map[string]types.AttributeValue) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_GetItemInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_KeyList_member_ToDafny(val) + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input types.ExportViewType) Wrappers.Option { +func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -7370,27 +7241,18 @@ func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafn } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportViewType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportViewType)) - }() -} - -func com_amazonaws_dynamodb_ScanInput_TotalSegments_ToDafny(input *int32) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_InternalServerError_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7399,39 +7261,38 @@ func com_amazonaws_dynamodb_InternalServerError_message_ToDafny(input *string) W }() } -func com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input []types.ReplicaDescription) Wrappers.Option { +func com_amazonaws_dynamodb_GetItemOutput_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) }() } -func com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -7440,30 +7301,25 @@ func com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input *string) dafny }() } -func com_amazonaws_dynamodb_WriteRequests_member_ToDafny(input types.WriteRequest) ComAmazonawsDynamodbTypes.WriteRequest { - return func() ComAmazonawsDynamodbTypes.WriteRequest { - - return ComAmazonawsDynamodbTypes.Companion_WriteRequest_.Create_WriteRequest_(com_amazonaws_dynamodb_WriteRequest_PutRequest_ToDafny(input.PutRequest), com_amazonaws_dynamodb_WriteRequest_DeleteRequest_ToDafny(input.DeleteRequest)) - }() -} - -func com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_ToDafny(input *types.TimeToLiveDescription) Wrappers.Option { +func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveDescription_.Create_TimeToLiveDescription_(com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input.TimeToLiveStatus), com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input.AttributeName))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TableNameList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableInput_ClientToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7472,8 +7328,17 @@ func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_ToDafny(inpu }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_ToDafny(input types.ExportFormat) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_ToDafny(input *types.S3BucketSource) ComAmazonawsDynamodbTypes.S3BucketSource { + return func() ComAmazonawsDynamodbTypes.S3BucketSource { + if input == nil { + return ComAmazonawsDynamodbTypes.S3BucketSource{} + } + return ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix)) + }() +} + +func com_amazonaws_dynamodb_ImportTableInput_InputFormat_ToDafny(input types.InputFormat) ComAmazonawsDynamodbTypes.InputFormat { + return func() ComAmazonawsDynamodbTypes.InputFormat { var index int for _, enumVal := range input.Values() { index++ @@ -7482,147 +7347,113 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_ToDafny(i } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportFormat)) + return enum.(ComAmazonawsDynamodbTypes.InputFormat) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_ToDafny(input *types.InputFormatOptions) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_ReplicaList_member_ToDafny(input types.Replica) ComAmazonawsDynamodbTypes.Replica { - return func() ComAmazonawsDynamodbTypes.Replica { - - return ComAmazonawsDynamodbTypes.Companion_Replica_.Create_Replica_(com_amazonaws_dynamodb_Replica_RegionName_ToDafny(input.RegionName)) - }() -} - -func com_amazonaws_dynamodb_AttributeUpdates_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func com_amazonaws_dynamodb_ContributorInsightsRuleList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_InputFormatOptions_.Create_InputFormatOptions_(com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input.Csv))) }() } -func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_ToDafny(input types.InputCompressionType) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) - }() -} - -func com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputCompressionType)) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_ToDafny(input *types.TableCreationParameters) ComAmazonawsDynamodbTypes.TableCreationParameters { + return func() ComAmazonawsDynamodbTypes.TableCreationParameters { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return ComAmazonawsDynamodbTypes.TableCreationParameters{} } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return ComAmazonawsDynamodbTypes.Companion_TableCreationParameters_.Create_TableCreationParameters_(com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input.SSESpecification), com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes)) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_ToDafny(input *types.ImportTableDescription) ComAmazonawsDynamodbTypes.ImportTableDescription { + return func() ComAmazonawsDynamodbTypes.ImportTableDescription { if input == nil { - return nil + return ComAmazonawsDynamodbTypes.ImportTableDescription{} } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return ComAmazonawsDynamodbTypes.Companion_ImportTableDescription_.Create_ImportTableDescription_(com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input.ErrorCount), com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input.InputFormatOptions), com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input.InputCompressionType), com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input.TableCreationParameters), com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input.ProcessedSizeBytes), com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input.ProcessedItemCount), com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input.ImportedItemCount), com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input.FailureMessage)) }() } -func com_amazonaws_dynamodb_BatchStatementRequest_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ListBackupsInput_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_dynamodb_LocalSecondaryIndexes_member_ToDafny(input types.LocalSecondaryIndexInfo) ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo { - return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo { - - return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndexInfo_.Create_LocalSecondaryIndexInfo_(com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_ToDafny(input.Projection)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TableAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListBackupsInput_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_ToDafny(input *types.TimeToLiveSpecification) Wrappers.Option { +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveSpecification_.Create_TimeToLiveSpecification_(com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input.AttributeName))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_CreateBackupInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_PutItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input types.GlobalTableStatus) Wrappers.Option { +func com_amazonaws_dynamodb_ListBackupsInput_BackupType_ToDafny(input types.BackupTypeFilter) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -7632,93 +7463,104 @@ func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(inp } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_GlobalTableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupTypeFilter_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.GlobalTableStatus)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupTypeFilter)) }() } -func com_amazonaws_dynamodb_ScanOutput_Count_ToDafny(input int32) Wrappers.Option { +func com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_ToDafny(input []types.BackupSummary) Wrappers.Option { return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_BackupSummaries_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} - return Wrappers.Companion_Option_.Create_Some_(input) +func com_amazonaws_dynamodb_BackupSummaries_member_ToDafny(input types.BackupSummary) ComAmazonawsDynamodbTypes.BackupSummary { + return func() ComAmazonawsDynamodbTypes.BackupSummary { + + return ComAmazonawsDynamodbTypes.Companion_BackupSummary_.Create_BackupSummary_(com_amazonaws_dynamodb_BackupSummary_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_BackupSummary_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_BackupSummary_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_BackupSummary_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupSummary_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime), com_amazonaws_dynamodb_BackupSummary_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupSummary_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_ToDafny(input.BackupSizeBytes)) }() } -func com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_TableId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_TableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_BackupArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_ToDafny(input types.GlobalSecondaryIndexUpdate) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate { - return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate { - - return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexUpdate_.Create_GlobalSecondaryIndexUpdate_(com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_ToDafny(input.Update), com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_ToDafny(input.Delete)) +func com_amazonaws_dynamodb_BackupSummary_BackupName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DeleteItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_BackupStatus_ToDafny(input types.BackupStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -7728,148 +7570,121 @@ func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_ToDafny } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupStatus)) }() } -func com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_BackupType_ToDafny(input types.BackupType) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupType)) }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndex) Wrappers.Option { +func com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_CreateTableInput_Tags_ToDafny(input []types.Tag) Wrappers.Option { +func com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Endpoint_Address_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_ToDafny(input []types.GlobalTable) Wrappers.Option { +func com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_ToDafny(input int32) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_GlobalTableList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_ToDafny(input []types.ContributorInsightsSummary) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_GetItemOutput_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ContributorInsightsSummaries_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_TransactGetItemList_member_ToDafny(input types.TransactGetItem) ComAmazonawsDynamodbTypes.TransactGetItem { - return func() ComAmazonawsDynamodbTypes.TransactGetItem { +func com_amazonaws_dynamodb_ContributorInsightsSummaries_member_ToDafny(input types.ContributorInsightsSummary) ComAmazonawsDynamodbTypes.ContributorInsightsSummary { + return func() ComAmazonawsDynamodbTypes.ContributorInsightsSummary { - return ComAmazonawsDynamodbTypes.Companion_TransactGetItem_.Create_TransactGetItem_(com_amazonaws_dynamodb_TransactGetItem_Get_ToDafny(input.Get)) + return ComAmazonawsDynamodbTypes.Companion_ContributorInsightsSummary_.Create_ContributorInsightsSummary_(com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_ToDafny(input.ContributorInsightsStatus)) }() } -func com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input *types.BillingModeSummary) Wrappers.Option { +func com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BillingModeSummary_.Create_BillingModeSummary_(com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input.LastUpdateToPayPerRequestDateTime))) - }() -} - -func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(input types.ReplicaGlobalSecondaryIndex) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex { - return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndex_.Create_ReplicaGlobalSecondaryIndex_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { +func com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -7879,32 +7694,27 @@ func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_ToDafny(inp } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) }() } -func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_ToDafny(input []types.ReplicaSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ImportTableInput_ClientToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListExportsInput_TableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7913,25 +7723,16 @@ func com_amazonaws_dynamodb_ImportTableInput_ClientToken_ToDafny(input *string) }() } -func com_amazonaws_dynamodb_Tag_Key_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_dynamodb_GlobalTableNotFoundException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListExportsInput_MaxResults_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListExportsInput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -7940,84 +7741,106 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_ToDafny(input *st }() } -func com_amazonaws_dynamodb_ListBackupsInput_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_ToDafny(input []types.ExportSummary) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ExportSummaries_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_Update_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { +func com_amazonaws_dynamodb_ExportSummaries_member_ToDafny(input types.ExportSummary) ComAmazonawsDynamodbTypes.ExportSummary { + return func() ComAmazonawsDynamodbTypes.ExportSummary { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) - } - return fieldValue.ToMap() + return ComAmazonawsDynamodbTypes.Companion_ExportSummary_.Create_ExportSummary_(com_amazonaws_dynamodb_ExportSummary_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportSummary_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportSummary_ExportType_ToDafny(input.ExportType)) }() } -func com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input []types.ReplicaDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ExportSummary_ExportArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_ExportSummary_ExportStatus_ToDafny(input types.ExportStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportStatus)) }() } -func com_amazonaws_dynamodb_TagKeyList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_ExportSummary_ExportType_ToDafny(input types.ExportType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ListExportsOutput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Update_UpdateExpression_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8026,25 +7849,28 @@ func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input }() } -func com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_ToDafny(input []types.GlobalTable) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalTableList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) +func com_amazonaws_dynamodb_GlobalTableList_member_ToDafny(input types.GlobalTable) ComAmazonawsDynamodbTypes.GlobalTable { + return func() ComAmazonawsDynamodbTypes.GlobalTable { + + return ComAmazonawsDynamodbTypes.Companion_GlobalTable_.Create_GlobalTable_(com_amazonaws_dynamodb_GlobalTable_GlobalTableName_ToDafny(input.GlobalTableName), com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_ToDafny(input.ReplicationGroup)) }() } -func com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTable_GlobalTableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8053,23 +7879,21 @@ func com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_ToDafny(input *s }() } -func com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_ToDafny(input []types.Replica) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8078,52 +7902,55 @@ func com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input *string) W }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ListImportsInput_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { +func com_amazonaws_dynamodb_ListImportsInput_PageSize_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_ListImportsInput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_ToDafny(input []types.ImportSummary) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ImportSummaryList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_QueryInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) +func com_amazonaws_dynamodb_ImportSummaryList_member_ToDafny(input types.ImportSummary) ComAmazonawsDynamodbTypes.ImportSummary { + return func() ComAmazonawsDynamodbTypes.ImportSummary { + + return ComAmazonawsDynamodbTypes.Companion_ImportSummary_.Create_ImportSummary_(com_amazonaws_dynamodb_ImportSummary_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportSummary_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportSummary_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportSummary_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportSummary_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportSummary_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportSummary_EndTime_ToDafny(input.EndTime)) }() } -func com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ImportSummary_ImportArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8132,16 +7959,28 @@ func com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input *string) Wr }() } -func com_amazonaws_dynamodb_DeleteTableInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_ImportSummary_ImportStatus_ToDafny(input types.ImportStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ImportStatus)) }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ImportSummary_TableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8150,153 +7989,155 @@ func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_To }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_ImportSummary_S3BucketSource_ToDafny(input *types.S3BucketSource) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix))) }() } -func com_amazonaws_dynamodb_QueryInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_ImportSummary_InputFormat_ToDafny(input types.InputFormat) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputFormat)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_StartTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input *types.SSEDescription) Wrappers.Option { +func com_amazonaws_dynamodb_ImportSummary_EndTime_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSEDescription_.Create_SSEDescription_(com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input.Status), com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input.KMSMasterKeyArn), com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input.InaccessibleEncryptionDateTime))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ListImportsOutput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_ToDafny(input *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { - return func() ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { +func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_.Create_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_(com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_ToDafny(input.DisableScaleIn), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_ToDafny(input.ScaleInCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_ToDafny(input.ScaleOutCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_ToDafny(input.TargetValue)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ListTablesInput_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_ListTablesOutput_TableNames_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TableNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) +func com_amazonaws_dynamodb_TableNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - default: - panic("Unhandled union type") + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { +func com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() -} - -func com_amazonaws_dynamodb_ImportSummaryList_member_ToDafny(input types.ImportSummary) ComAmazonawsDynamodbTypes.ImportSummary { - return func() ComAmazonawsDynamodbTypes.ImportSummary { +} - return ComAmazonawsDynamodbTypes.Companion_ImportSummary_.Create_ImportSummary_(com_amazonaws_dynamodb_ImportSummary_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportSummary_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportSummary_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportSummary_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportSummary_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportSummary_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportSummary_EndTime_ToDafny(input.EndTime)) +func com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_CreateTableInput_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_ToDafny(input []types.Tag) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8305,62 +8146,101 @@ func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_ToDafny(inp }() } -func com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { +func com_amazonaws_dynamodb_PutItemInput_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) } - return dafny.SeqOf(fieldValue...) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_ListTablesInput_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) }() } -func com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_ToDafny(input []types.ExportSummary) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ExportSummaries_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_ToDafny(input types.ExportType) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -8370,54 +8250,96 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_ToDafny(inp } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) }() } -func com_amazonaws_dynamodb_DeleteItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) Wrappers.Option { +func com_amazonaws_dynamodb_PutItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8426,7 +8348,41 @@ func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_ToDafny(i }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_ToDafny(input types.S3SseAlgorithm) Wrappers.Option { +func com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_QueryInput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_Select_ToDafny(input types.Select) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -8436,130 +8392,135 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_ToDafny } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.Select)) }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_Update_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_KeyConditions_ToDafny(input map[string]types.Condition) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_KeyConditions_key_ToDafny(key), com_amazonaws_dynamodb_KeyConditions_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } - -func com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + +func com_amazonaws_dynamodb_KeyConditions_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) +func com_amazonaws_dynamodb_KeyConditions_value_ToDafny(input types.Condition) ComAmazonawsDynamodbTypes.Condition { + return func() ComAmazonawsDynamodbTypes.Condition { + + return ComAmazonawsDynamodbTypes.Companion_Condition_.Create_Condition_(com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input.AttributeValueList), com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input.ComparisonOperator)) }() } -func com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { +func com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input []types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) + element := com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input types.ComparisonOperator) ComAmazonawsDynamodbTypes.ComparisonOperator { + return func() ComAmazonawsDynamodbTypes.ComparisonOperator { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return enum.(ComAmazonawsDynamodbTypes.ComparisonOperator) }() } -func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_QueryFilter_ToDafny(input map[string]types.Condition) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_FilterConditionMap_key_ToDafny(key), com_amazonaws_dynamodb_FilterConditionMap_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(input types.ItemResponse) ComAmazonawsDynamodbTypes.ItemResponse { - return func() ComAmazonawsDynamodbTypes.ItemResponse { +func com_amazonaws_dynamodb_FilterConditionMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return ComAmazonawsDynamodbTypes.Companion_ItemResponse_.Create_ItemResponse_(com_amazonaws_dynamodb_ItemResponse_Item_ToDafny(input.Item)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_ToDafny(input types.BillingMode) Wrappers.Option { +func com_amazonaws_dynamodb_FilterConditionMap_value_ToDafny(input types.Condition) ComAmazonawsDynamodbTypes.Condition { + return func() ComAmazonawsDynamodbTypes.Condition { + + return ComAmazonawsDynamodbTypes.Companion_Condition_.Create_Condition_(com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input.AttributeValueList), com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input.ComparisonOperator)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -8569,163 +8530,156 @@ func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_T } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) - }() -} - -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_ToDafny(input types.GlobalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription { - return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription { - - return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexDescription_.Create_GlobalSecondaryIndexDescription_(com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_ToDafny(input.Backfilling), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input.IndexSizeBytes), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_ToDafny(input.IndexArn), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_ScanIndexForward_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input []types.AutoScalingPolicyDescription) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_WriteRequest_PutRequest_ToDafny(input *types.PutRequest) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_FilterExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_PutRequest_.Create_PutRequest_(com_amazonaws_dynamodb_PutRequest_Item_ToDafny(input.Item))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_PutItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate { - return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate { +func com_amazonaws_dynamodb_QueryOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} - return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexAutoScalingUpdate_.Create_ReplicaGlobalSecondaryIndexAutoScalingUpdate_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_ToDafny(input.ProvisionedReadCapacityAutoScalingUpdate)) +func com_amazonaws_dynamodb_QueryOutput_Count_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_ToDafny(input types.ReplicaAutoScalingDescription) ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription { - return func() ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription { +func com_amazonaws_dynamodb_QueryOutput_ScannedCount_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { - return ComAmazonawsDynamodbTypes.Companion_ReplicaAutoScalingDescription_.Create_ReplicaAutoScalingDescription_(com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedWriteCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_ToDafny(input.ReplicaStatus)) + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_SourceTableDetails_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) - }() -} - -func com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) }() } -func com_amazonaws_dynamodb_ParameterizedStatement_Statement_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -8734,18 +8688,16 @@ func com_amazonaws_dynamodb_ParameterizedStatement_Statement_ToDafny(input *stri }() } -func com_amazonaws_dynamodb_PutItemInput_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return fieldValue.ToMap() + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input types.TableStatus) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_ToDafny(input types.BillingMode) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -8755,46 +8707,82 @@ func com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input types.Tab } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableStatus)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_ExportSummary_ExportArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_ToDafny(input *types.SSESpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) }() } -func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -8803,37 +8791,44 @@ func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_ToDafny(inpu }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(input types.GlobalTableGlobalSecondaryIndexSettingsUpdate) ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate { - return func() ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate { - - return ComAmazonawsDynamodbTypes.Companion_GlobalTableGlobalSecondaryIndexSettingsUpdate_.Create_GlobalTableGlobalSecondaryIndexSettingsUpdate_(com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_ToDafny(input.ProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettingsUpdate)) +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_ToDafny(input []types.CancellationReason) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_CancellationReasonList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_ToDafny(input types.BillingMode) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -8843,73 +8838,82 @@ func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreat } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_ToDafny(input []types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(val) + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input *types.CsvOptions) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CsvOptions_.Create_CsvOptions_(com_amazonaws_dynamodb_CsvOptions_Delimiter_ToDafny(input.Delimiter), com_amazonaws_dynamodb_CsvOptions_HeaderList_ToDafny(input.HeaderList))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_ListTablesOutput_TableNames_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_TableNameList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_ToDafny(input *types.SSESpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) }() } -func com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) }() } -func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ScanInput_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -8918,17 +8922,39 @@ func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_ToDafny(input *string) }() } -func com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input *time.Time) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ScanInput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return dafny.SeqOf() + return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return dafny.SeqOfChars([]dafny.Char(formattedTime)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AttributeValueUpdate_Action_ToDafny(input types.AttributeAction) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ScanInput_Select_ToDafny(input types.Select) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -8938,18 +8964,18 @@ func com_amazonaws_dynamodb_AttributeValueUpdate_Action_ToDafny(input types.Attr } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeAction_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.AttributeAction)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.Select)) }() } -func com_amazonaws_dynamodb_QueryInput_QueryFilter_ToDafny(input map[string]types.Condition) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_ScanFilter_ToDafny(input map[string]types.Condition) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() @@ -8960,32 +8986,39 @@ func com_amazonaws_dynamodb_QueryInput_QueryFilter_ToDafny(input map[string]type }() } -func com_amazonaws_dynamodb_GetItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) +func com_amazonaws_dynamodb_ScanInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return fieldValue.ToMap() + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) }() } -func com_amazonaws_dynamodb_UntagResourceInput_TagKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_TagKeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) +func com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -9006,76 +9039,65 @@ func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_ToDafny(input ty }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_TotalSegments_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ParameterizedStatement_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_Segment_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_ToDafny(input *types.ImportTableDescription) ComAmazonawsDynamodbTypes.ImportTableDescription { - return func() ComAmazonawsDynamodbTypes.ImportTableDescription { +func com_amazonaws_dynamodb_ScanInput_FilterExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.ImportTableDescription{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_ImportTableDescription_.Create_ImportTableDescription_(com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input.ErrorCount), com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input.InputFormatOptions), com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input.InputCompressionType), com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input.TableCreationParameters), com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input.ProcessedSizeBytes), com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input.ProcessedItemCount), com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input.ImportedItemCount), com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input.FailureMessage)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_ToDafny(input []types.GlobalTableGlobalSecondaryIndexSettingsUpdate) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_ScanInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -9084,53 +9106,55 @@ func com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_ToDafny(input * }() } -func com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ScanOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ListExportsInput_MaxResults_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_ScanOutput_Count_ToDafny(input int32) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) +func com_amazonaws_dynamodb_ScanOutput_ScannedCount_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ImportConflictException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) }() } -func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_TagResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -9139,41 +9163,62 @@ func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_ToDafny(input *string }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_TagResourceInput_Tags_ToDafny(input []types.Tag) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_ToDafny(input []types.TransactGetItem) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TransactGetItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_TransactGetItemList_member_ToDafny(input types.TransactGetItem) ComAmazonawsDynamodbTypes.TransactGetItem { + return func() ComAmazonawsDynamodbTypes.TransactGetItem { + + return ComAmazonawsDynamodbTypes.Companion_TransactGetItem_.Create_TransactGetItem_(com_amazonaws_dynamodb_TransactGetItem_Get_ToDafny(input.Get)) + }() +} + +func com_amazonaws_dynamodb_TransactGetItem_Get_ToDafny(input *types.Get) ComAmazonawsDynamodbTypes.Get { + return func() ComAmazonawsDynamodbTypes.Get { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return ComAmazonawsDynamodbTypes.Get{} } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return ComAmazonawsDynamodbTypes.Companion_Get_.Create_Get_(com_amazonaws_dynamodb_Get_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Get_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Get_ProjectionExpression_ToDafny(input.ProjectionExpression), com_amazonaws_dynamodb_Get_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames)) }() } -func com_amazonaws_dynamodb_StringSetAttributeValue_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_Get_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { - return dafny.SeqOfChars([]dafny.Char(input)...) + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_UpdateTableInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_Get_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -9182,26 +9227,27 @@ func com_amazonaws_dynamodb_UpdateTableInput_TableName_ToDafny(input *string) da }() } -func com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_Get_ProjectionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_Get_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -9211,220 +9257,208 @@ func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_ToDa } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_ToDafny(input *types.Projection) Wrappers.Option { +func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) - }() -} - -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_ToDafny(input []types.ItemResponse) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_ToDafny(input []types.TransactWriteItem) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TransactWriteItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) +func com_amazonaws_dynamodb_TransactWriteItemList_member_ToDafny(input types.TransactWriteItem) ComAmazonawsDynamodbTypes.TransactWriteItem { + return func() ComAmazonawsDynamodbTypes.TransactWriteItem { + + return ComAmazonawsDynamodbTypes.Companion_TransactWriteItem_.Create_TransactWriteItem_(com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_ToDafny(input.ConditionCheck), com_amazonaws_dynamodb_TransactWriteItem_Put_ToDafny(input.Put), com_amazonaws_dynamodb_TransactWriteItem_Delete_ToDafny(input.Delete), com_amazonaws_dynamodb_TransactWriteItem_Update_ToDafny(input.Update)) }() } -func com_amazonaws_dynamodb_QueryInput_FilterExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_ToDafny(input *types.ConditionCheck) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConditionCheck_.Create_ConditionCheck_(com_amazonaws_dynamodb_ConditionCheck_Key_ToDafny(input.Key), com_amazonaws_dynamodb_ConditionCheck_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) }() } -func com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input types.TimeToLiveStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TimeToLiveStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TimeToLiveStatus)) - }() -} +func com_amazonaws_dynamodb_ConditionCheck_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { -func com_amazonaws_dynamodb_InvalidExportTimeException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ConditionCheck_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_NumberSetAttributeValue_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input *float64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_ToDafny(input *types.Projection) Wrappers.Option { +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input *float64) Wrappers.Option { +func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) }() } -func com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItem_Put_ToDafny(input *types.Put) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Put_.Create_Put_(com_amazonaws_dynamodb_Put_Item_ToDafny(input.Item), com_amazonaws_dynamodb_Put_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Put_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Put_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Put_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) }() } -func com_amazonaws_dynamodb_TransactionCanceledException_Message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_dynamodb_Put_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_Put_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_Put_ConditionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_Put_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_FailureException_ExceptionDescription_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_Put_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { +func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -9445,58 +9479,67 @@ func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_T }() } -func com_amazonaws_dynamodb_InvalidRestoreTimeException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItem_Delete_ToDafny(input *types.Delete) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Delete_.Create_Delete_(com_amazonaws_dynamodb_Delete_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Delete_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Delete_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) }() } -func com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_ToDafny(input []types.ItemResponse) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(val) - fieldValue = append(fieldValue, element) +func com_amazonaws_dynamodb_Delete_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input *bool) bool { - return func() bool { +func com_amazonaws_dynamodb_Delete_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return false + return nil } - return *input + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_Delete_ConditionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input types.S3SseAlgorithm) Wrappers.Option { +func com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -9506,58 +9549,38 @@ func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input types } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) }() } -func com_amazonaws_dynamodb_MapAttributeValue_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) +func com_amazonaws_dynamodb_TransactWriteItem_Update_ToDafny(input *types.Update) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Update_.Create_Update_(com_amazonaws_dynamodb_Update_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Update_UpdateExpression_ToDafny(input.UpdateExpression), com_amazonaws_dynamodb_Update_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Update_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Update_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Update_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + }() +} - default: - panic("Unhandled union type") +func com_amazonaws_dynamodb_Update_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) } + return fieldValue.ToMap() }() } -func com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_Update_UpdateExpression_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -9566,16 +9589,16 @@ func com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_ToD }() } -func com_amazonaws_dynamodb_TransactWriteItem_Update_ToDafny(input *types.Update) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_Update_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Update_.Create_Update_(com_amazonaws_dynamodb_Update_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Update_UpdateExpression_ToDafny(input.UpdateExpression), com_amazonaws_dynamodb_Update_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Update_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Update_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Update_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_Update_ConditionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -9584,73 +9607,92 @@ func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_ToDafny(inpu }() } -func com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_Update_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) - }() -} -func com_amazonaws_dynamodb_ListImportsInput_TableArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_QueryInput_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_dynamodb_Update_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} -func com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) }() } -func com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) }() } -func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -9659,7 +9701,7 @@ func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_ToDafny(input *s }() } -func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -9673,7 +9715,18 @@ func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_ToDafny(inpu }() } -func com_amazonaws_dynamodb_Tag_Value_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_ToDafny(input map[string][]types.ItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -9682,93 +9735,73 @@ func com_amazonaws_dynamodb_Tag_Value_ToDafny(input *string) dafny.Sequence { }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_ToDafny(input *types.Projection) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_UntagResourceInput_TagKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagKeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_BackupSummaries_member_ToDafny(input types.BackupSummary) ComAmazonawsDynamodbTypes.BackupSummary { - return func() ComAmazonawsDynamodbTypes.BackupSummary { - - return ComAmazonawsDynamodbTypes.Companion_BackupSummary_.Create_BackupSummary_(com_amazonaws_dynamodb_BackupSummary_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_BackupSummary_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_BackupSummary_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_BackupSummary_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupSummary_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime), com_amazonaws_dynamodb_BackupSummary_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupSummary_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_ToDafny(input.BackupSizeBytes)) - }() -} +func com_amazonaws_dynamodb_TagKeyList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { -func com_amazonaws_dynamodb_BackupNotFoundException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func com_amazonaws_dynamodb_BatchStatementResponse_TableName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_ToDafny(input *types.PointInTimeRecoverySpecification) ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification { + return func() ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification{} } - return Wrappers.Companion_Option_.Create_Some_(*input) + return ComAmazonawsDynamodbTypes.Companion_PointInTimeRecoverySpecification_.Create_PointInTimeRecoverySpecification_(com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_ToDafny(input.PointInTimeRecoveryEnabled)) }() } -func com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input *int64) int64 { - return func() int64 { +func com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_ToDafny(input *bool) bool { + return func() bool { if input == nil { - return 0 + return false } return *input }() } -func com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_ToDafny(input *types.CreateReplicationGroupMemberAction) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(input *types.ContinuousBackupsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateReplicationGroupMemberAction_.Create_CreateReplicationGroupMemberAction_(com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_ToDafny(input.TableClassOverride))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ContinuousBackupsDescription_.Create_ContinuousBackupsDescription_(com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input.ContinuousBackupsStatus), com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input.PointInTimeRecoveryDescription))) }() } -func com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_ToDafny(input []types.BatchStatementResponse) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_PartiQLBatchResponse_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_dynamodb_ItemResponse_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + return nil } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -9777,42 +9810,37 @@ func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny }() } -func com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input *float64) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_ToDafny(input types.ContributorInsightsAction) ComAmazonawsDynamodbTypes.ContributorInsightsAction { + return func() ComAmazonawsDynamodbTypes.ContributorInsightsAction { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) - }() -} - -func com_amazonaws_dynamodb_ImportSummary_EndTime_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsAction_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return enum.(ComAmazonawsDynamodbTypes.ContributorInsightsAction) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_ToDafny(input *types.UpdateGlobalSecondaryIndexAction) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateGlobalSecondaryIndexAction_.Create_UpdateGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_BackupSummary_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -9821,216 +9849,178 @@ func com_amazonaws_dynamodb_BackupSummary_TableName_ToDafny(input *string) Wrapp }() } -func com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_AttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) - - default: - panic("Unhandled union type") + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) }() } -func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(input types.Capacity) ComAmazonawsDynamodbTypes.Capacity { - return func() ComAmazonawsDynamodbTypes.Capacity { - - return ComAmazonawsDynamodbTypes.Companion_Capacity_.Create_Capacity_(com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input.CapacityUnits)) +func com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) - - default: - panic("Unhandled union type") +func com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_ToDafny(input []types.ReplicaUpdate) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_Update_ConditionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaUpdateList_member_ToDafny(input types.ReplicaUpdate) ComAmazonawsDynamodbTypes.ReplicaUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaUpdate_.Create_ReplicaUpdate_(com_amazonaws_dynamodb_ReplicaUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_ReplicaUpdate_Delete_ToDafny(input.Delete)) + }() +} + +func com_amazonaws_dynamodb_ReplicaUpdate_Create_ToDafny(input *types.CreateReplicaAction) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexSettingsUpdate) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate { - return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexSettingsUpdate_.Create_ReplicaGlobalSecondaryIndexSettingsUpdate_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_ToDafny(input.ProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input.ProvisionedReadCapacityAutoScalingSettingsUpdate)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateReplicaAction_.Create_CreateReplicaAction_(com_amazonaws_dynamodb_CreateReplicaAction_RegionName_ToDafny(input.RegionName))) }() } -func com_amazonaws_dynamodb_CreateTableInput_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { +func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { - return func() ComAmazonawsDynamodbTypes.Projection { +func com_amazonaws_dynamodb_ReplicaUpdate_Delete_ToDafny(input *types.DeleteReplicaAction) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.Projection{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteReplicaAction_.Create_DeleteReplicaAction_(com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_ToDafny(input.RegionName))) }() } -func com_amazonaws_dynamodb_TransactGetItem_Get_ToDafny(input *types.Get) ComAmazonawsDynamodbTypes.Get { - return func() ComAmazonawsDynamodbTypes.Get { +func com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return ComAmazonawsDynamodbTypes.Get{} + return nil } - return ComAmazonawsDynamodbTypes.Companion_Get_.Create_Get_(com_amazonaws_dynamodb_Get_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Get_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Get_ProjectionExpression_ToDafny(input.ProjectionExpression), com_amazonaws_dynamodb_Get_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) }() } -func com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_ToDafny(input float64) dafny.Sequence { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} - var bits = math.Float64bits(input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return dafny.SeqOf(v...) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) }() } -func com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(input types.GlobalSecondaryIndexAutoScalingUpdate) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate { - return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate { - - return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexAutoScalingUpdate_.Create_GlobalSecondaryIndexAutoScalingUpdate_(com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input.ProvisionedWriteCapacityAutoScalingUpdate)) +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_ReplicaDescription_RegionName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -10039,16 +10029,16 @@ func com_amazonaws_dynamodb_ReplicaDescription_RegionName_ToDafny(input *string) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input *types.AutoScalingPolicyUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingPolicyUpdate_.Create_AutoScalingPolicyUpdate_(com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_ToDafny(input.PolicyName), com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_ToDafny(input.TargetTrackingScalingPolicyConfiguration))) }() } -func com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -10057,58 +10047,128 @@ func com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_ToDafny(i }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_ToDafny(input *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + return func() ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + if input == nil { + return ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{} + } + return ComAmazonawsDynamodbTypes.Companion_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_.Create_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_(com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_ToDafny(input.DisableScaleIn), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_ToDafny(input.ScaleInCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_ToDafny(input.ScaleOutCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_ToDafny(input.TargetValue)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_ToDafny(input *float64) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_ToDafny(input []types.GlobalTableGlobalSecondaryIndexSettingsUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) + element := com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(input types.GlobalTableGlobalSecondaryIndexSettingsUpdate) ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate { + return func() ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate { + + return ComAmazonawsDynamodbTypes.Companion_GlobalTableGlobalSecondaryIndexSettingsUpdate_.Create_GlobalTableGlobalSecondaryIndexSettingsUpdate_(com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_ToDafny(input.ProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettingsUpdate)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input *types.RestoreSummary) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_RestoreSummary_.Create_RestoreSummary_(com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_ToDafny(input.SourceBackupArn), com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_ToDafny(input.SourceTableArn), com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_ToDafny(input.RestoreDateTime), com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_ToDafny(input.RestoreInProgress))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) }() } -func com_amazonaws_dynamodb_PutItemInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_ToDafny(input []types.ReplicaSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_ToDafny(input types.ReplicaSettingsUpdate) ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaSettingsUpdate_.Create_ReplicaSettingsUpdate_(com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_ToDafny(input.ReplicaProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_ToDafny(input.ReplicaGlobalSecondaryIndexSettingsUpdate), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_ToDafny(input.ReplicaTableClass)) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -10117,34 +10177,46 @@ func com_amazonaws_dynamodb_PutItemInput_TableName_ToDafny(input *string) dafny. }() } -func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_MapAttributeValue_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_ToDafny(input []types.ReplicaGlobalSecondaryIndexSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_ToDafny(input *types.UpdateKinesisStreamingConfiguration) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingConfiguration_.Create_UpdateKinesisStreamingConfiguration_(com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexSettingsUpdate) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexSettingsUpdate_.Create_ReplicaGlobalSecondaryIndexSettingsUpdate_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_ToDafny(input.ProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input.ProvisionedReadCapacityAutoScalingSettingsUpdate)) }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -10153,27 +10225,25 @@ func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_ToDafn }() } -func com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_dynamodb_UpdateItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) }() } -func com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_ToDafny(input types.TableClass) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -10183,48 +10253,86 @@ func com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_ToDafny(input types } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) }() } -func com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_ToDafny(input []types.ReplicaSettingsDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_ToDafny(input types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_ToDafny(input map[string]types.AttributeValueUpdate) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeUpdates_key_ToDafny(key), com_amazonaws_dynamodb_AttributeUpdates_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_AttributeUpdates_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_AttributeUpdates_value_ToDafny(input types.AttributeValueUpdate) ComAmazonawsDynamodbTypes.AttributeValueUpdate { + return func() ComAmazonawsDynamodbTypes.AttributeValueUpdate { + + return ComAmazonawsDynamodbTypes.Companion_AttributeValueUpdate_.Create_AttributeValueUpdate_(com_amazonaws_dynamodb_AttributeValueUpdate_Value_ToDafny(input.Value), com_amazonaws_dynamodb_AttributeValueUpdate_Action_ToDafny(input.Action)) + }() +} + +func com_amazonaws_dynamodb_AttributeValueUpdate_Value_ToDafny(input types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { switch input.(type) { case *types.AttributeValueMemberS: @@ -10264,50 +10372,39 @@ func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_ToDafny(input types.Att }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_AttributeValueUpdate_Action_ToDafny(input types.AttributeAction) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeAction_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.AttributeAction)) }() } -func com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) } return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -10317,58 +10414,39 @@ func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_ToDafny(input ty } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) - }() -} - -func com_amazonaws_dynamodb_PutItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_ItemList_member_ToDafny(input map[string]types.AttributeValue) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) }() } -func com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input types.ProjectionType) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -10378,52 +10456,39 @@ func com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input types.Projec } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ProjectionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ProjectionType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) }() } -func com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(input *types.ContinuousBackupsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ContinuousBackupsDescription_.Create_ContinuousBackupsDescription_(com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input.ContinuousBackupsStatus), com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input.PointInTimeRecoveryDescription))) - }() -} - -func com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexSettingsDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription { - return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexSettingsDescription_.Create_ReplicaGlobalSecondaryIndexSettingsDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_ToDafny(input.ProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_ToDafny(input.ProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettings)) - }() -} - -func com_amazonaws_dynamodb_Put_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) }() } -func com_amazonaws_dynamodb_Replica_RegionName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -10432,25 +10497,27 @@ func com_amazonaws_dynamodb_Replica_RegionName_ToDafny(input *string) Wrappers.O }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GetItemInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() @@ -10461,44 +10528,63 @@ func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_ToDafny(input ma }() } -func com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndexInfo) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_LocalSecondaryIndexes_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_ToDafny(input []types.TransactWriteItem) dafny.Sequence { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_TransactWriteItemList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_ToDafny(input *types.UpdateKinesisStreamingConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingConfiguration_.Create_UpdateKinesisStreamingConfiguration_(com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) }() } -func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input types.ImportStatus) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -10508,94 +10594,89 @@ func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input ty } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ImportStatus)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) }() } -func com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) - }() -} - -func com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_ToDafny(input int64) int64 { - return func() int64 { - - return input + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Put_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) }() } -func com_amazonaws_dynamodb_GetItemInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_ToDafny(input *types.UpdateKinesisStreamingConfiguration) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_ToDafny(input map[string][]types.WriteRequest) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(val)) - } - return fieldValue.ToMap() + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingConfiguration_.Create_UpdateKinesisStreamingConfiguration_(com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableInput_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -10605,45 +10686,57 @@ func com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_ToDafny(i } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) }() } -func com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_ToDafny(input []types.GlobalSecondaryIndexUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(input *types.TableAutoScalingDescription) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_ToDafny(input types.GlobalSecondaryIndexUpdate) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexUpdate_.Create_GlobalSecondaryIndexUpdate_(com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_ToDafny(input.Update), com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_ToDafny(input.Delete)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_ToDafny(input *types.UpdateGlobalSecondaryIndexAction) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableAutoScalingDescription_.Create_TableAutoScalingDescription_(com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input.Replicas))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateGlobalSecondaryIndexAction_.Create_UpdateGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) }() } -func com_amazonaws_dynamodb_CreateTableInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -10652,219 +10745,234 @@ func com_amazonaws_dynamodb_CreateTableInput_TableName_ToDafny(input *string) da }() } -func com_amazonaws_dynamodb_PartiQLBatchResponse_member_ToDafny(input types.BatchStatementResponse) ComAmazonawsDynamodbTypes.BatchStatementResponse { - return func() ComAmazonawsDynamodbTypes.BatchStatementResponse { - - return ComAmazonawsDynamodbTypes.Companion_BatchStatementResponse_.Create_BatchStatementResponse_(com_amazonaws_dynamodb_BatchStatementResponse_Error_ToDafny(input.Error), com_amazonaws_dynamodb_BatchStatementResponse_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_BatchStatementResponse_Item_ToDafny(input.Item)) +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_ToDafny(input *types.TableCreationParameters) ComAmazonawsDynamodbTypes.TableCreationParameters { - return func() ComAmazonawsDynamodbTypes.TableCreationParameters { +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.TableCreationParameters{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_TableCreationParameters_.Create_TableCreationParameters_(com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input.SSESpecification), com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_ToDafny(input *types.CreateGlobalSecondaryIndexAction) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateGlobalSecondaryIndexAction_.Create_CreateGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) }() } -func com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { - return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ImportSummary_TableArn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_dynamodb_TableNotFoundException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { + return func() ComAmazonawsDynamodbTypes.Projection { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return ComAmazonawsDynamodbTypes.Projection{} } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_ToDafny(input *types.TimeToLiveDescription) Wrappers.Option { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveDescription_.Create_TimeToLiveDescription_(com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input.TimeToLiveStatus), com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input.AttributeName))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) }() } -func com_amazonaws_dynamodb_PutItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_ToDafny(input *types.DeleteGlobalSecondaryIndexAction) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteGlobalSecondaryIndexAction_.Create_DeleteGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName))) }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_ToDafny(input *types.BillingModeSummary) Wrappers.Option { +func com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BillingModeSummary_.Create_BillingModeSummary_(com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input.LastUpdateToPayPerRequestDateTime))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) }() } -func com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input map[string]types.Capacity) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + }() +} - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(key), com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(val)) +func com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_ToDafny(input []types.ReplicationGroupUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_ToDafny(input types.ReplicationGroupUpdate) ComAmazonawsDynamodbTypes.ReplicationGroupUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicationGroupUpdate { - return dafny.SeqOfChars([]dafny.Char(input)...) + return ComAmazonawsDynamodbTypes.Companion_ReplicationGroupUpdate_.Create_ReplicationGroupUpdate_(com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_ToDafny(input.Update), com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_ToDafny(input.Delete)) }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_ToDafny(input *types.CreateReplicationGroupMemberAction) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateReplicationGroupMemberAction_.Create_CreateReplicationGroupMemberAction_(com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_ToDafny(input.TableClassOverride))) }() } -func com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) }() } -func com_amazonaws_dynamodb_InvalidEndpointException_Message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) }() } -func com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndex) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_ToDafny(input types.PointInTimeRecoveryStatus) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(input types.ReplicaGlobalSecondaryIndex) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndex_.Create_ReplicaGlobalSecondaryIndex_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_PointInTimeRecoveryStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) }() } -func com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_ToDafny(input *bool) bool { - return func() bool { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return false + return Wrappers.Companion_Option_.Create_None_() } - return *input + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_ToDafny(input types.TableClass) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -10874,29 +10982,27 @@ func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsS } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) }() } -func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_ToDafny(input *types.UpdateReplicationGroupMemberAction) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateReplicationGroupMemberAction_.Create_UpdateReplicationGroupMemberAction_(com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_ToDafny(input.TableClassOverride))) }() } -func com_amazonaws_dynamodb_DeleteItemInput_TableName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -10905,69 +11011,48 @@ func com_amazonaws_dynamodb_DeleteItemInput_TableName_ToDafny(input *string) daf }() } -func com_amazonaws_dynamodb_WriteRequest_DeleteRequest_ToDafny(input *types.DeleteRequest) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteRequest_.Create_DeleteRequest_(com_amazonaws_dynamodb_DeleteRequest_Key_ToDafny(input.Key))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) ComAmazonawsDynamodbTypes.ProvisionedThroughput { - return func() ComAmazonawsDynamodbTypes.ProvisionedThroughput { - if input == nil { - return ComAmazonawsDynamodbTypes.ProvisionedThroughput{} - } - return ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits)) - }() -} - -func com_amazonaws_dynamodb_TransactWriteItemList_member_ToDafny(input types.TransactWriteItem) ComAmazonawsDynamodbTypes.TransactWriteItem { - return func() ComAmazonawsDynamodbTypes.TransactWriteItem { - - return ComAmazonawsDynamodbTypes.Companion_TransactWriteItem_.Create_TransactWriteItem_(com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_ToDafny(input.ConditionCheck), com_amazonaws_dynamodb_TransactWriteItem_Put_ToDafny(input.Put), com_amazonaws_dynamodb_TransactWriteItem_Delete_ToDafny(input.Delete), com_amazonaws_dynamodb_TransactWriteItem_Update_ToDafny(input.Update)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) }() } -func com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_ToDafny(input []types.ParameterizedStatement) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ParameterizedStatements_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(fieldValue...) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) }() } -func com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndex) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_CreateTableInput_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_ToDafny(input types.TableClass) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -10977,21 +11062,32 @@ func com_amazonaws_dynamodb_CreateTableInput_BillingMode_ToDafny(input types.Bil } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) }() } -func com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_ToDafny(input types.KinesisDataStreamDestination) ComAmazonawsDynamodbTypes.KinesisDataStreamDestination { - return func() ComAmazonawsDynamodbTypes.KinesisDataStreamDestination { +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_ToDafny(input *types.DeleteReplicationGroupMemberAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteReplicationGroupMemberAction_.Create_DeleteReplicationGroupMemberAction_(com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName))) + }() +} - return ComAmazonawsDynamodbTypes.Companion_KinesisDataStreamDestination_.Create_KinesisDataStreamDestination_(com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_ToDafny(input.StreamArn), com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_ToDafny(input.DestinationStatus), com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_ToDafny(input.DestinationStatusDescription), com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision)) +func com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } @@ -11012,11 +11108,59 @@ func com_amazonaws_dynamodb_UpdateTableInput_TableClass_ToDafny(input types.Tabl break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_ToDafny(input []types.GlobalSecondaryIndexAutoScalingUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(input types.GlobalSecondaryIndexAutoScalingUpdate) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexAutoScalingUpdate_.Create_GlobalSecondaryIndexAutoScalingUpdate_(com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input.ProvisionedWriteCapacityAutoScalingUpdate)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11025,259 +11169,204 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_ToDafny(inp }() } -func com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(input *types.ContinuousBackupsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ContinuousBackupsDescription_.Create_ContinuousBackupsDescription_(com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input.ContinuousBackupsStatus), com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input.PointInTimeRecoveryDescription))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_ToDafny(input []types.ReplicaGlobalSecondaryIndexSettingsUpdate) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_ToDafny(input *types.ExportDescription) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ExportDescription_.Create_ExportDescription_(com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input.ExportManifest), com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input.ExportTime), com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input.S3Prefix), com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input.S3SseAlgorithm), com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input.S3SseKmsKeyId), com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input.FailureMessage), com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input.ExportFormat), com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input.BilledSizeBytes), com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input.ExportType), com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input.IncrementalExportSpecification))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) }() } -func com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input []types.ReplicaAutoScalingDescription) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_ToDafny(input []types.ReplicaAutoScalingUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input *types.Capacity) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_ToDafny(input types.ReplicaAutoScalingUpdate) ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaAutoScalingUpdate_.Create_ReplicaAutoScalingUpdate_(com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_ToDafny(input.ReplicaGlobalSecondaryIndexUpdates), com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingUpdate)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Capacity_.Create_Capacity_(com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input.CapacityUnits))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_GetItemInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_ToDafny(input []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_ScanInput_Select_ToDafny(input types.Select) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexAutoScalingUpdate_.Create_ReplicaGlobalSecondaryIndexAutoScalingUpdate_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_ToDafny(input.ProvisionedReadCapacityAutoScalingUpdate)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.Select)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TransactWriteItem_Delete_ToDafny(input *types.Delete) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Delete_.Create_Delete_(com_amazonaws_dynamodb_Delete_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Delete_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Delete_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) }() } -func com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(input *types.TableAutoScalingDescription) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableAutoScalingDescription_.Create_TableAutoScalingDescription_(com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input.Replicas))) }() } -func com_amazonaws_dynamodb_BatchGetResponseMap_value_ToDafny(input []map[string]types.AttributeValue) dafny.Sequence { +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { - return func() ComAmazonawsDynamodbTypes.AttributeValue { - switch input.(type) { - case *types.AttributeValueMemberS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberN: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberB: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberSS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberBS: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberM: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) - case *types.AttributeValueMemberL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) - case *types.AttributeValueMemberNULL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) - case *types.AttributeValueMemberBOOL: - var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) - return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) - - default: - panic("Unhandled union type") +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_ToDafny(input *types.TimeToLiveSpecification) ComAmazonawsDynamodbTypes.TimeToLiveSpecification { + return func() ComAmazonawsDynamodbTypes.TimeToLiveSpecification { + if input == nil { + return ComAmazonawsDynamodbTypes.TimeToLiveSpecification{} } + return ComAmazonawsDynamodbTypes.Companion_TimeToLiveSpecification_.Create_TimeToLiveSpecification_(com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input.AttributeName)) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input *bool) bool { + return func() bool { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return false } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + return *input }() } -func com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_ToDafny(input map[string]types.KeysAndAttributes) dafny.Map { - return func() dafny.Map { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(val)) +func com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return fieldValue.ToMap() + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_dynamodb_ScanInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_ToDafny(input *types.TimeToLiveSpecification) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveSpecification_.Create_TimeToLiveSpecification_(com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input.AttributeName))) }() } -func com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_dynamodb_BackupInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_ToDafny(input *types.SSESpecification) Wrappers.Option { +func com_amazonaws_dynamodb_BackupNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) - }() -} - -func com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_ToDafny(input types.ItemCollectionMetrics) ComAmazonawsDynamodbTypes.ItemCollectionMetrics { - return func() ComAmazonawsDynamodbTypes.ItemCollectionMetrics { - - return ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_ToDafny(input *types.PointInTimeRecoverySpecification) ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification { - return func() ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification { +func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification{} + return Wrappers.Companion_Option_.Create_None_() } - return ComAmazonawsDynamodbTypes.Companion_PointInTimeRecoverySpecification_.Create_PointInTimeRecoverySpecification_(com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_ToDafny(input.PointInTimeRecoveryEnabled)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { +func com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11286,111 +11375,79 @@ func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_ToDafny(input *st }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_dynamodb_DuplicateItemException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_ExportConflictException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_MapAttributeValue_key_ToDafny(key), com_amazonaws_dynamodb_MapAttributeValue_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) - }() -} - -func com_amazonaws_dynamodb_Put_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input string) Wrappers.Option { +func com_amazonaws_dynamodb_ExportNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) - }() -} - -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_ToDafny(input *float64) dafny.Sequence { - return func() dafny.Sequence { if input == nil { - return dafny.SeqOf() - } - var bits = math.Float64bits(*input) - var bytes = make([]byte, 8) - binary.LittleEndian.PutUint64(bytes, bits) - var v []interface{} - for _, e := range bytes { - v = append(v, e) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input []types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_ListAttributeValue_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input [][]byte) Wrappers.Option { +func com_amazonaws_dynamodb_GlobalTableNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_dynamodb_BinarySetAttributeValue_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_ToDafny(input types.AutoScalingPolicyDescription) ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription { - return func() ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription { - - return ComAmazonawsDynamodbTypes.Companion_AutoScalingPolicyDescription_.Create_AutoScalingPolicyDescription_(com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_ToDafny(input.PolicyName), com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_ToDafny(input.TargetTrackingScalingPolicyConfiguration)) +func com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ScanInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_ImportConflictException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input string) Wrappers.Option { +func com_amazonaws_dynamodb_ImportNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_CsvOptions_Delimiter_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_IndexNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11399,53 +11456,43 @@ func com_amazonaws_dynamodb_CsvOptions_Delimiter_ToDafny(input *string) Wrappers }() } -func com_amazonaws_dynamodb_NonKeyAttributeNameList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_dynamodb_InternalServerError_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { +func com_amazonaws_dynamodb_InvalidEndpointException_Message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input types.SSEType) Wrappers.Option { +func com_amazonaws_dynamodb_InvalidExportTimeException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_InvalidRestoreTimeException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11454,34 +11501,34 @@ func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_dynamodb_LimitExceededException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ScanInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_PolicyNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TransactionInProgressException_Message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11490,55 +11537,43 @@ func com_amazonaws_dynamodb_TransactionInProgressException_Message_ToDafny(input }() } -func com_amazonaws_dynamodb_ListBackupsInput_BackupType_ToDafny(input types.BackupTypeFilter) Wrappers.Option { +func com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupTypeFilter_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupTypeFilter)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_dynamodb_ReplicaNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_Get_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_dynamodb_RequestLimitExceeded_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ReplicaUpdateList_member_ToDafny(input types.ReplicaUpdate) ComAmazonawsDynamodbTypes.ReplicaUpdate { - return func() ComAmazonawsDynamodbTypes.ReplicaUpdate { - - return ComAmazonawsDynamodbTypes.Companion_ReplicaUpdate_.Create_ReplicaUpdate_(com_amazonaws_dynamodb_ReplicaUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_ReplicaUpdate_Delete_ToDafny(input.Delete)) +func com_amazonaws_dynamodb_ResourceInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_ResourceNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11547,7 +11582,7 @@ func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input *s }() } -func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TableAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11556,49 +11591,25 @@ func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_ToDafny(inpu }() } -func com_amazonaws_dynamodb_ImportSummary_InputFormat_ToDafny(input types.InputFormat) Wrappers.Option { +func com_amazonaws_dynamodb_TableInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputFormat)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_ScanInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { +func com_amazonaws_dynamodb_TableNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_TransactionCanceledException_Message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11607,39 +11618,39 @@ func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_ToDafny(input *strin }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { +func com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_ToDafny(input []types.CancellationReason) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + element := com_amazonaws_dynamodb_CancellationReasonList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) +func com_amazonaws_dynamodb_CancellationReasonList_member_ToDafny(input types.CancellationReason) ComAmazonawsDynamodbTypes.CancellationReason { + return func() ComAmazonawsDynamodbTypes.CancellationReason { + + return ComAmazonawsDynamodbTypes.Companion_CancellationReason_.Create_CancellationReason_(com_amazonaws_dynamodb_CancellationReason_Item_ToDafny(input.Item), com_amazonaws_dynamodb_CancellationReason_Code_ToDafny(input.Code), com_amazonaws_dynamodb_CancellationReason_Message_ToDafny(input.Message)) }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_dynamodb_CancellationReason_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_dynamodb_TableInUseException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_dynamodb_CancellationReason_Code_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -11648,40 +11659,29 @@ func com_amazonaws_dynamodb_TableInUseException_message_ToDafny(input *string) W }() } -func com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { - return func() ComAmazonawsDynamodbTypes.Projection { - if input == nil { - return ComAmazonawsDynamodbTypes.Projection{} - } - return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) - }() -} - -func com_amazonaws_dynamodb_CancellationReason_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { +func com_amazonaws_dynamodb_CancellationReason_Message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_TransactionConflictException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { +func com_amazonaws_dynamodb_TransactionInProgressException_Message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } diff --git a/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go b/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go index 21d4d3399..82ca6b9f1 100644 --- a/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go +++ b/ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go @@ -1478,302 +1478,302 @@ func UpdateTimeToLiveOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Upda } -func GlobalTableAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.GlobalTableAlreadyExistsException { - return func() types.GlobalTableAlreadyExistsException { +func BackupInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.BackupInUseException { + return func() types.BackupInUseException { - return types.GlobalTableAlreadyExistsException{ - Message: com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.BackupInUseException{ + Message: com_amazonaws_dynamodb_BackupInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InternalServerError_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InternalServerError { - return func() types.InternalServerError { +func BackupNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.BackupNotFoundException { + return func() types.BackupNotFoundException { - return types.InternalServerError{ - Message: com_amazonaws_dynamodb_InternalServerError_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.BackupNotFoundException{ + Message: com_amazonaws_dynamodb_BackupNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func IdempotentParameterMismatchException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.IdempotentParameterMismatchException { - return func() types.IdempotentParameterMismatchException { +func ConditionalCheckFailedException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ConditionalCheckFailedException { + return func() types.ConditionalCheckFailedException { - return types.IdempotentParameterMismatchException{ - Message: com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), + return types.ConditionalCheckFailedException{ + Message: com_amazonaws_dynamodb_ConditionalCheckFailedException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + Item: com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_FromDafny(dafnyOutput.Dtor_Item().UnwrapOr(nil)), } }() } -func TransactionInProgressException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TransactionInProgressException { - return func() types.TransactionInProgressException { +func ContinuousBackupsUnavailableException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ContinuousBackupsUnavailableException { + return func() types.ContinuousBackupsUnavailableException { - return types.TransactionInProgressException{ - Message: com_amazonaws_dynamodb_TransactionInProgressException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), + return types.ContinuousBackupsUnavailableException{ + Message: com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidRestoreTimeException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidRestoreTimeException { - return func() types.InvalidRestoreTimeException { +func DuplicateItemException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.DuplicateItemException { + return func() types.DuplicateItemException { - return types.InvalidRestoreTimeException{ - Message: com_amazonaws_dynamodb_InvalidRestoreTimeException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.DuplicateItemException{ + Message: com_amazonaws_dynamodb_DuplicateItemException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ImportNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ImportNotFoundException { - return func() types.ImportNotFoundException { +func ExportConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ExportConflictException { + return func() types.ExportConflictException { - return types.ImportNotFoundException{ - Message: com_amazonaws_dynamodb_ImportNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ExportConflictException{ + Message: com_amazonaws_dynamodb_ExportConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func BackupNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.BackupNotFoundException { - return func() types.BackupNotFoundException { +func ExportNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ExportNotFoundException { + return func() types.ExportNotFoundException { - return types.BackupNotFoundException{ - Message: com_amazonaws_dynamodb_BackupNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ExportNotFoundException{ + Message: com_amazonaws_dynamodb_ExportNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ProvisionedThroughputExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ProvisionedThroughputExceededException { - return func() types.ProvisionedThroughputExceededException { +func GlobalTableAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.GlobalTableAlreadyExistsException { + return func() types.GlobalTableAlreadyExistsException { - return types.ProvisionedThroughputExceededException{ - Message: com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.GlobalTableAlreadyExistsException{ + Message: com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidEndpointException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidEndpointException { - return func() types.InvalidEndpointException { +func GlobalTableNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.GlobalTableNotFoundException { + return func() types.GlobalTableNotFoundException { - return types.InvalidEndpointException{ - Message: com_amazonaws_dynamodb_InvalidEndpointException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), + return types.GlobalTableNotFoundException{ + Message: com_amazonaws_dynamodb_GlobalTableNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ImportConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ImportConflictException { - return func() types.ImportConflictException { +func IdempotentParameterMismatchException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.IdempotentParameterMismatchException { + return func() types.IdempotentParameterMismatchException { - return types.ImportConflictException{ - Message: com_amazonaws_dynamodb_ImportConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.IdempotentParameterMismatchException{ + Message: com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), } }() } -func ContinuousBackupsUnavailableException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ContinuousBackupsUnavailableException { - return func() types.ContinuousBackupsUnavailableException { +func ImportConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ImportConflictException { + return func() types.ImportConflictException { - return types.ContinuousBackupsUnavailableException{ - Message: com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ImportConflictException{ + Message: com_amazonaws_dynamodb_ImportConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ReplicaAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ReplicaAlreadyExistsException { - return func() types.ReplicaAlreadyExistsException { +func ImportNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ImportNotFoundException { + return func() types.ImportNotFoundException { - return types.ReplicaAlreadyExistsException{ - Message: com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ImportNotFoundException{ + Message: com_amazonaws_dynamodb_ImportNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func PolicyNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.PolicyNotFoundException { - return func() types.PolicyNotFoundException { +func IndexNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.IndexNotFoundException { + return func() types.IndexNotFoundException { - return types.PolicyNotFoundException{ - Message: com_amazonaws_dynamodb_PolicyNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.IndexNotFoundException{ + Message: com_amazonaws_dynamodb_IndexNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func TableNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableNotFoundException { - return func() types.TableNotFoundException { +func InternalServerError_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InternalServerError { + return func() types.InternalServerError { - return types.TableNotFoundException{ - Message: com_amazonaws_dynamodb_TableNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InternalServerError{ + Message: com_amazonaws_dynamodb_InternalServerError_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func PointInTimeRecoveryUnavailableException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.PointInTimeRecoveryUnavailableException { - return func() types.PointInTimeRecoveryUnavailableException { +func InvalidEndpointException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidEndpointException { + return func() types.InvalidEndpointException { - return types.PointInTimeRecoveryUnavailableException{ - Message: com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidEndpointException{ + Message: com_amazonaws_dynamodb_InvalidEndpointException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), } }() } -func ExportNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ExportNotFoundException { - return func() types.ExportNotFoundException { +func InvalidExportTimeException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidExportTimeException { + return func() types.InvalidExportTimeException { - return types.ExportNotFoundException{ - Message: com_amazonaws_dynamodb_ExportNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidExportTimeException{ + Message: com_amazonaws_dynamodb_InvalidExportTimeException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func RequestLimitExceeded_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.RequestLimitExceeded { - return func() types.RequestLimitExceeded { +func InvalidRestoreTimeException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidRestoreTimeException { + return func() types.InvalidRestoreTimeException { - return types.RequestLimitExceeded{ - Message: com_amazonaws_dynamodb_RequestLimitExceeded_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidRestoreTimeException{ + Message: com_amazonaws_dynamodb_InvalidRestoreTimeException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ResourceNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ResourceNotFoundException { - return func() types.ResourceNotFoundException { +func ItemCollectionSizeLimitExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ItemCollectionSizeLimitExceededException { + return func() types.ItemCollectionSizeLimitExceededException { - return types.ResourceNotFoundException{ - Message: com_amazonaws_dynamodb_ResourceNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ItemCollectionSizeLimitExceededException{ + Message: com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func BackupInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.BackupInUseException { - return func() types.BackupInUseException { +func LimitExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.LimitExceededException { + return func() types.LimitExceededException { - return types.BackupInUseException{ - Message: com_amazonaws_dynamodb_BackupInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.LimitExceededException{ + Message: com_amazonaws_dynamodb_LimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ConditionalCheckFailedException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ConditionalCheckFailedException { - return func() types.ConditionalCheckFailedException { +func PointInTimeRecoveryUnavailableException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.PointInTimeRecoveryUnavailableException { + return func() types.PointInTimeRecoveryUnavailableException { - return types.ConditionalCheckFailedException{ - Message: com_amazonaws_dynamodb_ConditionalCheckFailedException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), - Item: com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_FromDafny(dafnyOutput.Dtor_Item().UnwrapOr(nil)), + return types.PointInTimeRecoveryUnavailableException{ + Message: com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func IndexNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.IndexNotFoundException { - return func() types.IndexNotFoundException { +func PolicyNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.PolicyNotFoundException { + return func() types.PolicyNotFoundException { - return types.IndexNotFoundException{ - Message: com_amazonaws_dynamodb_IndexNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.PolicyNotFoundException{ + Message: com_amazonaws_dynamodb_PolicyNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ResourceInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ResourceInUseException { - return func() types.ResourceInUseException { +func ProvisionedThroughputExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ProvisionedThroughputExceededException { + return func() types.ProvisionedThroughputExceededException { - return types.ResourceInUseException{ - Message: com_amazonaws_dynamodb_ResourceInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ProvisionedThroughputExceededException{ + Message: com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ItemCollectionSizeLimitExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ItemCollectionSizeLimitExceededException { - return func() types.ItemCollectionSizeLimitExceededException { +func ReplicaAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ReplicaAlreadyExistsException { + return func() types.ReplicaAlreadyExistsException { - return types.ItemCollectionSizeLimitExceededException{ - Message: com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ReplicaAlreadyExistsException{ + Message: com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func TableInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableInUseException { - return func() types.TableInUseException { +func ReplicaNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ReplicaNotFoundException { + return func() types.ReplicaNotFoundException { - return types.TableInUseException{ - Message: com_amazonaws_dynamodb_TableInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ReplicaNotFoundException{ + Message: com_amazonaws_dynamodb_ReplicaNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ReplicaNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ReplicaNotFoundException { - return func() types.ReplicaNotFoundException { +func RequestLimitExceeded_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.RequestLimitExceeded { + return func() types.RequestLimitExceeded { - return types.ReplicaNotFoundException{ - Message: com_amazonaws_dynamodb_ReplicaNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.RequestLimitExceeded{ + Message: com_amazonaws_dynamodb_RequestLimitExceeded_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func DuplicateItemException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.DuplicateItemException { - return func() types.DuplicateItemException { +func ResourceInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ResourceInUseException { + return func() types.ResourceInUseException { - return types.DuplicateItemException{ - Message: com_amazonaws_dynamodb_DuplicateItemException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ResourceInUseException{ + Message: com_amazonaws_dynamodb_ResourceInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func LimitExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.LimitExceededException { - return func() types.LimitExceededException { +func ResourceNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ResourceNotFoundException { + return func() types.ResourceNotFoundException { - return types.LimitExceededException{ - Message: com_amazonaws_dynamodb_LimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ResourceNotFoundException{ + Message: com_amazonaws_dynamodb_ResourceNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func TransactionConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TransactionConflictException { - return func() types.TransactionConflictException { +func TableAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableAlreadyExistsException { + return func() types.TableAlreadyExistsException { - return types.TransactionConflictException{ - Message: com_amazonaws_dynamodb_TransactionConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.TableAlreadyExistsException{ + Message: com_amazonaws_dynamodb_TableAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func GlobalTableNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.GlobalTableNotFoundException { - return func() types.GlobalTableNotFoundException { +func TableInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableInUseException { + return func() types.TableInUseException { - return types.GlobalTableNotFoundException{ - Message: com_amazonaws_dynamodb_GlobalTableNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.TableInUseException{ + Message: com_amazonaws_dynamodb_TableInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ExportConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ExportConflictException { - return func() types.ExportConflictException { +func TableNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableNotFoundException { + return func() types.TableNotFoundException { - return types.ExportConflictException{ - Message: com_amazonaws_dynamodb_ExportConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.TableNotFoundException{ + Message: com_amazonaws_dynamodb_TableNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() @@ -1790,21 +1790,21 @@ func TransactionCanceledException_FromDafny(dafnyOutput ComAmazonawsDynamodbType } -func InvalidExportTimeException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidExportTimeException { - return func() types.InvalidExportTimeException { +func TransactionConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TransactionConflictException { + return func() types.TransactionConflictException { - return types.InvalidExportTimeException{ - Message: com_amazonaws_dynamodb_InvalidExportTimeException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.TransactionConflictException{ + Message: com_amazonaws_dynamodb_TransactionConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func TableAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableAlreadyExistsException { - return func() types.TableAlreadyExistsException { +func TransactionInProgressException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TransactionInProgressException { + return func() types.TransactionInProgressException { - return types.TableAlreadyExistsException{ - Message: com_amazonaws_dynamodb_TableAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.TransactionInProgressException{ + Message: com_amazonaws_dynamodb_TransactionInProgressException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), } }() @@ -1824,153 +1824,153 @@ func OpaqueError_Output_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) e func Error_FromDafny(err ComAmazonawsDynamodbTypes.Error) error { // Service Errors - if err.Is_GlobalTableAlreadyExistsException() { - e := GlobalTableAlreadyExistsException_FromDafny(err) + if err.Is_BackupInUseException() { + e := BackupInUseException_FromDafny(err) return &e } - if err.Is_InternalServerError() { - e := InternalServerError_FromDafny(err) + if err.Is_BackupNotFoundException() { + e := BackupNotFoundException_FromDafny(err) return &e } - if err.Is_IdempotentParameterMismatchException() { - e := IdempotentParameterMismatchException_FromDafny(err) + if err.Is_ConditionalCheckFailedException() { + e := ConditionalCheckFailedException_FromDafny(err) return &e } - if err.Is_TransactionInProgressException() { - e := TransactionInProgressException_FromDafny(err) + if err.Is_ContinuousBackupsUnavailableException() { + e := ContinuousBackupsUnavailableException_FromDafny(err) return &e } - if err.Is_InvalidRestoreTimeException() { - e := InvalidRestoreTimeException_FromDafny(err) + if err.Is_DuplicateItemException() { + e := DuplicateItemException_FromDafny(err) return &e } - if err.Is_ImportNotFoundException() { - e := ImportNotFoundException_FromDafny(err) + if err.Is_ExportConflictException() { + e := ExportConflictException_FromDafny(err) return &e } - if err.Is_BackupNotFoundException() { - e := BackupNotFoundException_FromDafny(err) + if err.Is_ExportNotFoundException() { + e := ExportNotFoundException_FromDafny(err) return &e } - if err.Is_ProvisionedThroughputExceededException() { - e := ProvisionedThroughputExceededException_FromDafny(err) + if err.Is_GlobalTableAlreadyExistsException() { + e := GlobalTableAlreadyExistsException_FromDafny(err) return &e } - if err.Is_InvalidEndpointException() { - e := InvalidEndpointException_FromDafny(err) + if err.Is_GlobalTableNotFoundException() { + e := GlobalTableNotFoundException_FromDafny(err) return &e } - if err.Is_ImportConflictException() { - e := ImportConflictException_FromDafny(err) + if err.Is_IdempotentParameterMismatchException() { + e := IdempotentParameterMismatchException_FromDafny(err) return &e } - if err.Is_ContinuousBackupsUnavailableException() { - e := ContinuousBackupsUnavailableException_FromDafny(err) + if err.Is_ImportConflictException() { + e := ImportConflictException_FromDafny(err) return &e } - if err.Is_ReplicaAlreadyExistsException() { - e := ReplicaAlreadyExistsException_FromDafny(err) + if err.Is_ImportNotFoundException() { + e := ImportNotFoundException_FromDafny(err) return &e } - if err.Is_PolicyNotFoundException() { - e := PolicyNotFoundException_FromDafny(err) + if err.Is_IndexNotFoundException() { + e := IndexNotFoundException_FromDafny(err) return &e } - if err.Is_TableNotFoundException() { - e := TableNotFoundException_FromDafny(err) + if err.Is_InternalServerError() { + e := InternalServerError_FromDafny(err) return &e } - if err.Is_PointInTimeRecoveryUnavailableException() { - e := PointInTimeRecoveryUnavailableException_FromDafny(err) + if err.Is_InvalidEndpointException() { + e := InvalidEndpointException_FromDafny(err) return &e } - if err.Is_ExportNotFoundException() { - e := ExportNotFoundException_FromDafny(err) + if err.Is_InvalidExportTimeException() { + e := InvalidExportTimeException_FromDafny(err) return &e } - if err.Is_RequestLimitExceeded() { - e := RequestLimitExceeded_FromDafny(err) + if err.Is_InvalidRestoreTimeException() { + e := InvalidRestoreTimeException_FromDafny(err) return &e } - if err.Is_ResourceNotFoundException() { - e := ResourceNotFoundException_FromDafny(err) + if err.Is_ItemCollectionSizeLimitExceededException() { + e := ItemCollectionSizeLimitExceededException_FromDafny(err) return &e } - if err.Is_BackupInUseException() { - e := BackupInUseException_FromDafny(err) + if err.Is_LimitExceededException() { + e := LimitExceededException_FromDafny(err) return &e } - if err.Is_ConditionalCheckFailedException() { - e := ConditionalCheckFailedException_FromDafny(err) + if err.Is_PointInTimeRecoveryUnavailableException() { + e := PointInTimeRecoveryUnavailableException_FromDafny(err) return &e } - if err.Is_IndexNotFoundException() { - e := IndexNotFoundException_FromDafny(err) + if err.Is_PolicyNotFoundException() { + e := PolicyNotFoundException_FromDafny(err) return &e } - if err.Is_ResourceInUseException() { - e := ResourceInUseException_FromDafny(err) + if err.Is_ProvisionedThroughputExceededException() { + e := ProvisionedThroughputExceededException_FromDafny(err) return &e } - if err.Is_ItemCollectionSizeLimitExceededException() { - e := ItemCollectionSizeLimitExceededException_FromDafny(err) + if err.Is_ReplicaAlreadyExistsException() { + e := ReplicaAlreadyExistsException_FromDafny(err) return &e } - if err.Is_TableInUseException() { - e := TableInUseException_FromDafny(err) + if err.Is_ReplicaNotFoundException() { + e := ReplicaNotFoundException_FromDafny(err) return &e } - if err.Is_ReplicaNotFoundException() { - e := ReplicaNotFoundException_FromDafny(err) + if err.Is_RequestLimitExceeded() { + e := RequestLimitExceeded_FromDafny(err) return &e } - if err.Is_DuplicateItemException() { - e := DuplicateItemException_FromDafny(err) + if err.Is_ResourceInUseException() { + e := ResourceInUseException_FromDafny(err) return &e } - if err.Is_LimitExceededException() { - e := LimitExceededException_FromDafny(err) + if err.Is_ResourceNotFoundException() { + e := ResourceNotFoundException_FromDafny(err) return &e } - if err.Is_TransactionConflictException() { - e := TransactionConflictException_FromDafny(err) + if err.Is_TableAlreadyExistsException() { + e := TableAlreadyExistsException_FromDafny(err) return &e } - if err.Is_GlobalTableNotFoundException() { - e := GlobalTableNotFoundException_FromDafny(err) + if err.Is_TableInUseException() { + e := TableInUseException_FromDafny(err) return &e } - if err.Is_ExportConflictException() { - e := ExportConflictException_FromDafny(err) + if err.Is_TableNotFoundException() { + e := TableNotFoundException_FromDafny(err) return &e } @@ -1979,95 +1979,60 @@ func Error_FromDafny(err ComAmazonawsDynamodbTypes.Error) error { return &e } - if err.Is_InvalidExportTimeException() { - e := InvalidExportTimeException_FromDafny(err) + if err.Is_TransactionConflictException() { + e := TransactionConflictException_FromDafny(err) return &e } - if err.Is_TableAlreadyExistsException() { - e := TableAlreadyExistsException_FromDafny(err) + if err.Is_TransactionInProgressException() { + e := TransactionInProgressException_FromDafny(err) return &e } return OpaqueError_Output_FromDafny(err) } -func com_amazonaws_dynamodb_AttributeUpdates_value_FromDafny(input interface{}) types.AttributeValueUpdate { - return func() types.AttributeValueUpdate { - - return types.AttributeValueUpdate{ - Value: com_amazonaws_dynamodb_AttributeValueUpdate_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeValueUpdate).Dtor_Value().UnwrapOr(nil)), - Action: com_amazonaws_dynamodb_AttributeValueUpdate_Action_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeValueUpdate).Dtor_Action().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input interface{}) types.ExportStatus { - return func() types.ExportStatus { - var u types.ExportStatus - if input == nil { - return u - } +func com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_FromDafny(input interface{}) []types.BatchStatementRequest { + return func() []types.BatchStatementRequest { + var fieldValue []types.BatchStatementRequest - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ExportStatus).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PartiQLBatchRequest_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil +func com_amazonaws_dynamodb_PartiQLBatchRequest_member_FromDafny(input interface{}) types.BatchStatementRequest { + return func() types.BatchStatementRequest { + + return types.BatchStatementRequest{ + Statement: com_amazonaws_dynamodb_BatchStatementRequest_Statement_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_Statement()), + Parameters: com_amazonaws_dynamodb_BatchStatementRequest_Parameters_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_Parameters().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_ConsistentRead().UnwrapOr(nil)), } - i = input.(int64) - return &i }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { - return func() types.ReplicaStatus { - var u types.ReplicaStatus - if input == nil { - return u - } +func com_amazonaws_dynamodb_BatchStatementRequest_Statement_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { - return func() *types.SSESpecification { - if input == nil { - return nil - } - return &types.SSESpecification{ - Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), - SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), - KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), - } }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_FromDafny(input interface{}) []types.GlobalSecondaryIndex { - return func() []types.GlobalSecondaryIndex { - var fieldValue []types.GlobalSecondaryIndex +func com_amazonaws_dynamodb_BatchStatementRequest_Parameters_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue if input == nil { return nil } @@ -2076,336 +2041,435 @@ func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexO if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_FromDafny(input interface{}) types.ContributorInsightsAction { - return func() types.ContributorInsightsAction { - var u types.ContributorInsightsAction +func com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue - inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsAction) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsAction_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsAction).Equals(inputEnum) { - break - } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), } } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } - return fieldValue - }() -} -func com_amazonaws_dynamodb_ScanInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } } - i = input.(int32) - return &i - }() -} -func com_amazonaws_dynamodb_ExportSummaries_member_FromDafny(input interface{}) types.ExportSummary { - return func() types.ExportSummary { - - return types.ExportSummary{ - ExportArn: com_amazonaws_dynamodb_ExportSummary_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportArn().UnwrapOr(nil)), - ExportStatus: com_amazonaws_dynamodb_ExportSummary_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportStatus().UnwrapOr(nil)), - ExportType: com_amazonaws_dynamodb_ExportSummary_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportType().UnwrapOr(nil)), + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } } - }() -} -func com_amazonaws_dynamodb_AttributeDefinition_AttributeType_FromDafny(input interface{}) types.ScalarAttributeType { - return func() types.ScalarAttributeType { - var u types.ScalarAttributeType - - inputEnum := input.(ComAmazonawsDynamodbTypes.ScalarAttributeType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ScalarAttributeType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ScalarAttributeType).Equals(inputEnum) { - break - } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), } } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { - return func() types.ReplicaStatus { - var u types.ReplicaStatus - if input == nil { - return u + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { - break - } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), } } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } } - i = input.(int64) - return &i + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union }() } -func com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input interface{}) types.StreamViewType { - return func() types.StreamViewType { - var u types.StreamViewType +func com_amazonaws_dynamodb_AttributeValue_S_FromDafny(input interface{}) string { + return func() string { + var s string if input == nil { - return u + return s } - - inputEnum := input.(ComAmazonawsDynamodbTypes.StreamViewType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_StreamViewType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.StreamViewType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ParameterizedStatements_member_FromDafny(input interface{}) types.ParameterizedStatement { - return func() types.ParameterizedStatement { - - return types.ParameterizedStatement{ - Statement: com_amazonaws_dynamodb_ParameterizedStatement_Statement_FromDafny(input.(ComAmazonawsDynamodbTypes.ParameterizedStatement).Dtor_Statement()), - Parameters: com_amazonaws_dynamodb_ParameterizedStatement_Parameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ParameterizedStatement).Dtor_Parameters().UnwrapOr(nil)), +func com_amazonaws_dynamodb_AttributeValue_N_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_ExportSummary_ExportType_FromDafny(input interface{}) types.ExportType { - return func() types.ExportType { - var u types.ExportType +func com_amazonaws_dynamodb_AttributeValue_B_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ReplicaUpdate_Create_FromDafny(input interface{}) *types.CreateReplicaAction { - return func() *types.CreateReplicaAction { +func com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - return &types.CreateReplicaAction{ - RegionName: com_amazonaws_dynamodb_CreateReplicaAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicaAction).Dtor_RegionName()), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_StringSetAttributeValue_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_StringSetAttributeValue_member_FromDafny(input interface{}) string { + return func() string { var s string - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_QueryInput_ProjectionExpression_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_NumberSetAttributeValue_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_NumberSetAttributeValue_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input interface{}) types.SSEType { - return func() types.SSEType { - var u types.SSEType +func com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(input interface{}) [][]byte { + return func() [][]byte { + var fieldValue [][]byte if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.SSEType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.SSEType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_BinarySetAttributeValue_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_dynamodb_ResourceNotFoundException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_BinarySetAttributeValue_member_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_AttributeValue_M_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - i = input.(int64) - return &i + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_MapAttributeValue_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_MapAttributeValue_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_FromDafny(input interface{}) *types.IncrementalExportSpecification { - return func() *types.IncrementalExportSpecification { +func com_amazonaws_dynamodb_MapAttributeValue_key_FromDafny(input interface{}) string { + return func() string { + var s string if input == nil { - return nil + return s } - return &types.IncrementalExportSpecification{ - ExportFromTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportFromTime().UnwrapOr(nil)), - ExportToTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportToTime().UnwrapOr(nil)), - ExportViewType: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportViewType().UnwrapOr(nil)), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_QueryInput_KeyConditions_FromDafny(input interface{}) map[string]types.Condition { - return func() map[string]types.Condition { - var m map[string]types.Condition = make(map[string]types.Condition) +func com_amazonaws_dynamodb_MapAttributeValue_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_AttributeValue_L_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_KeyConditions_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_KeyConditions_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ListAttributeValue_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_Put_Item_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_ListAttributeValue_member_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), } - m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union }() } -func com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input interface{}) types.SSEStatus { - return func() types.SSEStatus { - var u types.SSEStatus +func com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return u + return b } - - inputEnum := input.(ComAmazonawsDynamodbTypes.SSEStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.SSEStatus).Equals(inputEnum) { - break - } - } + b = input.(bool) + return b + }() +} +func com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b } - return u.Values()[index] + b = input.(bool) + return b }() } -func com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input interface{}) *types.SourceTableDetails { - return func() *types.SourceTableDetails { +func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - return &types.SourceTableDetails{ - TableName: com_amazonaws_dynamodb_SourceTableDetails_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableName()), - TableId: com_amazonaws_dynamodb_SourceTableDetails_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableId()), - TableArn: com_amazonaws_dynamodb_SourceTableDetails_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableArn().UnwrapOr(nil)), - TableSizeBytes: com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableSizeBytes().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_SourceTableDetails_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_KeySchema()), - TableCreationDateTime: com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableCreationDateTime()), - ProvisionedThroughput: com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_ProvisionedThroughput()), - OnDemandThroughput: com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_OnDemandThroughput().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_SourceTableDetails_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_ItemCount().UnwrapOr(nil)), - BillingMode: com_amazonaws_dynamodb_SourceTableDetails_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_BillingMode().UnwrapOr(nil)), - } + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { +func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { return func() types.ReturnConsumedCapacity { var u types.ReturnConsumedCapacity if input == nil { @@ -2426,31 +2490,65 @@ func com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_FromDaf return u.Values()[index] }() } -func com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input interface{}) int64 { - return func() int64 { - var i int64 +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_FromDafny(input interface{}) []types.BatchStatementResponse { + return func() []types.BatchStatementResponse { + var fieldValue []types.BatchStatementResponse if input == nil { - return i + return nil } - i = input.(int64) - return i - }() -} -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PartiQLBatchResponse_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_PartiQLBatchResponse_member_FromDafny(input interface{}) types.BatchStatementResponse { + return func() types.BatchStatementResponse { + + return types.BatchStatementResponse{ + Error: com_amazonaws_dynamodb_BatchStatementResponse_Error_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_Error().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_BatchStatementResponse_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_TableName().UnwrapOr(nil)), + Item: com_amazonaws_dynamodb_BatchStatementResponse_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_Item().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BatchStatementResponse_Error_FromDafny(input interface{}) *types.BatchStatementError { + return func() *types.BatchStatementError { + if input == nil { + return nil + } + return &types.BatchStatementError{ + Code: com_amazonaws_dynamodb_BatchStatementError_Code_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementError).Dtor_Code().UnwrapOr(nil)), + Message: com_amazonaws_dynamodb_BatchStatementError_Message_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementError).Dtor_Message().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BatchStatementError_Code_FromDafny(input interface{}) types.BatchStatementErrorCodeEnum { + return func() types.BatchStatementErrorCodeEnum { + var u types.BatchStatementErrorCodeEnum + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BatchStatementErrorCodeEnum_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BatchStatementError_Message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2466,7 +2564,7 @@ func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_FromDa } }() } -func com_amazonaws_dynamodb_BackupSummary_TableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_BatchStatementResponse_TableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2482,7 +2580,7 @@ func com_amazonaws_dynamodb_BackupSummary_TableArn_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { +func com_amazonaws_dynamodb_BatchStatementResponse_Item_FromDafny(input interface{}) map[string]types.AttributeValue { return func() map[string]types.AttributeValue { var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { @@ -2494,60 +2592,126 @@ func com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_FromDafny(input interfa if !ok { break } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m }() } -func com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input interface{}) types.BillingMode { - return func() types.BillingMode { - var u types.BillingMode +func com_amazonaws_dynamodb_AttributeMap_key_FromDafny(input interface{}) string { + return func() string { + var s string if input == nil { - return u + return s } - - inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil +func com_amazonaws_dynamodb_AttributeMap_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } } - b = input.(bool) - return &b + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union }() } -func com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input interface{}) *types.TableCreationParameters { - return func() *types.TableCreationParameters { +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity if input == nil { return nil } - return &types.TableCreationParameters{ - TableName: com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_TableName()), - AttributeDefinitions: com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_AttributeDefinitions()), - KeySchema: com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_KeySchema()), - BillingMode: com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_BillingMode().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_OnDemandThroughput().UnwrapOr(nil)), - SSESpecification: com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_SSESpecification().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(input interface{}) types.ConsumedCapacity { + return func() types.ConsumedCapacity { + + return types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2563,275 +2727,189 @@ func com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_FromDafny(input i } }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_FilterConditionMap_key_FromDafny(input interface{}) string { - return func() string { - var s string +func com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input interface{}) *types.Capacity { + return func() *types.Capacity { if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + return &types.Capacity{ + ReadCapacityUnits: com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_CapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input interface{}) types.ExportType { - return func() types.ExportType { - var u types.ExportType +func com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { - break - } - } + return nil } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { - break - } + b = append(b, val.(byte)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { - return func() types.ReturnItemCollectionMetrics { - var u types.ReturnItemCollectionMetrics +func com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input interface{}) map[string]types.Capacity { + return func() map[string]types.Capacity { + var m map[string]types.Capacity = make(map[string]types.Capacity) if input == nil { - return u + return nil } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } + m[com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { - return func() *types.ConsumedCapacity { - if input == nil { - return nil - } - return &types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - } + return m }() } -func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_FromDafny(input interface{}) *types.BackupDetails { - return func() *types.BackupDetails { - if input == nil { - return nil - } - return &types.BackupDetails{ - BackupArn: com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupArn()), - BackupName: com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupName()), - BackupSizeBytes: com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupSizeBytes().UnwrapOr(nil)), - BackupStatus: com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupStatus()), - BackupType: com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupType()), - BackupCreationDateTime: com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupCreationDateTime()), - BackupExpiryDateTime: com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny(input interface{}) types.Capacity { + return func() types.Capacity { + + return types.Capacity{ + ReadCapacityUnits: com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_CapacityUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input interface{}) map[string]types.Capacity { + return func() map[string]types.Capacity { + var m map[string]types.Capacity = make(map[string]types.Capacity) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_FromDafny(input interface{}) types.ReplicaAutoScalingUpdate { - return func() types.ReplicaAutoScalingUpdate { +func com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_FromDafny(input interface{}) map[string]types.KeysAndAttributes { + return func() map[string]types.KeysAndAttributes { + var m map[string]types.KeysAndAttributes = make(map[string]types.KeysAndAttributes) - return types.ReplicaAutoScalingUpdate{ - RegionName: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_RegionName()), - ReplicaGlobalSecondaryIndexUpdates: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_ReplicaGlobalSecondaryIndexUpdates().UnwrapOr(nil)), - ReplicaProvisionedReadCapacityAutoScalingUpdate: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_ReplicaProvisionedReadCapacityAutoScalingUpdate().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { - if input == nil { - return nil - } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { - return func() []types.ConsumedCapacity { - var fieldValue []types.ConsumedCapacity - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + m[com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny(input interface{}) string { +func com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny(input interface{}) string { return func() string { var s string if input == nil { @@ -2847,44 +2925,33 @@ func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny(input in } }() } -func com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input interface{}) *types.ArchivalSummary { - return func() *types.ArchivalSummary { - if input == nil { - return nil - } - return &types.ArchivalSummary{ - ArchivalDateTime: com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalDateTime().UnwrapOr(nil)), - ArchivalReason: com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalReason().UnwrapOr(nil)), - ArchivalBackupArn: com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalBackupArn().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_TagList_member_FromDafny(input interface{}) types.Tag { - return func() types.Tag { +func com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny(input interface{}) types.KeysAndAttributes { + return func() types.KeysAndAttributes { - return types.Tag{ - Key: com_amazonaws_dynamodb_Tag_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Tag).Dtor_Key()), - Value: com_amazonaws_dynamodb_Tag_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.Tag).Dtor_Value()), + return types.KeysAndAttributes{ + Keys: com_amazonaws_dynamodb_KeysAndAttributes_Keys_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_Keys()), + AttributesToGet: com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_AttributesToGet().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ConsistentRead().UnwrapOr(nil)), + ProjectionExpression: com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ProjectionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } +func com_amazonaws_dynamodb_KeysAndAttributes_Keys_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeyList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_Get_Key_FromDafny(input interface{}) map[string]types.AttributeValue { +func com_amazonaws_dynamodb_KeyList_member_FromDafny(input interface{}) map[string]types.AttributeValue { return func() map[string]types.AttributeValue { var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) @@ -2898,96 +2965,107 @@ func com_amazonaws_dynamodb_Get_Key_FromDafny(input interface{}) map[string]type return m }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { - return func() types.ContributorInsightsStatus { - var u types.ContributorInsightsStatus +func com_amazonaws_dynamodb_Key_key_FromDafny(input interface{}) string { + return func() string { + var s string if input == nil { - return u + return s } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil +func com_amazonaws_dynamodb_Key_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), } } - }() -} -func com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_FromDafny(input interface{}) bool { - return func() bool { - var b bool - if input == nil { - return b + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } } - b = input.(bool) - return b - }() -} -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { - return func() *types.ProvisionedThroughputOverride { - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } } - return &types.ProvisionedThroughputOverride{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } } - }() -} -func com_amazonaws_dynamodb_ScanInput_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), } } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union }() } -func com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny(input interface{}) string { +func com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(input interface{}) string { return func() string { var s string @@ -3001,25 +3079,23 @@ func com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny(input int } }() } -func com_amazonaws_dynamodb_DeleteRequest_Key_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) +func com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil } - return m + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -3029,7 +3105,7 @@ func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_FromDafny(inpu } }() } -func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { +func com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { return func() map[string]string { var m map[string]string = make(map[string]string) if input == nil { @@ -3046,270 +3122,371 @@ func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_FromDafny(in return m }() } -func com_amazonaws_dynamodb_ScanInput_FilterExpression_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny(input interface{}) string { + return func() string { var s string - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte +func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BatchGetItemOutput_Responses_FromDafny(input interface{}) map[string][]map[string]types.AttributeValue { + return func() map[string][]map[string]types.AttributeValue { + var m map[string][]map[string]types.AttributeValue = make(map[string][]map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] - } else { - b = append(b, val.(byte)) + break } + m[com_amazonaws_dynamodb_BatchGetResponseMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetResponseMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ListExportsInput_TableArn_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_BatchGetResponseMap_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_BatchGetResponseMap_value_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ListImportsInput_NextToken_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ItemList_member_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_FromDafny(input interface{}) map[string]types.KeysAndAttributes { + return func() map[string]types.KeysAndAttributes { + var m map[string]types.KeysAndAttributes = make(map[string]types.KeysAndAttributes) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_QueryInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { - return func() types.ConditionalOperator { - var u types.ConditionalOperator +func com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_dynamodb_SourceTableDetails_BillingMode_FromDafny(input interface{}) types.BillingMode { - return func() types.BillingMode { - var u types.BillingMode - if input == nil { - return u - } +func com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_FromDafny(input interface{}) map[string][]types.WriteRequest { + return func() map[string][]types.WriteRequest { + var m map[string][]types.WriteRequest = make(map[string][]types.WriteRequest) - inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } + m[com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return u.Values()[index] + return m }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny(input interface{}) []types.WriteRequest { + return func() []types.WriteRequest { + var fieldValue []types.WriteRequest + + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_WriteRequests_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_WriteRequests_member_FromDafny(input interface{}) types.WriteRequest { + return func() types.WriteRequest { + + return types.WriteRequest{ + PutRequest: com_amazonaws_dynamodb_WriteRequest_PutRequest_FromDafny(input.(ComAmazonawsDynamodbTypes.WriteRequest).Dtor_PutRequest().UnwrapOr(nil)), + DeleteRequest: com_amazonaws_dynamodb_WriteRequest_DeleteRequest_FromDafny(input.(ComAmazonawsDynamodbTypes.WriteRequest).Dtor_DeleteRequest().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_WriteRequest_PutRequest_FromDafny(input interface{}) *types.PutRequest { + return func() *types.PutRequest { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + return &types.PutRequest{ + Item: com_amazonaws_dynamodb_PutRequest_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.PutRequest).Dtor_Item()), + } + }() +} +func com_amazonaws_dynamodb_PutRequest_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { - return func() *types.ProvisionedThroughputOverride { - if input == nil { - return nil +func com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } } - return &types.ProvisionedThroughputOverride{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } } - }() -} -func com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), } } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union }() } -func com_amazonaws_dynamodb_ImportSummary_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { - return func() *types.S3BucketSource { +func com_amazonaws_dynamodb_WriteRequest_DeleteRequest_FromDafny(input interface{}) *types.DeleteRequest { + return func() *types.DeleteRequest { if input == nil { return nil } - return &types.S3BucketSource{ - S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), - S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), - S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), + return &types.DeleteRequest{ + Key: com_amazonaws_dynamodb_DeleteRequest_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteRequest).Dtor_Key()), } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_DeleteRequest_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { - return func() types.ReturnValuesOnConditionCheckFailure { - var u types.ReturnValuesOnConditionCheckFailure +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { break } } @@ -3317,353 +3494,115 @@ func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_FromDafny(in return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExportNotFoundException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_FromDafny(input interface{}) map[string][]types.WriteRequest { + return func() map[string][]types.WriteRequest { + var m map[string][]types.WriteRequest = make(map[string][]types.WriteRequest) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { - return func() *types.AutoScalingSettingsDescription { +func com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) map[string][]types.ItemCollectionMetrics { + return func() map[string][]types.ItemCollectionMetrics { + var m map[string][]types.ItemCollectionMetrics = make(map[string][]types.ItemCollectionMetrics) if input == nil { return nil } - return &types.AutoScalingSettingsDescription{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ImportSummary_ImportStatus_FromDafny(input interface{}) types.ImportStatus { - return func() types.ImportStatus { - var u types.ImportStatus - if input == nil { - return u - } - inputEnum := input.(ComAmazonawsDynamodbTypes.ImportStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ImportStatus).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } + m[com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return u.Values()[index] + return m }() } -func com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { - return func() *types.GlobalTableDescription { +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny(input interface{}) string { + return func() string { + var s string if input == nil { - return nil - } - return &types.GlobalTableDescription{ - ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), - GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), - GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), + return s } - }() -} -func com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } - }() -} -func com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(input interface{}) types.AttributeDefinition { - return func() types.AttributeDefinition { - - return types.AttributeDefinition{ - AttributeName: com_amazonaws_dynamodb_AttributeDefinition_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeDefinition).Dtor_AttributeName()), - AttributeType: com_amazonaws_dynamodb_AttributeDefinition_AttributeType_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeDefinition).Dtor_AttributeType()), - } - }() -} -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { - return func() types.ReplicaStatus { - var u types.ReplicaStatus - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_QueryInput_ScanIndexForward_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { - return func() *types.TableDescription { - if input == nil { - return nil - } - return &types.TableDescription{ - AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), - TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), - BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), - LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), - LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), - GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), - RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), - SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), - ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), - TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), - DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_TransactWriteItem_Put_FromDafny(input interface{}) *types.Put { - return func() *types.Put { - if input == nil { - return nil - } - return &types.Put{ - Item: com_amazonaws_dynamodb_Put_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_Item()), - TableName: com_amazonaws_dynamodb_Put_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_TableName()), - ConditionExpression: com_amazonaws_dynamodb_Put_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ConditionExpression().UnwrapOr(nil)), - ExpressionAttributeNames: com_amazonaws_dynamodb_Put_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), - ExpressionAttributeValues: com_amazonaws_dynamodb_Put_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), - ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ExportSummary_ExportStatus_FromDafny(input interface{}) types.ExportStatus { - return func() types.ExportStatus { - var u types.ExportStatus - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ExportStatus).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_FromDafny(input interface{}) types.InputCompressionType { - return func() types.InputCompressionType { - var u types.InputCompressionType - if input == nil { - return u - } +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny(input interface{}) []types.ItemCollectionMetrics { + return func() []types.ItemCollectionMetrics { + var fieldValue []types.ItemCollectionMetrics - inputEnum := input.(ComAmazonawsDynamodbTypes.InputCompressionType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.InputCompressionType).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_ListBackupsInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { - return func() []types.ConsumedCapacity { - var fieldValue []types.ConsumedCapacity - if input == nil { - return nil - } for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_FromDafny(input interface{}) int32 { - return input.(int32) -} -func com_amazonaws_dynamodb_Update_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_FromDafny(input interface{}) types.ItemCollectionMetrics { + return func() types.ItemCollectionMetrics { - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input interface{}) *types.AutoScalingPolicyUpdate { - return func() *types.AutoScalingPolicyUpdate { +func com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - return &types.AutoScalingPolicyUpdate{ - PolicyName: com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyUpdate).Dtor_PolicyName().UnwrapOr(nil)), - TargetTrackingScalingPolicyConfiguration: com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyUpdate).Dtor_TargetTrackingScalingPolicyConfiguration()), - } - }() -} -func com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input interface{}) types.BackupStatus { - return func() types.BackupStatus { - var u types.BackupStatus - - inputEnum := input.(ComAmazonawsDynamodbTypes.BackupStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BackupStatus).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input interface{}) types.TableClass { - return func() types.TableClass { - var u types.TableClass - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { - return func() *string { - var s string - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_AttributeValueUpdate_Value_FromDafny(input interface{}) types.AttributeValue { +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_FromDafny(input interface{}) types.AttributeValue { return func() types.AttributeValue { var union types.AttributeValue - if input == nil { - return union - } if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) @@ -3729,38 +3668,71 @@ func com_amazonaws_dynamodb_AttributeValueUpdate_Value_FromDafny(input interface return union }() } -func com_amazonaws_dynamodb_PutRequest_Item_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { +func com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input interface{}) []float64 { + return func() []float64 { + var fieldValue []float64 + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_FromDafny(input interface{}) float64 { + return func() float64 { + var b []byte + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_RequestLimitExceeded_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CreateBackupInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + }() +} +func com_amazonaws_dynamodb_CreateBackupInput_BackupName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -3770,40 +3742,71 @@ func com_amazonaws_dynamodb_RequestLimitExceeded_message_FromDafny(input interfa } }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_FromDafny(input interface{}) *types.BackupDetails { + return func() *types.BackupDetails { if input == nil { return nil } - b = input.(bool) - return &b + return &types.BackupDetails{ + BackupArn: com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupArn()), + BackupName: com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupName()), + BackupSizeBytes: com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupSizeBytes().UnwrapOr(nil)), + BackupStatus: com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupStatus()), + BackupType: com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupType()), + BackupCreationDateTime: com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupCreationDateTime()), + BackupExpiryDateTime: com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_FromDafny(input interface{}) *types.UpdateKinesisStreamingConfiguration { - return func() *types.UpdateKinesisStreamingConfiguration { - if input == nil { - return nil +func com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - return &types.UpdateKinesisStreamingConfiguration{ - ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { - return func() types.ReturnValue { - var u types.ReturnValue +func com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { - return u + return nil } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input interface{}) types.BackupStatus { + return func() types.BackupStatus { + var u types.BackupStatus - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.BackupStatus).Equals(inputEnum) { break } } @@ -3811,20 +3814,17 @@ func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_FromDafny(input interfa return u.Values()[index] }() } -func com_amazonaws_dynamodb_QueryInput_Select_FromDafny(input interface{}) types.Select { - return func() types.Select { - var u types.Select - if input == nil { - return u - } +func com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input interface{}) types.BackupType { + return func() types.BackupType { + var u types.BackupType - inputEnum := input.(ComAmazonawsDynamodbTypes.Select) + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.Select).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.BackupType).Equals(inputEnum) { break } } @@ -3832,19 +3832,32 @@ func com_amazonaws_dynamodb_QueryInput_Select_FromDafny(input interface{}) types return u.Values()[index] }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil +func com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t } - i = input.(int64) - return &i }() } -func com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_FromDafny(input interface{}) []types.Tag { - return func() []types.Tag { - var fieldValue []types.Tag +func com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -3852,39 +3865,22 @@ func com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_FromDafny(input interf val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { - return func() *types.ConsumedCapacity { - if input == nil { - return nil } - return &types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t } }() } -func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -3898,35 +3894,29 @@ func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_FromDafny(input inte } }() } -func com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny(input interface{}) []types.WriteRequest { - return func() []types.WriteRequest { - var fieldValue []types.WriteRequest +func com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_FromDafny(input interface{}) []types.Replica { + return func() []types.Replica { + var fieldValue []types.Replica - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_WriteRequests_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_FromDafny(input interface{}) *types.CreateGlobalSecondaryIndexAction { - return func() *types.CreateGlobalSecondaryIndexAction { - if input == nil { - return nil + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaList_member_FromDafny(val)) } - return &types.CreateGlobalSecondaryIndexAction{ - IndexName: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_IndexName()), - KeySchema: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_KeySchema()), - Projection: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_Projection()), - ProvisionedThroughput: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_OnDemandThroughput().UnwrapOr(nil)), + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaList_member_FromDafny(input interface{}) types.Replica { + return func() types.Replica { + + return types.Replica{ + RegionName: com_amazonaws_dynamodb_Replica_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.Replica).Dtor_RegionName().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DuplicateItemException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_Replica_RegionName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3942,34 +3932,54 @@ func com_amazonaws_dynamodb_DuplicateItemException_message_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { + return func() *types.GlobalTableDescription { if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + return &types.GlobalTableDescription{ + ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), + GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), + GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input interface{}) []types.ReplicaDescription { + return func() []types.ReplicaDescription { + var fieldValue []types.ReplicaDescription if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(input interface{}) types.ReplicaDescription { + return func() types.ReplicaDescription { + + return types.ReplicaDescription{ + RegionName: com_amazonaws_dynamodb_ReplicaDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_RegionName().UnwrapOr(nil)), + ReplicaStatus: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), + ReplicaStatusDescription: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatusDescription().UnwrapOr(nil)), + ReplicaStatusPercentProgress: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatusPercentProgress().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + ReplicaInaccessibleDateTime: com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaInaccessibleDateTime().UnwrapOr(nil)), + ReplicaTableClassSummary: com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaTableClassSummary().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_RegionName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3985,20 +3995,20 @@ func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_FromDafny(i } }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { - return func() types.DestinationStatus { - var u types.DestinationStatus +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { + return func() types.ReplicaStatus { + var u types.ReplicaStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { break } } @@ -4006,27 +4016,29 @@ func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_Destination return u.Values()[index] }() } -func com_amazonaws_dynamodb_BatchGetResponseMap_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4036,7 +4048,7 @@ func com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_FromDafny(input i } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4052,7 +4064,27 @@ func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_Fro } }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { +func com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil + } + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { return func() *types.OnDemandThroughputOverride { if input == nil { return nil @@ -4062,103 +4094,161 @@ func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughpu } }() } -func com_amazonaws_dynamodb_CancellationReasonList_member_FromDafny(input interface{}) types.CancellationReason { - return func() types.CancellationReason { - - return types.CancellationReason{ - Item: com_amazonaws_dynamodb_CancellationReason_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Item().UnwrapOr(nil)), - Code: com_amazonaws_dynamodb_CancellationReason_Code_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Code().UnwrapOr(nil)), - Message: com_amazonaws_dynamodb_CancellationReason_Message_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Message().UnwrapOr(nil)), +func com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input interface{}) types.TableStatus { - return func() types.TableStatus { - var u types.TableStatus +func com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexDescription { + return func() []types.ReplicaGlobalSecondaryIndexDescription { + var fieldValue []types.ReplicaGlobalSecondaryIndexDescription if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.TableStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.TableStatus).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexDescription { + return func() types.ReplicaGlobalSecondaryIndexDescription { + + return types.ReplicaGlobalSecondaryIndexDescription{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_DeleteItemInput_Key_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil + } + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { + if input == nil { + return nil + } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { + return func() *types.TableClassSummary { + if input == nil { + return nil + } + return &types.TableClassSummary{ + TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), + LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } - }() -} -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] - } else { - b = append(b, val.(byte)) + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } + return &t } }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4174,30 +4264,45 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_FromDafn } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - i = input.(int64) - return &i + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { - return func() types.DestinationStatus { - var u types.DestinationStatus +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input interface{}) types.GlobalTableStatus { + return func() types.GlobalTableStatus { + var u types.GlobalTableStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.GlobalTableStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_GlobalTableStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.GlobalTableStatus).Equals(inputEnum) { break } } @@ -4205,18 +4310,46 @@ func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_FromD return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { - return func() *types.ItemCollectionMetrics { +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.ItemCollectionMetrics{ - ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), - SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_TagResourceInput_ResourceArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(input interface{}) types.AttributeDefinition { + return func() types.AttributeDefinition { + + return types.AttributeDefinition{ + AttributeName: com_amazonaws_dynamodb_AttributeDefinition_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeDefinition).Dtor_AttributeName()), + AttributeType: com_amazonaws_dynamodb_AttributeDefinition_AttributeType_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeDefinition).Dtor_AttributeType()), + } + }() +} +func com_amazonaws_dynamodb_AttributeDefinition_AttributeName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4230,19 +4363,25 @@ func com_amazonaws_dynamodb_TagResourceInput_ResourceArn_FromDafny(input interfa } }() } -func com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { - return func() *types.S3BucketSource { - if input == nil { - return nil - } - return &types.S3BucketSource{ - S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), - S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), - S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), +func com_amazonaws_dynamodb_AttributeDefinition_AttributeType_FromDafny(input interface{}) types.ScalarAttributeType { + return func() types.ScalarAttributeType { + var u types.ScalarAttributeType + + inputEnum := input.(ComAmazonawsDynamodbTypes.ScalarAttributeType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ScalarAttributeType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ScalarAttributeType).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CreateTableInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4256,23 +4395,30 @@ func com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input in } }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexAutoScalingDescription { - return func() []types.ReplicaGlobalSecondaryIndexAutoScalingDescription { - var fieldValue []types.ReplicaGlobalSecondaryIndexAutoScalingDescription - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_CreateTableInput_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_UpdateItemInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_KeySchema_member_FromDafny(input interface{}) types.KeySchemaElement { + return func() types.KeySchemaElement { + + return types.KeySchemaElement{ + AttributeName: com_amazonaws_dynamodb_KeySchemaElement_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.KeySchemaElement).Dtor_AttributeName()), + KeyType: com_amazonaws_dynamodb_KeySchemaElement_KeyType_FromDafny(input.(ComAmazonawsDynamodbTypes.KeySchemaElement).Dtor_KeyType()), + } + }() +} +func com_amazonaws_dynamodb_KeySchemaElement_AttributeName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4286,20 +4432,17 @@ func com_amazonaws_dynamodb_UpdateItemInput_TableName_FromDafny(input interface{ } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { - return func() types.IndexStatus { - var u types.IndexStatus - if input == nil { - return u - } +func com_amazonaws_dynamodb_KeySchemaElement_KeyType_FromDafny(input interface{}) types.KeyType { + return func() types.KeyType { + var u types.KeyType - inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.KeyType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_KeyType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.KeyType).Equals(inputEnum) { break } } @@ -4307,34 +4450,33 @@ func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_In return u.Values()[index] }() } -func com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndex { + return func() []types.LocalSecondaryIndex { + var fieldValue []types.LocalSecondaryIndex if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_ConditionCheck_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(input interface{}) types.LocalSecondaryIndex { + return func() types.LocalSecondaryIndex { + + return types.LocalSecondaryIndex{ + IndexName: com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_IndexName()), + KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_KeySchema()), + Projection: com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_Projection()), + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4348,63 +4490,43 @@ func com_amazonaws_dynamodb_ConditionCheck_TableName_FromDafny(input interface{} } }() } -func com_amazonaws_dynamodb_LimitExceededException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } +func com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_FromDafny(input interface{}) *types.StreamSpecification { - return func() *types.StreamSpecification { - if input == nil { - return nil - } - return &types.StreamSpecification{ - StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), - StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } +func com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input interface{}) types.ProjectionType { + return func() types.ProjectionType { + var u types.ProjectionType if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + inputEnum := input.(ComAmazonawsDynamodbTypes.ProjectionType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ProjectionType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ProjectionType).Equals(inputEnum) { break } } @@ -4412,82 +4534,69 @@ func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_FromDafny(inp return u.Values()[index] }() } -func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_NonKeyAttributeNameList_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_NonKeyAttributeNameList_member_FromDafny(input interface{}) string { + return func() string { var s string - if input == nil { - return nil - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndex { + return func() []types.GlobalSecondaryIndex { + var fieldValue []types.GlobalSecondaryIndex if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input interface{}) *types.BackupDetails { - return func() *types.BackupDetails { - if input == nil { - return nil - } - return &types.BackupDetails{ - BackupArn: com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupArn()), - BackupName: com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupName()), - BackupSizeBytes: com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupSizeBytes().UnwrapOr(nil)), - BackupStatus: com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupStatus()), - BackupType: com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupType()), - BackupCreationDateTime: com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupCreationDateTime()), - BackupExpiryDateTime: com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), +func com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(input interface{}) types.GlobalSecondaryIndex { + return func() types.GlobalSecondaryIndex { + + return types.GlobalSecondaryIndex{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_IndexName()), + KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_KeySchema()), + Projection: com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_Projection()), + ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_OnDemandThroughput().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4497,17 +4606,68 @@ func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input inte } }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { if input == nil { return nil } - i = input.(int32) + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + + i = input.(int64) return &i }() } -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input interface{}) *int64 { +func com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input interface{}) *int64 { return func() *int64 { var i int64 if input == nil { @@ -4517,121 +4677,138 @@ func com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesTo return &i }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.LocalSecondaryIndexDescription { - return func() types.LocalSecondaryIndexDescription { - - return types.LocalSecondaryIndexDescription{ - IndexName: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_KeySchema().UnwrapOr(nil)), - Projection: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_Projection().UnwrapOr(nil)), - IndexSizeBytes: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_ItemCount().UnwrapOr(nil)), - IndexArn: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexArn().UnwrapOr(nil)), +func com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_FromDafny(input interface{}) map[string][]types.ItemCollectionMetrics { - return func() map[string][]types.ItemCollectionMetrics { - var m map[string][]types.ItemCollectionMetrics = make(map[string][]types.ItemCollectionMetrics) +func com_amazonaws_dynamodb_CreateTableInput_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndexDescription { - return func() []types.GlobalSecondaryIndexDescription { - var fieldValue []types.GlobalSecondaryIndexDescription +func com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_FromDafny(val)) + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), } - return fieldValue }() } -func com_amazonaws_dynamodb_ImportNotFoundException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input interface{}) types.StreamViewType { + return func() types.StreamViewType { + var u types.StreamViewType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.StreamViewType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_StreamViewType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.StreamViewType).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_CreateTableInput_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input interface{}) int64 { - return func() int64 { - var i int64 +func com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { - return i + return nil } - i = input.(int64) - return i + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input interface{}) map[string]types.Capacity { - return func() map[string]types.Capacity { - var m map[string]types.Capacity = make(map[string]types.Capacity) +func com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input interface{}) types.SSEType { + return func() types.SSEType { + var u types.SSEType if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.SSEType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.SSEType).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - i = input.(int32) - return &i - }() -} -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4641,33 +4818,9 @@ func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_FromDafny } }() } -func com_amazonaws_dynamodb_SourceTableDetails_ItemCount_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_TagResourceInput_Tags_FromDafny(input interface{}) []types.Tag { +func com_amazonaws_dynamodb_CreateTableInput_Tags_FromDafny(input interface{}) []types.Tag { return func() []types.Tag { var fieldValue []types.Tag - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexDescription { - return func() []types.ReplicaGlobalSecondaryIndexDescription { - var fieldValue []types.ReplicaGlobalSecondaryIndexDescription if input == nil { return nil } @@ -4676,28 +4829,25 @@ func com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_FromDafny( if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil +func com_amazonaws_dynamodb_TagList_member_FromDafny(input interface{}) types.Tag { + return func() types.Tag { + + return types.Tag{ + Key: com_amazonaws_dynamodb_Tag_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Tag).Dtor_Key()), + Value: com_amazonaws_dynamodb_Tag_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.Tag).Dtor_Value()), } - i = input.(int64) - return &i }() } -func com_amazonaws_dynamodb_Put_ConditionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_Tag_Key_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4707,184 +4857,183 @@ func com_amazonaws_dynamodb_Put_ConditionExpression_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_Update_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } +func com_amazonaws_dynamodb_Tag_Value_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_CreateTableInput_TableClass_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass if input == nil { - return nil + return u } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(input interface{}) bool { - return func() bool { - var b bool - if input == nil { - return b } - b = input.(bool) - return b + return u.Values()[index] }() } -func com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_FromDafny(input interface{}) *bool { +func com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { return func() *bool { var b bool - - b = input.(bool) - return &b - }() -} -func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 if input == nil { return nil } - i = input.(int64) - return &i + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_FromDafny(input interface{}) []types.ContributorInsightsSummary { - return func() []types.ContributorInsightsSummary { - var fieldValue []types.ContributorInsightsSummary +func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ContributorInsightsSummaries_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_FromDafny(input interface{}) []types.BatchStatementRequest { - return func() []types.BatchStatementRequest { - var fieldValue []types.BatchStatementRequest - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_PartiQLBatchRequest_member_FromDafny(val)) +func com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_BatchGetItemOutput_Responses_FromDafny(input interface{}) map[string][]map[string]types.AttributeValue { - return func() map[string][]map[string]types.AttributeValue { - var m map[string][]map[string]types.AttributeValue = make(map[string][]map[string]types.AttributeValue) +func com_amazonaws_dynamodb_CreateTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_BatchGetResponseMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetResponseMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { +func com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_Key_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { - return func() *types.ConsumedCapacity { +func com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement if input == nil { return nil } - return &types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_FromDafny(input interface{}) *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription { - return func() *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription { +func com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input interface{}) types.TableStatus { + return func() types.TableStatus { + var u types.TableStatus if input == nil { - return nil + return u } - return &types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription{ - DisableScaleIn: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_DisableScaleIn().UnwrapOr(nil)), - ScaleInCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_ScaleInCooldown().UnwrapOr(nil)), - ScaleOutCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_ScaleOutCooldown().UnwrapOr(nil)), - TargetValue: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_TargetValue()), + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableStatus).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_FromDafny(input interface{}) []types.LocalSecondaryIndex { - return func() []types.LocalSecondaryIndex { - var fieldValue []types.LocalSecondaryIndex +func com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -4892,43 +5041,61 @@ func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOv val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) } - return fieldValue + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { - return func() []types.ConsumedCapacity { - var fieldValue []types.ConsumedCapacity +func com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughputDescription { + return func() *types.ProvisionedThroughputDescription { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + return &types.ProvisionedThroughputDescription{ + LastIncreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastIncreaseDateTime().UnwrapOr(nil)), + LastDecreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastDecreaseDateTime().UnwrapOr(nil)), + NumberOfDecreasesToday: com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_NumberOfDecreasesToday().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_WriteCapacityUnits().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableId_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_FromDafny(input interface{}) *time.Time { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input interface{}) *time.Time { return func() *time.Time { var s string if input == nil { @@ -4953,81 +5120,63 @@ func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_FromDafny(input } }() } -func com_amazonaws_dynamodb_UpdateTableInput_BillingMode_FromDafny(input interface{}) types.BillingMode { - return func() types.BillingMode { - var u types.BillingMode +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { - break - } - } + return nil } - return u.Values()[index] + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_CreateTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { - return func() *types.TableDescription { +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.TableDescription{ - AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), - TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), - BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), - LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), - LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), - GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), - RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), - SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), - ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), - TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), - DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5037,7 +5186,7 @@ func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_FromDafny(inpu } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5053,20 +5202,14 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_From } }() } -func com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(input interface{}) types.ReplicaDescription { - return func() types.ReplicaDescription { - - return types.ReplicaDescription{ - RegionName: com_amazonaws_dynamodb_ReplicaDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_RegionName().UnwrapOr(nil)), - ReplicaStatus: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), - ReplicaStatusDescription: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatusDescription().UnwrapOr(nil)), - ReplicaStatusPercentProgress: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatusPercentProgress().UnwrapOr(nil)), - KMSMasterKeyId: com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_KMSMasterKeyId().UnwrapOr(nil)), - ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), - OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - ReplicaInaccessibleDateTime: com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaInaccessibleDateTime().UnwrapOr(nil)), - ReplicaTableClassSummary: com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaTableClassSummary().UnwrapOr(nil)), +func com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input interface{}) *types.BillingModeSummary { + return func() *types.BillingModeSummary { + if input == nil { + return nil + } + return &types.BillingModeSummary{ + BillingMode: com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_BillingMode().UnwrapOr(nil)), + LastUpdateToPayPerRequestDateTime: com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_LastUpdateToPayPerRequestDateTime().UnwrapOr(nil)), } }() } @@ -5091,31 +5234,61 @@ func com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input inter return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_Statement_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndexDescription { + return func() []types.LocalSecondaryIndexDescription { + var fieldValue []types.LocalSecondaryIndexDescription if input == nil { return nil } - i = input.(int64) - return &i + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_FromDafny(val)) + } + return fieldValue }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.LocalSecondaryIndexDescription { + return func() types.LocalSecondaryIndexDescription { + + return types.LocalSecondaryIndexDescription{ + IndexName: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_Projection().UnwrapOr(nil)), + IndexSizeBytes: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_ItemCount().UnwrapOr(nil)), + IndexArn: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexArn().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5131,23 +5304,34 @@ func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_F } }() } -func com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { - return func() *types.ConsumedCapacity { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement if input == nil { return nil } - return &types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_FromDafny(input interface{}) *int64 { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil + } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input interface{}) *int64 { return func() *int64 { var i int64 if input == nil { @@ -5157,7 +5341,7 @@ func com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_FromDafny(input interf return &i }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input interface{}) *int64 { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_FromDafny(input interface{}) *int64 { return func() *int64 { var i int64 if input == nil { @@ -5167,11 +5351,13 @@ func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_FromDa return &i }() } -func com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5181,150 +5367,148 @@ func com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_FromDafny(input interface{}) types.TableClass { - return func() types.TableClass { - var u types.TableClass - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndexDescription { + return func() []types.GlobalSecondaryIndexDescription { + var fieldValue []types.GlobalSecondaryIndexDescription if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_ListAttributeValue_member_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexDescription { + return func() types.GlobalSecondaryIndexDescription { - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } + return types.GlobalSecondaryIndexDescription{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_Projection().UnwrapOr(nil)), + IndexStatus: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexStatus().UnwrapOr(nil)), + Backfilling: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_Backfilling().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + IndexSizeBytes: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_ItemCount().UnwrapOr(nil)), + IndexArn: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexArn().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { + return func() types.IndexStatus { + var u types.IndexStatus + if input == nil { + return u } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + + inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + break + } } } - - return union + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input interface{}) *types.PointInTimeRecoveryDescription { - return func() *types.PointInTimeRecoveryDescription { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - return &types.PointInTimeRecoveryDescription{ - PointInTimeRecoveryStatus: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_PointInTimeRecoveryStatus().UnwrapOr(nil)), - EarliestRestorableDateTime: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_EarliestRestorableDateTime().UnwrapOr(nil)), - LatestRestorableDateTime: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_LatestRestorableDateTime().UnwrapOr(nil)), + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughputDescription { + return func() *types.ProvisionedThroughputDescription { + if input == nil { + return nil + } + return &types.ProvisionedThroughputDescription{ + LastIncreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastIncreaseDateTime().UnwrapOr(nil)), + LastDecreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastDecreaseDateTime().UnwrapOr(nil)), + NumberOfDecreasesToday: com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_NumberOfDecreasesToday().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_WriteCapacityUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { - return func() *types.TableClassSummary { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.TableClassSummary{ - TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), - LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), - } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_GlobalTable_GlobalTableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5340,65 +5524,29 @@ func com_amazonaws_dynamodb_GlobalTable_GlobalTableName_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil } - }() -} -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_StringSetAttributeValue_member_FromDafny(val)) + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5414,7 +5562,7 @@ func com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_FromDafny(inp } }() } -func com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5430,17 +5578,7 @@ func com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input i } }() } -func com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5456,33 +5594,36 @@ func com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_FromDafny(input interf } }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { +func com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input interface{}) []types.ReplicaDescription { + return func() []types.ReplicaDescription { + var fieldValue []types.ReplicaDescription if input == nil { return nil } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_FromDafny(input interface{}) *types.BackupDescription { - return func() *types.BackupDescription { +func com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input interface{}) *types.RestoreSummary { + return func() *types.RestoreSummary { if input == nil { return nil } - return &types.BackupDescription{ - BackupDetails: com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_BackupDetails().UnwrapOr(nil)), - SourceTableDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableDetails().UnwrapOr(nil)), - SourceTableFeatureDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableFeatureDetails().UnwrapOr(nil)), + return &types.RestoreSummary{ + SourceBackupArn: com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_SourceBackupArn().UnwrapOr(nil)), + SourceTableArn: com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_SourceTableArn().UnwrapOr(nil)), + RestoreDateTime: com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_RestoreDateTime()), + RestoreInProgress: com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_RestoreInProgress()), } }() } -func com_amazonaws_dynamodb_ResourceInUseException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5498,28 +5639,7 @@ func com_amazonaws_dynamodb_ResourceInUseException_message_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_FromDafny(input interface{}) types.BillingMode { - return func() types.BillingMode { - var u types.BillingMode - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5535,116 +5655,93 @@ func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescri } }() } -func com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_FromDafny(input interface{}) types.GlobalSecondaryIndexInfo { - return func() types.GlobalSecondaryIndexInfo { - - return types.GlobalSecondaryIndexInfo{ - IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_IndexName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_KeySchema().UnwrapOr(nil)), - Projection: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_Projection().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_OnDemandThroughput().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string - if input == nil { - return nil - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input interface{}) *types.SSEDescription { + return func() *types.SSEDescription { if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + return &types.SSEDescription{ + Status: com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_Status().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyArn: com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_KMSMasterKeyArn().UnwrapOr(nil)), + InaccessibleEncryptionDateTime: com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_InaccessibleEncryptionDateTime().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ContributorInsightsSummaries_member_FromDafny(input interface{}) types.ContributorInsightsSummary { - return func() types.ContributorInsightsSummary { - - return types.ContributorInsightsSummary{ - TableName: com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_TableName().UnwrapOr(nil)), - IndexName: com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_IndexName().UnwrapOr(nil)), - ContributorInsightsStatus: com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_ContributorInsightsStatus().UnwrapOr(nil)), +func com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input interface{}) types.SSEStatus { + return func() types.SSEStatus { + var u types.SSEStatus + if input == nil { + return u } - }() -} -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexDescription { - return func() types.ReplicaGlobalSecondaryIndexDescription { - return types.ReplicaGlobalSecondaryIndexDescription{ - IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), - ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), - OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + inputEnum := input.(ComAmazonawsDynamodbTypes.SSEStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.SSEStatus).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ScanOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { - return func() []map[string]types.AttributeValue { - var fieldValue []map[string]types.AttributeValue +func com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input interface{}) types.SSEType { + return func() types.SSEType { + var u types.SSEType if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) + return u } - return fieldValue - }() -} -func com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_FromDafny(input interface{}) *types.ImportTableDescription { - return func() *types.ImportTableDescription { - return &types.ImportTableDescription{ - ImportArn: com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportArn().UnwrapOr(nil)), - ImportStatus: com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportStatus().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableId().UnwrapOr(nil)), - ClientToken: com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ClientToken().UnwrapOr(nil)), - S3BucketSource: com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_S3BucketSource().UnwrapOr(nil)), - ErrorCount: com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ErrorCount().UnwrapOr(nil)), - CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), - InputFormat: com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormat().UnwrapOr(nil)), - InputFormatOptions: com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormatOptions().UnwrapOr(nil)), - InputCompressionType: com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputCompressionType().UnwrapOr(nil)), - TableCreationParameters: com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableCreationParameters().UnwrapOr(nil)), - StartTime: com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_StartTime().UnwrapOr(nil)), - EndTime: com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_EndTime().UnwrapOr(nil)), - ProcessedSizeBytes: com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedSizeBytes().UnwrapOr(nil)), - ProcessedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedItemCount().UnwrapOr(nil)), - ImportedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportedItemCount().UnwrapOr(nil)), - FailureCode: com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureCode().UnwrapOr(nil)), - FailureMessage: com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureMessage().UnwrapOr(nil)), + inputEnum := input.(ComAmazonawsDynamodbTypes.SSEType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.SSEType).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5660,7 +5757,7 @@ func com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input interface{} } }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_FromDafny(input interface{}) *time.Time { +func com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input interface{}) *time.Time { return func() *time.Time { var s string if input == nil { @@ -5685,24 +5782,15 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_FromDafny(i } }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { - return func() *types.OnDemandThroughputOverride { - if input == nil { - return nil - } - return &types.OnDemandThroughputOverride{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_BatchStatementResponse_Error_FromDafny(input interface{}) *types.BatchStatementError { - return func() *types.BatchStatementError { +func com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input interface{}) *types.ArchivalSummary { + return func() *types.ArchivalSummary { if input == nil { return nil } - return &types.BatchStatementError{ - Code: com_amazonaws_dynamodb_BatchStatementError_Code_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementError).Dtor_Code().UnwrapOr(nil)), - Message: com_amazonaws_dynamodb_BatchStatementError_Message_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementError).Dtor_Message().UnwrapOr(nil)), + return &types.ArchivalSummary{ + ArchivalDateTime: com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalDateTime().UnwrapOr(nil)), + ArchivalReason: com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalReason().UnwrapOr(nil)), + ArchivalBackupArn: com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalBackupArn().UnwrapOr(nil)), } }() } @@ -5731,69 +5819,7 @@ func com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_FromDafny(input int } }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { - return func() []map[string]types.AttributeValue { - var fieldValue []map[string]types.AttributeValue - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_FromDafny(input interface{}) *types.ConditionCheck { - return func() *types.ConditionCheck { - if input == nil { - return nil - } - return &types.ConditionCheck{ - Key: com_amazonaws_dynamodb_ConditionCheck_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_Key()), - TableName: com_amazonaws_dynamodb_ConditionCheck_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_TableName()), - ConditionExpression: com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ConditionExpression()), - ExpressionAttributeNames: com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), - ExpressionAttributeValues: com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), - ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { - return func() types.ReturnItemCollectionMetrics { - var u types.ReturnItemCollectionMetrics - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5809,7 +5835,7 @@ func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_FromDafny(in } }() } -func com_amazonaws_dynamodb_TransactionConflictException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5825,21 +5851,18 @@ func com_amazonaws_dynamodb_TransactionConflictException_message_FromDafny(input } }() } -func com_amazonaws_dynamodb_DescribeTableInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } +func com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { + return func() *types.TableClassSummary { + if input == nil { + return nil + } + return &types.TableClassSummary{ + TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), + LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_FromDafny(input interface{}) *bool { +func com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { return func() *bool { var b bool if input == nil { @@ -5849,27 +5872,22 @@ func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_FromDafny(input return &b }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { +func com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { if input == nil { return nil } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5879,69 +5897,72 @@ func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_FromDafny( } }() } -func com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_FromDafny(input interface{}) *types.BackupDescription { + return func() *types.BackupDescription { if input == nil { return nil } - i = input.(int64) - return &i + return &types.BackupDescription{ + BackupDetails: com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_BackupDetails().UnwrapOr(nil)), + SourceTableDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableDetails().UnwrapOr(nil)), + SourceTableFeatureDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableFeatureDetails().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { - return func() []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { - var fieldValue []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate +func com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input interface{}) *types.BackupDetails { + return func() *types.BackupDetails { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(input interface{}) types.ReplicaSettingsDescription { - return func() types.ReplicaSettingsDescription { - - return types.ReplicaSettingsDescription{ - RegionName: com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_RegionName()), - ReplicaStatus: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), - ReplicaBillingModeSummary: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaBillingModeSummary().UnwrapOr(nil)), - ReplicaProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedReadCapacityUnits().UnwrapOr(nil)), - ReplicaProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), - ReplicaProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedWriteCapacityUnits().UnwrapOr(nil)), - ReplicaProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), - ReplicaGlobalSecondaryIndexSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaGlobalSecondaryIndexSettings().UnwrapOr(nil)), - ReplicaTableClassSummary: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaTableClassSummary().UnwrapOr(nil)), + return &types.BackupDetails{ + BackupArn: com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupArn()), + BackupName: com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupName()), + BackupSizeBytes: com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupSizeBytes().UnwrapOr(nil)), + BackupStatus: com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupStatus()), + BackupType: com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupType()), + BackupCreationDateTime: com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupCreationDateTime()), + BackupExpiryDateTime: com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { +func com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input interface{}) *types.SourceTableDetails { + return func() *types.SourceTableDetails { if input == nil { return nil } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + return &types.SourceTableDetails{ + TableName: com_amazonaws_dynamodb_SourceTableDetails_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableName()), + TableId: com_amazonaws_dynamodb_SourceTableDetails_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableId()), + TableArn: com_amazonaws_dynamodb_SourceTableDetails_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableArn().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableSizeBytes().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_SourceTableDetails_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_KeySchema()), + TableCreationDateTime: com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableCreationDateTime()), + ProvisionedThroughput: com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_ProvisionedThroughput()), + OnDemandThroughput: com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_OnDemandThroughput().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_SourceTableDetails_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_ItemCount().UnwrapOr(nil)), + BillingMode: com_amazonaws_dynamodb_SourceTableDetails_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_BillingMode().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_SourceTableDetails_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_TableId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5951,7 +5972,7 @@ func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_FromDafn } }() } -func com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_SourceTableDetails_TableArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5967,104 +5988,151 @@ func com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_FromDafny(i } }() } -func com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input interface{}) types.InputFormat { - return func() types.InputFormat { - var u types.InputFormat +func com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { - return u + return nil } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement - inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string - if input == nil { - return nil - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { - return func() *types.AutoScalingSettingsDescription { +func com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input interface{}) *types.SourceTableFeatureDetails { + return func() *types.SourceTableFeatureDetails { if input == nil { return nil } - return &types.AutoScalingSettingsDescription{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + return &types.SourceTableFeatureDetails{ + LocalSecondaryIndexes: com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_StreamDescription().UnwrapOr(nil)), + TimeToLiveDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_TimeToLiveDescription().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_SSEDescription().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndexInfo { + return func() []types.LocalSecondaryIndexInfo { + var fieldValue []types.LocalSecondaryIndexInfo if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexes_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_PartiQLBatchRequest_member_FromDafny(input interface{}) types.BatchStatementRequest { - return func() types.BatchStatementRequest { +func com_amazonaws_dynamodb_LocalSecondaryIndexes_member_FromDafny(input interface{}) types.LocalSecondaryIndexInfo { + return func() types.LocalSecondaryIndexInfo { - return types.BatchStatementRequest{ - Statement: com_amazonaws_dynamodb_BatchStatementRequest_Statement_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_Statement()), - Parameters: com_amazonaws_dynamodb_BatchStatementRequest_Parameters_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_Parameters().UnwrapOr(nil)), - ConsistentRead: com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_ConsistentRead().UnwrapOr(nil)), + return types.LocalSecondaryIndexInfo{ + IndexName: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_Projection().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6074,9 +6142,9 @@ func com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_FromDafny(input interface{}) []types.ItemResponse { - return func() []types.ItemResponse { - var fieldValue []types.ItemResponse +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement if input == nil { return nil } @@ -6085,14 +6153,25 @@ func com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_FromDafny(input i if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexSettingsDescription { - return func() []types.ReplicaGlobalSecondaryIndexSettingsDescription { - var fieldValue []types.ReplicaGlobalSecondaryIndexSettingsDescription +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil + } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndexInfo { + return func() []types.GlobalSecondaryIndexInfo { + var fieldValue []types.GlobalSecondaryIndexInfo if input == nil { return nil } @@ -6101,21 +6180,24 @@ func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryInd if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_GlobalTableList_member_FromDafny(input interface{}) types.GlobalTable { - return func() types.GlobalTable { +func com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_FromDafny(input interface{}) types.GlobalSecondaryIndexInfo { + return func() types.GlobalSecondaryIndexInfo { - return types.GlobalTable{ - GlobalTableName: com_amazonaws_dynamodb_GlobalTable_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTable).Dtor_GlobalTableName().UnwrapOr(nil)), - ReplicationGroup: com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTable).Dtor_ReplicationGroup().UnwrapOr(nil)), + return types.GlobalSecondaryIndexInfo{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_Projection().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_OnDemandThroughput().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_BackupInUseException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6131,111 +6213,99 @@ func com_amazonaws_dynamodb_BackupInUseException_message_FromDafny(input interfa } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(input interface{}) types.GlobalSecondaryIndex { - return func() types.GlobalSecondaryIndex { - - return types.GlobalSecondaryIndex{ - IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_IndexName()), - KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_KeySchema()), - Projection: com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_Projection()), - ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_OnDemandThroughput().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ScanInput_ScanFilter_FromDafny(input interface{}) map[string]types.Condition { - return func() map[string]types.Condition { - var m map[string]types.Condition = make(map[string]types.Condition) +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_FilterConditionMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_FilterConditionMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - - b = input.(bool) - return &b +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil + } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { if input == nil { return nil } - i = input.(int64) - return &i + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } }() } -func com_amazonaws_dynamodb_AttributeMap_key_FromDafny(input interface{}) string { - return func() string { - var s string +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { +func com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { if input == nil { return nil } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_FromDafny(input interface{}) []types.LocalSecondaryIndex { - return func() []types.LocalSecondaryIndex { - var fieldValue []types.LocalSecondaryIndex +func com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_FromDafny(input interface{}) *types.TimeToLiveDescription { + return func() *types.TimeToLiveDescription { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) + return &types.TimeToLiveDescription{ + TimeToLiveStatus: com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_TimeToLiveStatus().UnwrapOr(nil)), + AttributeName: com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_AttributeName().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { - return func() *types.TableClassSummary { +func com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input interface{}) types.TimeToLiveStatus { + return func() types.TimeToLiveStatus { + var u types.TimeToLiveStatus if input == nil { - return nil + return u } - return &types.TableClassSummary{ - TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), - LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), + + inputEnum := input.(ComAmazonawsDynamodbTypes.TimeToLiveStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TimeToLiveStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TimeToLiveStatus).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_IndexNotFoundException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6251,35 +6321,24 @@ func com_amazonaws_dynamodb_IndexNotFoundException_message_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny(input interface{}) types.KeysAndAttributes { - return func() types.KeysAndAttributes { - - return types.KeysAndAttributes{ - Keys: com_amazonaws_dynamodb_KeysAndAttributes_Keys_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_Keys()), - AttributesToGet: com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_AttributesToGet().UnwrapOr(nil)), - ConsistentRead: com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ConsistentRead().UnwrapOr(nil)), - ProjectionExpression: com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ProjectionExpression().UnwrapOr(nil)), - ExpressionAttributeNames: com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_FromDafny(input interface{}) *types.SSEDescription { + return func() *types.SSEDescription { if input == nil { return nil } - i = input.(int64) - return &i + return &types.SSEDescription{ + Status: com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_Status().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyArn: com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_KMSMasterKeyArn().UnwrapOr(nil)), + InaccessibleEncryptionDateTime: com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_InaccessibleEncryptionDateTime().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DeleteItemInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6289,61 +6348,159 @@ func com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_FromDafny(input in } }() } -func com_amazonaws_dynamodb_DescribeExportInput_ExportArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_DeleteItemInput_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement +func com_amazonaws_dynamodb_DeleteItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { + return func() map[string]types.ExpectedAttributeValue { + var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { - return func() *types.StreamSpecification { +func com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny(input interface{}) string { + return func() string { + var s string if input == nil { - return nil + return s } - return &types.StreamSpecification{ - StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), - StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny(input interface{}) types.ExpectedAttributeValue { + return func() types.ExpectedAttributeValue { + + return types.ExpectedAttributeValue{ + Value: com_amazonaws_dynamodb_ExpectedAttributeValue_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_Value().UnwrapOr(nil)), + Exists: com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_Exists().UnwrapOr(nil)), + ComparisonOperator: com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_ComparisonOperator().UnwrapOr(nil)), + AttributeValueList: com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_AttributeValueList().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + if input == nil { + return union + } + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_FromDafny(input interface{}) types.ComparisonOperator { + return func() types.ComparisonOperator { + var u types.ComparisonOperator if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + inputEnum := input.(ComAmazonawsDynamodbTypes.ComparisonOperator) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ComparisonOperator).Equals(inputEnum) { break } } @@ -6351,9 +6508,9 @@ func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_Fr return u.Values()[index] }() } -func com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue if input == nil { return nil } @@ -6362,163 +6519,93 @@ func com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input interfac if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_NonKeyAttributeNameList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), } } - }() -} -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), } } - }() -} -func com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), } } - }() -} -func com_amazonaws_dynamodb_BatchStatementRequest_Statement_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), } } - }() -} -func com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), } } - }() -} -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ContributorInsightsRuleList_member_FromDafny(val)) } - return fieldValue - }() -} -func com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicationGroupUpdate { - return func() []types.ReplicationGroupUpdate { - var fieldValue []types.ReplicationGroupUpdate - if input == nil { - return nil + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_FromDafny(val)) } - return fieldValue + + return union }() } -func com_amazonaws_dynamodb_DescribeTableOutput_Table_FromDafny(input interface{}) *types.TableDescription { - return func() *types.TableDescription { +func com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator if input == nil { - return nil - } - return &types.TableDescription{ - AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), - TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), - BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), - LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), - LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), - GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), - RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), - SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), - ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), - TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), - DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + return u } - }() -} -func com_amazonaws_dynamodb_KeySchemaElement_KeyType_FromDafny(input interface{}) types.KeyType { - return func() types.KeyType { - var u types.KeyType - inputEnum := input.(ComAmazonawsDynamodbTypes.KeyType) + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_KeyType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.KeyType).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { break } } @@ -6526,66 +6613,41 @@ func com_amazonaws_dynamodb_KeySchemaElement_KeyType_FromDafny(input interface{} return u.Values()[index] }() } -func com_amazonaws_dynamodb_Delete_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_FromDafny(input interface{}) []types.Replica { - return func() []types.Replica { - var fieldValue []types.Replica +func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { + return func() types.ReturnValue { + var u types.ReturnValue if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaList_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_FromDafny(input interface{}) types.ComparisonOperator { - return func() types.ComparisonOperator { - var u types.ComparisonOperator +func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ComparisonOperator) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ComparisonOperator).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { break } } @@ -6593,41 +6655,28 @@ func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_FromDafny( return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_FromDafny(input interface{}) *types.TimeToLiveSpecification { - return func() *types.TimeToLiveSpecification { - - return &types.TimeToLiveSpecification{ - Enabled: com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_Enabled()), - AttributeName: com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_AttributeName()), - } - }() -} -func com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } else { - s = s + string(val.(dafny.Char)) - } + return u } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } } - return &t } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6643,213 +6692,199 @@ func com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input interface{}) []float64 { - return func() []float64 { - var fieldValue []float64 +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_FromDafny(input interface{}) types.ReplicationGroupUpdate { - return func() types.ReplicationGroupUpdate { - - return types.ReplicationGroupUpdate{ - Create: com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Create().UnwrapOr(nil)), - Update: com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Update().UnwrapOr(nil)), - Delete: com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Delete().UnwrapOr(nil)), + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughputDescription { - return func() *types.ProvisionedThroughputDescription { +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - return &types.ProvisionedThroughputDescription{ - LastIncreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastIncreaseDateTime().UnwrapOr(nil)), - LastDecreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastDecreaseDateTime().UnwrapOr(nil)), - NumberOfDecreasesToday: com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_NumberOfDecreasesToday().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexAutoScalingDescription { - return func() types.ReplicaGlobalSecondaryIndexAutoScalingDescription { - - return types.ReplicaGlobalSecondaryIndexAutoScalingDescription{ - IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_IndexName().UnwrapOr(nil)), - IndexStatus: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_IndexStatus().UnwrapOr(nil)), - ProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_ProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), - ProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_ProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { - return func() types.ApproximateCreationDateTimePrecision { - var u types.ApproximateCreationDateTimePrecision - if input == nil { - return u - } - inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return u.Values()[index] + return m }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), } } - }() -} -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { - return func() types.IndexStatus { - var u types.IndexStatus - if input == nil { - return u + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } } - - inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { - break - } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), } } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_Delete_Key_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicaAutoScalingUpdate { - return func() []types.ReplicaAutoScalingUpdate { - var fieldValue []types.ReplicaAutoScalingUpdate +func com_amazonaws_dynamodb_DeleteItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_FromDafny(val)) + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_FromDafny(input interface{}) *types.InputFormatOptions { - return func() *types.InputFormatOptions { +func com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { if input == nil { return nil } - return &types.InputFormatOptions{ - Csv: com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input.(ComAmazonawsDynamodbTypes.InputFormatOptions).Dtor_Csv().UnwrapOr(nil)), + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { - return func() *types.StreamSpecification { +func com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { + return func() *types.ItemCollectionMetrics { if input == nil { return nil } - return &types.StreamSpecification{ - StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), - StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), + return &types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { - return func() *types.AutoScalingSettingsDescription { - if input == nil { - return nil - } - return &types.AutoScalingSettingsDescription{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_QueryInput_AttributesToGet_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6865,13 +6900,58 @@ func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_FromDafny(input in } }() } -func com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DeleteTableInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6881,29 +6961,54 @@ func com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input inte } }() } -func com_amazonaws_dynamodb_KeyConditions_value_FromDafny(input interface{}) types.Condition { - return func() types.Condition { +func com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_FromDafny(input interface{}) *types.BackupDescription { + return func() *types.BackupDescription { + if input == nil { + return nil + } + return &types.BackupDescription{ + BackupDetails: com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_BackupDetails().UnwrapOr(nil)), + SourceTableDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableDetails().UnwrapOr(nil)), + SourceTableFeatureDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableFeatureDetails().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string - return types.Condition{ - AttributeValueList: com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_AttributeValueList().UnwrapOr(nil)), - ComparisonOperator: com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_ComparisonOperator()), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { - return func() types.ConditionalOperator { - var u types.ConditionalOperator +func com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(input interface{}) *types.ContinuousBackupsDescription { + return func() *types.ContinuousBackupsDescription { if input == nil { - return u + return nil + } + return &types.ContinuousBackupsDescription{ + ContinuousBackupsStatus: com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_ContinuousBackupsStatus()), + PointInTimeRecoveryDescription: com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_PointInTimeRecoveryDescription().UnwrapOr(nil)), } + }() +} +func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input interface{}) types.ContinuousBackupsStatus { + return func() types.ContinuousBackupsStatus { + var u types.ContinuousBackupsStatus - inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + inputEnum := input.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContinuousBackupsStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus).Equals(inputEnum) { break } } @@ -6911,91 +7016,104 @@ func com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_FromDafny(input return u.Values()[index] }() } -func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny(input interface{}) string { - return func() string { - var s string +func com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input interface{}) *types.PointInTimeRecoveryDescription { + return func() *types.PointInTimeRecoveryDescription { if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.PointInTimeRecoveryDescription{ + PointInTimeRecoveryStatus: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_PointInTimeRecoveryStatus().UnwrapOr(nil)), + EarliestRestorableDateTime: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_EarliestRestorableDateTime().UnwrapOr(nil)), + LatestRestorableDateTime: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_LatestRestorableDateTime().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_FromDafny(input interface{}) []types.ImportSummary { - return func() []types.ImportSummary { - var fieldValue []types.ImportSummary +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_FromDafny(input interface{}) types.PointInTimeRecoveryStatus { + return func() types.PointInTimeRecoveryStatus { + var u types.PointInTimeRecoveryStatus if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + + inputEnum := input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_PointInTimeRecoveryStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ImportSummaryList_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } - }() -} -func com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { - if input == nil { - return nil - } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t } }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_FromDafny(input interface{}) *types.Projection { - return func() *types.Projection { +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - return &types.Projection{ - ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), - NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t } }() } -func com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input interface{}) *types.SourceTableFeatureDetails { - return func() *types.SourceTableFeatureDetails { - if input == nil { - return nil - } - return &types.SourceTableFeatureDetails{ - LocalSecondaryIndexes: com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - StreamDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_StreamDescription().UnwrapOr(nil)), - TimeToLiveDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_TimeToLiveDescription().UnwrapOr(nil)), - SSEDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_SSEDescription().UnwrapOr(nil)), +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7011,7 +7129,7 @@ func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_FromDafn } }() } -func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7027,7 +7145,7 @@ func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_ } }() } -func com_amazonaws_dynamodb_CancellationReason_Code_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7043,17 +7161,58 @@ func com_amazonaws_dynamodb_CancellationReason_Code_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(input interface{}) bool { - return func() bool { - var b bool +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { - return b + return nil } - b = input.(bool) - return b + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ContributorInsightsRuleList_member_FromDafny(val)) + } + return fieldValue }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_FromDafny(input interface{}) *time.Time { +func com_amazonaws_dynamodb_ContributorInsightsRuleList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { + return func() types.ContributorInsightsStatus { + var u types.ContributorInsightsStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_FromDafny(input interface{}) *time.Time { return func() *time.Time { var s string if input == nil { @@ -7078,23 +7237,34 @@ func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_FromD } }() } -func com_amazonaws_dynamodb_CsvOptions_HeaderList_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_FromDafny(input interface{}) *types.FailureException { + return func() *types.FailureException { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + return &types.FailureException{ + ExceptionName: com_amazonaws_dynamodb_FailureException_ExceptionName_FromDafny(input.(ComAmazonawsDynamodbTypes.FailureException).Dtor_ExceptionName().UnwrapOr(nil)), + ExceptionDescription: com_amazonaws_dynamodb_FailureException_ExceptionDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.FailureException).Dtor_ExceptionDescription().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_FailureException_ExceptionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_CsvHeaderList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_ScanInput_ProjectionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_FailureException_ExceptionDescription_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7110,68 +7280,52 @@ func com_amazonaws_dynamodb_ScanInput_ProjectionExpression_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement +func com_amazonaws_dynamodb_DescribeEndpointsOutput_Endpoints_FromDafny(input interface{}) []types.Endpoint { + return func() []types.Endpoint { + var fieldValue []types.Endpoint for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_Endpoints_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_FromDafny(input interface{}) *types.UpdateReplicationGroupMemberAction { - return func() *types.UpdateReplicationGroupMemberAction { - if input == nil { - return nil - } - return &types.UpdateReplicationGroupMemberAction{ - RegionName: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_RegionName()), - KMSMasterKeyId: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_KMSMasterKeyId().UnwrapOr(nil)), - ProvisionedThroughputOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), - OnDemandThroughputOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - TableClassOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_TableClassOverride().UnwrapOr(nil)), +func com_amazonaws_dynamodb_Endpoints_member_FromDafny(input interface{}) types.Endpoint { + return func() types.Endpoint { + + return types.Endpoint{ + Address: com_amazonaws_dynamodb_Endpoint_Address_FromDafny(input.(ComAmazonawsDynamodbTypes.Endpoint).Dtor_Address()), + CachePeriodInMinutes: com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_FromDafny(input.(ComAmazonawsDynamodbTypes.Endpoint).Dtor_CachePeriodInMinutes()), } }() } -func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_FromDafny(input interface{}) []types.KinesisDataStreamDestination { - return func() []types.KinesisDataStreamDestination { - var fieldValue []types.KinesisDataStreamDestination - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_Endpoint_Address_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_QueryOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { - return func() []map[string]types.AttributeValue { - var fieldValue []map[string]types.AttributeValue - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) - } - return fieldValue +func com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 + + i = input.(int64) + return i }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DescribeExportInput_ExportArn_FromDafny(input interface{}) *string { return func() *string { var s string @@ -7185,23 +7339,37 @@ func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_Fro } }() } -func com_amazonaws_dynamodb_ListExportsInput_NextToken_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_FromDafny(input interface{}) *types.ExportDescription { + return func() *types.ExportDescription { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.ExportDescription{ + ExportArn: com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportArn().UnwrapOr(nil)), + ExportStatus: com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportStatus().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_EndTime().UnwrapOr(nil)), + ExportManifest: com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportManifest().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableId().UnwrapOr(nil)), + ExportTime: com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportTime().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Bucket().UnwrapOr(nil)), + S3BucketOwner: com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Prefix: com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Prefix().UnwrapOr(nil)), + S3SseAlgorithm: com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseAlgorithm().UnwrapOr(nil)), + S3SseKmsKeyId: com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseKmsKeyId().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureMessage().UnwrapOr(nil)), + ExportFormat: com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportFormat().UnwrapOr(nil)), + BilledSizeBytes: com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_BilledSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ItemCount().UnwrapOr(nil)), + ExportType: com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportType().UnwrapOr(nil)), + IncrementalExportSpecification: com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_IncrementalExportSpecification().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ListExportsOutput_NextToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7217,39 +7385,78 @@ func com_amazonaws_dynamodb_ListExportsOutput_NextToken_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_BinarySetAttributeValue_member_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input interface{}) types.ExportStatus { + return func() types.ExportStatus { + var u types.ExportStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + break } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } + return &t } }() } -func com_amazonaws_dynamodb_KeyConditions_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7265,52 +7472,23 @@ func com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_FromDafny(input in } }() } -func com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_FromDafny(input interface{}) map[string]types.AttributeValueUpdate { - return func() map[string]types.AttributeValueUpdate { - var m map[string]types.AttributeValueUpdate = make(map[string]types.AttributeValueUpdate) - if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_AttributeUpdates_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeUpdates_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { +func com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { - return func() []types.AttributeDefinition { - var fieldValue []types.AttributeDefinition - for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_BackupSummary_TableId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7326,32 +7504,32 @@ func com_amazonaws_dynamodb_BackupSummary_TableId_FromDafny(input interface{}) * } }() } -func com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny(input interface{}) types.ExpectedAttributeValue { - return func() types.ExpectedAttributeValue { - - return types.ExpectedAttributeValue{ - Value: com_amazonaws_dynamodb_ExpectedAttributeValue_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_Value().UnwrapOr(nil)), - Exists: com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_Exists().UnwrapOr(nil)), - ComparisonOperator: com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_ComparisonOperator().UnwrapOr(nil)), - AttributeValueList: com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_AttributeValueList().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_ListImportsOutput_NextToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7367,29 +7545,13 @@ func com_amazonaws_dynamodb_ListImportsOutput_NextToken_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_ImportTableInput_InputFormat_FromDafny(input interface{}) types.InputFormat { - return func() types.InputFormat { - var u types.InputFormat - - inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7399,33 +7561,13 @@ func com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input interface{} } }() } -func com_amazonaws_dynamodb_KeySchema_member_FromDafny(input interface{}) types.KeySchemaElement { - return func() types.KeySchemaElement { - - return types.KeySchemaElement{ - AttributeName: com_amazonaws_dynamodb_KeySchemaElement_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.KeySchemaElement).Dtor_AttributeName()), - KeyType: com_amazonaws_dynamodb_KeySchemaElement_KeyType_FromDafny(input.(ComAmazonawsDynamodbTypes.KeySchemaElement).Dtor_KeyType()), - } - }() -} -func com_amazonaws_dynamodb_QueryOutput_ScannedCount_FromDafny(input interface{}) int32 { - return input.(int32) -} -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7435,58 +7577,36 @@ func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_FromDafny(inpu } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_KeyList_member_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_UpdateItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { - return func() map[string]types.ExpectedAttributeValue { - var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) +func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input interface{}) types.S3SseAlgorithm { + return func() types.S3SseAlgorithm { + var u types.S3SseAlgorithm if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return u } - return m - }() -} -func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input interface{}) types.ContinuousBackupsStatus { - return func() types.ContinuousBackupsStatus { - var u types.ContinuousBackupsStatus - inputEnum := input.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.S3SseAlgorithm) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContinuousBackupsStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm).Equals(inputEnum) { break } } @@ -7494,38 +7614,23 @@ func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus return u.Values()[index] }() } -func com_amazonaws_dynamodb_ScanOutput_ScannedCount_FromDafny(input interface{}) int32 { - return input.(int32) -} -func com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_FromDafny(input interface{}) *types.BackupDescription { - return func() *types.BackupDescription { - if input == nil { - return nil - } - return &types.BackupDescription{ - BackupDetails: com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_BackupDetails().UnwrapOr(nil)), - SourceTableDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableDetails().UnwrapOr(nil)), - SourceTableFeatureDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableFeatureDetails().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndexInfo { - return func() []types.GlobalSecondaryIndexInfo { - var fieldValue []types.GlobalSecondaryIndexInfo +func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7541,7 +7646,7 @@ func com_amazonaws_dynamodb_SourceTableDetails_TableArn_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_PolicyNotFoundException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7557,135 +7662,144 @@ func com_amazonaws_dynamodb_PolicyNotFoundException_message_FromDafny(input inte } }() } -func com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input interface{}) types.ExportFormat { + return func() types.ExportFormat { + var u types.ExportFormat + if input == nil { + return u + } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportFormat).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.GlobalSecondaryIndexUpdate { - return func() []types.GlobalSecondaryIndexUpdate { - var fieldValue []types.GlobalSecondaryIndexUpdate +func com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_FromDafny(val)) - } - return fieldValue + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input interface{}) types.ExportType { + return func() types.ExportType { + var u types.ExportType + if input == nil { + return u + } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input interface{}) *types.IncrementalExportSpecification { + return func() *types.IncrementalExportSpecification { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.IncrementalExportSpecification{ + ExportFromTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportFromTime().UnwrapOr(nil)), + ExportToTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportToTime().UnwrapOr(nil)), + ExportViewType: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportViewType().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_FromDafny(input interface{}) *types.DeleteReplicationGroupMemberAction { - return func() *types.DeleteReplicationGroupMemberAction { +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - return &types.DeleteReplicationGroupMemberAction{ - RegionName: com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteReplicationGroupMemberAction).Dtor_RegionName()), - } - }() -} -func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny(input interface{}) []types.ItemCollectionMetrics { - return func() []types.ItemCollectionMetrics { - var fieldValue []types.ItemCollectionMetrics - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_FromDafny(val)) } - return fieldValue + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break - } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_BackupSummary_BackupStatus_FromDafny(input interface{}) types.BackupStatus { - return func() types.BackupStatus { - var u types.BackupStatus +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input interface{}) types.ExportViewType { + return func() types.ExportViewType { + var u types.ExportViewType if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.BackupStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportViewType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportViewType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.BackupStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ExportViewType).Equals(inputEnum) { break } } @@ -7693,50 +7807,39 @@ func com_amazonaws_dynamodb_BackupSummary_BackupStatus_FromDafny(input interface return u.Values()[index] }() } -func com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { var s string - if input == nil { - return s - } + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ScanInput_Segment_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { +func com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { + return func() *types.GlobalTableDescription { if input == nil { return nil } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + return &types.GlobalTableDescription{ + ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), + GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), + GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_CancellationReason_Message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7746,7 +7849,7 @@ func com_amazonaws_dynamodb_CancellationReason_Message_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7762,119 +7865,95 @@ func com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_FromDafny(input inte } }() } -func com_amazonaws_dynamodb_BatchStatementResponse_Item_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_FromDafny(input interface{}) []types.ReplicaSettingsDescription { + return func() []types.ReplicaSettingsDescription { + var fieldValue []types.ReplicaSettingsDescription if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { - return func() *types.SSESpecification { - if input == nil { - return nil - } - return &types.SSESpecification{ - Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), - SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), - KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), +func com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(input interface{}) types.ReplicaSettingsDescription { + return func() types.ReplicaSettingsDescription { + + return types.ReplicaSettingsDescription{ + RegionName: com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_RegionName()), + ReplicaStatus: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), + ReplicaBillingModeSummary: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaBillingModeSummary().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedReadCapacityUnits().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedWriteCapacityUnits().UnwrapOr(nil)), + ReplicaProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaGlobalSecondaryIndexSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaGlobalSecondaryIndexSettings().UnwrapOr(nil)), + ReplicaTableClassSummary: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaTableClassSummary().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_FromDafny(input interface{}) *string { + return func() *string { var s string - if input == nil { - return s - } + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { + return func() types.ReplicaStatus { + var u types.ReplicaStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_ImportSummary_ImportArn_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_CreateBackupInput_BackupName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndexDescription { - return func() []types.LocalSecondaryIndexDescription { - var fieldValue []types.LocalSecondaryIndexDescription +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_FromDafny(input interface{}) *types.BillingModeSummary { + return func() *types.BillingModeSummary { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_FromDafny(val)) + return &types.BillingModeSummary{ + BillingMode: com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_BillingMode().UnwrapOr(nil)), + LastUpdateToPayPerRequestDateTime: com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_LastUpdateToPayPerRequestDateTime().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { return func() *types.AutoScalingSettingsDescription { if input == nil { return nil @@ -7888,49 +7967,37 @@ func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWrit } }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndex { - return func() []types.ReplicaGlobalSecondaryIndex { - var fieldValue []types.ReplicaGlobalSecondaryIndex +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(val)) - } - return fieldValue + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input interface{}) *types.IncrementalExportSpecification { - return func() *types.IncrementalExportSpecification { +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.IncrementalExportSpecification{ - ExportFromTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportFromTime().UnwrapOr(nil)), - ExportToTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportToTime().UnwrapOr(nil)), - ExportViewType: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportViewType().UnwrapOr(nil)), - } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_ConditionCheck_Key_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil } - return m + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_Delete_ConditionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7946,75 +8013,32 @@ func com_amazonaws_dynamodb_Delete_ConditionExpression_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue - - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input interface{}) []types.AutoScalingPolicyDescription { + return func() []types.AutoScalingPolicyDescription { + var fieldValue []types.AutoScalingPolicyDescription + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_FromDafny(val)) } + return fieldValue + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_FromDafny(input interface{}) types.AutoScalingPolicyDescription { + return func() types.AutoScalingPolicyDescription { - return union + return types.AutoScalingPolicyDescription{ + PolicyName: com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription).Dtor_PolicyName().UnwrapOr(nil)), + TargetTrackingScalingPolicyConfiguration: com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription).Dtor_TargetTrackingScalingPolicyConfiguration().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_BackupSummary_BackupName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8030,75 +8054,90 @@ func com_amazonaws_dynamodb_BackupSummary_BackupName_FromDafny(input interface{} } }() } -func com_amazonaws_dynamodb_Get_ProjectionExpression_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_FromDafny(input interface{}) *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription { + return func() *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription{ + DisableScaleIn: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_DisableScaleIn().UnwrapOr(nil)), + ScaleInCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_ScaleInCooldown().UnwrapOr(nil)), + ScaleOutCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_ScaleOutCooldown().UnwrapOr(nil)), + TargetValue: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_TargetValue()), } }() } -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_FromDafny(input interface{}) *types.Projection { - return func() *types.Projection { - - return &types.Projection{ - ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), - NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil } + i = input.(int32) + return &i }() } -func com_amazonaws_dynamodb_AttributeDefinition_AttributeName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - b = input.(bool) - return &b + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.GlobalSecondaryIndexAutoScalingUpdate { - return func() []types.GlobalSecondaryIndexAutoScalingUpdate { - var fieldValue []types.GlobalSecondaryIndexAutoScalingUpdate +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexSettingsDescription { + return func() []types.ReplicaGlobalSecondaryIndexSettingsDescription { + var fieldValue []types.ReplicaGlobalSecondaryIndexSettingsDescription if input == nil { return nil } @@ -8107,49 +8146,29 @@ func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIn if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { - return func() *types.EnableKinesisStreamingConfiguration { - if input == nil { - return nil - } - return &types.EnableKinesisStreamingConfiguration{ - ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_FromDafny(input interface{}) types.TableClass { - return func() types.TableClass { - var u types.TableClass - if input == nil { - return u - } +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexSettingsDescription { + return func() types.ReplicaGlobalSecondaryIndexSettingsDescription { - inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { - break - } - } + return types.ReplicaGlobalSecondaryIndexSettingsDescription{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_IndexName()), + IndexStatus: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_IndexStatus().UnwrapOr(nil)), + ProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedReadCapacityUnits().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedWriteCapacityUnits().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8159,126 +8178,127 @@ func com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_FromDafny(input int } }() } -func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { + return func() types.IndexStatus { + var u types.IndexStatus if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(input interface{}) *types.TableAutoScalingDescription { - return func() *types.TableAutoScalingDescription { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.TableAutoScalingDescription{ - TableName: com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableName().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableStatus().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_Replicas().UnwrapOr(nil)), - } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { if input == nil { return nil } - i = input.(int32) - return &i + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_FromDafny(input interface{}) *types.SSEDescription { - return func() *types.SSEDescription { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.SSEDescription{ - Status: com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_Status().UnwrapOr(nil)), - SSEType: com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_SSEType().UnwrapOr(nil)), - KMSMasterKeyArn: com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_KMSMasterKeyArn().UnwrapOr(nil)), - InaccessibleEncryptionDateTime: com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_InaccessibleEncryptionDateTime().UnwrapOr(nil)), - } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_FromDafny(input interface{}) types.TableClass { - return func() types.TableClass { - var u types.TableClass +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { - break - } - } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { + return func() *types.TableClassSummary { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { - break - } - } + return &types.TableClassSummary{ + TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), + LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_FromDafny(input interface{}) *string { + return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + }() +} +func com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_FromDafny(input interface{}) *types.ImportTableDescription { + return func() *types.ImportTableDescription { + + return &types.ImportTableDescription{ + ImportArn: com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportArn().UnwrapOr(nil)), + ImportStatus: com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportStatus().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableId().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3BucketSource: com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_S3BucketSource().UnwrapOr(nil)), + ErrorCount: com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ErrorCount().UnwrapOr(nil)), + CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), + InputFormat: com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormat().UnwrapOr(nil)), + InputFormatOptions: com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormatOptions().UnwrapOr(nil)), + InputCompressionType: com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputCompressionType().UnwrapOr(nil)), + TableCreationParameters: com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableCreationParameters().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_EndTime().UnwrapOr(nil)), + ProcessedSizeBytes: com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedSizeBytes().UnwrapOr(nil)), + ProcessedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedItemCount().UnwrapOr(nil)), + ImportedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportedItemCount().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureMessage().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8294,151 +8314,60 @@ func com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_FromDafny(input int } }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_dynamodb_ListImportsInput_PageSize_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_FromDafny(input interface{}) map[string]types.KeysAndAttributes { - return func() map[string]types.KeysAndAttributes { - var m map[string]types.KeysAndAttributes = make(map[string]types.KeysAndAttributes) +func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input interface{}) types.ImportStatus { + return func() types.ImportStatus { + var u types.ImportStatus if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return u } - return m - }() -} -func com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(input interface{}) types.ConsumedCapacity { - return func() types.ConsumedCapacity { - return types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + inputEnum := input.(ComAmazonawsDynamodbTypes.ImportStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ImportStatus).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue - - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } +func com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - - return union }() } -func com_amazonaws_dynamodb_BatchStatementError_Message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8454,32 +8383,35 @@ func com_amazonaws_dynamodb_BatchStatementError_Message_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_ImportSummary_StartTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { + return func() *types.S3BucketSource { + if input == nil { + return nil + } + return &types.S3BucketSource{ + S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), + S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input interface{}) *string { return func() *string { var s string @@ -8493,27 +8425,39 @@ func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_FromDafny(input in } }() } -func com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 + if input == nil { + return i + } + i = input.(int64) + return i + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8523,20 +8467,20 @@ func com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_FromDafny(input int } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { - return func() types.IndexStatus { - var u types.IndexStatus +func com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input interface{}) types.InputFormat { + return func() types.InputFormat { + var u types.InputFormat if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { break } } @@ -8544,28 +8488,28 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_FromDafn return u.Values()[index] }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { - return func() types.DestinationStatus { - var u types.DestinationStatus +func com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input interface{}) *types.InputFormatOptions { + return func() *types.InputFormatOptions { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { - break - } - } + return &types.InputFormatOptions{ + Csv: com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input.(ComAmazonawsDynamodbTypes.InputFormatOptions).Dtor_Csv().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_QueryInput_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input interface{}) *types.CsvOptions { + return func() *types.CsvOptions { + if input == nil { + return nil + } + return &types.CsvOptions{ + Delimiter: com_amazonaws_dynamodb_CsvOptions_Delimiter_FromDafny(input.(ComAmazonawsDynamodbTypes.CsvOptions).Dtor_Delimiter().UnwrapOr(nil)), + HeaderList: com_amazonaws_dynamodb_CsvOptions_HeaderList_FromDafny(input.(ComAmazonawsDynamodbTypes.CsvOptions).Dtor_HeaderList().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CsvOptions_Delimiter_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8581,69 +8525,50 @@ func com_amazonaws_dynamodb_QueryInput_IndexName_FromDafny(input interface{}) *s } }() } -func com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { - return func() []types.AttributeDefinition { - var fieldValue []types.AttributeDefinition - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_CsvOptions_HeaderList_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_CsvHeaderList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { - return func() types.ReturnItemCollectionMetrics { - var u types.ReturnItemCollectionMetrics - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_CsvHeaderList_member_FromDafny(input interface{}) string { + return func() string { var s string - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { - return func() types.ContributorInsightsStatus { - var u types.ContributorInsightsStatus +func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input interface{}) types.InputCompressionType { + return func() types.InputCompressionType { + var u types.InputCompressionType if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.InputCompressionType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.InputCompressionType).Equals(inputEnum) { break } } @@ -8651,27 +8576,28 @@ func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicaUpdate { - return func() []types.ReplicaUpdate { - var fieldValue []types.ReplicaUpdate - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaUpdateList_member_FromDafny(val)) +func com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input interface{}) *types.TableCreationParameters { + return func() *types.TableCreationParameters { + if input == nil { + return nil + } + return &types.TableCreationParameters{ + TableName: com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_TableName()), + AttributeDefinitions: com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_AttributeDefinitions()), + KeySchema: com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_KeySchema()), + BillingMode: com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_BillingMode().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_OnDemandThroughput().UnwrapOr(nil)), + SSESpecification: com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_SSESpecification().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8681,39 +8607,56 @@ func com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input interf } }() } -func com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { - return func() []types.ConsumedCapacity { - var fieldValue []types.ConsumedCapacity - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_FromDafny(input interface{}) []types.ReplicaSettingsUpdate { - return func() []types.ReplicaSettingsUpdate { - var fieldValue []types.ReplicaSettingsUpdate - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { +func com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { return func() *types.ProvisionedThroughput { if input == nil { return nil @@ -8724,63 +8667,30 @@ func com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_FromDafny(inp } }() } -func com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input interface{}) int64 { - return func() int64 { - var i int64 - if input == nil { - return i - } - i = input.(int64) - return i - }() -} -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ExportConflictException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndex { +func com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndex { return func() []types.GlobalSecondaryIndex { var fieldValue []types.GlobalSecondaryIndex if input == nil { @@ -8796,9 +8706,9 @@ func com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_FromDafny(in return fieldValue }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement +func com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -8806,159 +8716,141 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_FromDafny(input i val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_FromDafny(input interface{}) types.ReplicaSettingsUpdate { - return func() types.ReplicaSettingsUpdate { - - return types.ReplicaSettingsUpdate{ - RegionName: com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_RegionName()), - ReplicaProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaProvisionedReadCapacityUnits().UnwrapOr(nil)), - ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), - ReplicaGlobalSecondaryIndexSettingsUpdate: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaGlobalSecondaryIndexSettingsUpdate().UnwrapOr(nil)), - ReplicaTableClass: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaTableClass().UnwrapOr(nil)), } - }() -} -func com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_FromDafny(input interface{}) []types.TransactGetItem { - return func() []types.TransactGetItem { - var fieldValue []types.TransactGetItem - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_TransactGetItemList_member_FromDafny(val)) + return &t } - return fieldValue }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } - }() -} -func com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(input interface{}) types.LocalSecondaryIndex { - return func() types.LocalSecondaryIndex { - - return types.LocalSecondaryIndex{ - IndexName: com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_IndexName()), - KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_KeySchema()), - Projection: com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_Projection()), + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t } }() } -func com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input interface{}) *types.InputFormatOptions { - return func() *types.InputFormatOptions { +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.InputFormatOptions{ - Csv: com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input.(ComAmazonawsDynamodbTypes.InputFormatOptions).Dtor_Csv().UnwrapOr(nil)), - } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input interface{}) types.ComparisonOperator { - return func() types.ComparisonOperator { - var u types.ComparisonOperator - - inputEnum := input.(ComAmazonawsDynamodbTypes.ComparisonOperator) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ComparisonOperator).Equals(inputEnum) { - break - } - } +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 + if input == nil { + return i } - return u.Values()[index] + i = input.(int64) + return i }() } -func com_amazonaws_dynamodb_QueryOutput_Count_FromDafny(input interface{}) int32 { - return input.(int32) -} -func com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { - return func() types.ReturnValuesOnConditionCheckFailure { - var u types.ReturnValuesOnConditionCheckFailure +func com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { - break - } - } + return i } - return u.Values()[index] + i = input.(int64) + return i }() } -func com_amazonaws_dynamodb_NumberSetAttributeValue_member_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input interface{}) *string { + return func() *string { var s string - + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte +func com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_FromDafny(input interface{}) *types.SSESpecification { - return func() *types.SSESpecification { +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.SSESpecification{ - Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), - SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), - KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_FromDafny(input interface{}) []types.GlobalSecondaryIndex { - return func() []types.GlobalSecondaryIndex { - var fieldValue []types.GlobalSecondaryIndex +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_FromDafny(input interface{}) []types.KinesisDataStreamDestination { + return func() []types.KinesisDataStreamDestination { + var fieldValue []types.KinesisDataStreamDestination if input == nil { return nil } @@ -8967,12 +8859,23 @@ func com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOver if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_FromDafny(input interface{}) types.KinesisDataStreamDestination { + return func() types.KinesisDataStreamDestination { + + return types.KinesisDataStreamDestination{ + StreamArn: com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_StreamArn().UnwrapOr(nil)), + DestinationStatus: com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_DestinationStatus().UnwrapOr(nil)), + DestinationStatusDescription: com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_DestinationStatusDescription().UnwrapOr(nil)), + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8988,7 +8891,28 @@ func com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input int } }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -9004,20 +8928,20 @@ func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_Fr } }() } -func com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input interface{}) types.ExportFormat { - return func() types.ExportFormat { - var u types.ExportFormat +func com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { + return func() types.ApproximateCreationDateTimePrecision { + var u types.ApproximateCreationDateTimePrecision if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportFormat) + inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ExportFormat).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { break } } @@ -9035,156 +8959,139 @@ func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxReadCapacityUnits_Fro return &i }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_FromDafny(input interface{}) types.BillingMode { - return func() types.BillingMode { - var u types.BillingMode +func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { - break - } - } + return nil } - return u.Values()[index] + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_FromDafny(input interface{}) *types.ExportDescription { - return func() *types.ExportDescription { +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.ExportDescription{ - ExportArn: com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportArn().UnwrapOr(nil)), - ExportStatus: com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportStatus().UnwrapOr(nil)), - StartTime: com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_StartTime().UnwrapOr(nil)), - EndTime: com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_EndTime().UnwrapOr(nil)), - ExportManifest: com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportManifest().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableId().UnwrapOr(nil)), - ExportTime: com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportTime().UnwrapOr(nil)), - ClientToken: com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ClientToken().UnwrapOr(nil)), - S3Bucket: com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Bucket().UnwrapOr(nil)), - S3BucketOwner: com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3BucketOwner().UnwrapOr(nil)), - S3Prefix: com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Prefix().UnwrapOr(nil)), - S3SseAlgorithm: com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseAlgorithm().UnwrapOr(nil)), - S3SseKmsKeyId: com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseKmsKeyId().UnwrapOr(nil)), - FailureCode: com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureCode().UnwrapOr(nil)), - FailureMessage: com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureMessage().UnwrapOr(nil)), - ExportFormat: com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportFormat().UnwrapOr(nil)), - BilledSizeBytes: com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_BilledSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ItemCount().UnwrapOr(nil)), - ExportType: com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportType().UnwrapOr(nil)), - IncrementalExportSpecification: com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_IncrementalExportSpecification().UnwrapOr(nil)), - } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_FromDafny(input interface{}) map[string][]types.WriteRequest { - return func() map[string][]types.WriteRequest { - var m map[string][]types.WriteRequest = make(map[string][]types.WriteRequest) +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_DescribeTableInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_FromDafny(input interface{}) []types.ReplicaSettingsDescription { - return func() []types.ReplicaSettingsDescription { - var fieldValue []types.ReplicaSettingsDescription +func com_amazonaws_dynamodb_DescribeTableOutput_Table_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(val)) + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) map[string][]types.ItemCollectionMetrics { - return func() map[string][]types.ItemCollectionMetrics { - var m map[string][]types.ItemCollectionMetrics = make(map[string][]types.ItemCollectionMetrics) - if input == nil { - return nil - } +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(input interface{}) *types.TableAutoScalingDescription { + return func() *types.TableAutoScalingDescription { if input == nil { return nil } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + return &types.TableAutoScalingDescription{ + TableName: com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableName().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableStatus().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_Replicas().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { - return func() types.ReturnItemCollectionMetrics { - var u types.ReturnItemCollectionMetrics +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_BackupSummary_BackupType_FromDafny(input interface{}) types.BackupType { - return func() types.BackupType { - var u types.BackupType +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input interface{}) types.TableStatus { + return func() types.TableStatus { + var u types.TableStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.BackupType) + inputEnum := input.(ComAmazonawsDynamodbTypes.TableStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.BackupType).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.TableStatus).Equals(inputEnum) { break } } @@ -9192,38 +9099,35 @@ func com_amazonaws_dynamodb_BackupSummary_BackupType_FromDafny(input interface{} return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input interface{}) []types.ReplicaAutoScalingDescription { + return func() []types.ReplicaAutoScalingDescription { + var fieldValue []types.ReplicaAutoScalingDescription if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_FromDafny(input interface{}) []types.Replica { - return func() []types.Replica { - var fieldValue []types.Replica +func com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_FromDafny(input interface{}) types.ReplicaAutoScalingDescription { + return func() types.ReplicaAutoScalingDescription { - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaList_member_FromDafny(val)) + return types.ReplicaAutoScalingDescription{ + RegionName: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_RegionName().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaStatus: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -9239,37 +9143,9 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_FromDafn } }() } -func com_amazonaws_dynamodb_Get_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughputDescription { - return func() *types.ProvisionedThroughputDescription { - if input == nil { - return nil - } - return &types.ProvisionedThroughputDescription{ - LastIncreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastIncreaseDateTime().UnwrapOr(nil)), - LastDecreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastDecreaseDateTime().UnwrapOr(nil)), - NumberOfDecreasesToday: com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_NumberOfDecreasesToday().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + return func() []types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + var fieldValue []types.ReplicaGlobalSecondaryIndexAutoScalingDescription if input == nil { return nil } @@ -9277,22 +9153,24 @@ func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTim val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_FromDafny(val)) } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + return func() types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + + return types.ReplicaGlobalSecondaryIndexAutoScalingDescription{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_IndexName().UnwrapOr(nil)), + IndexStatus: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_IndexStatus().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_ProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_ProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -9308,133 +9186,158 @@ func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_Fr } }() } -func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { + return func() types.IndexStatus { + var u types.IndexStatus if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + break + } } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { - return func() *types.TableDescription { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { if input == nil { return nil } - return &types.TableDescription{ - AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), - TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), - BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), - LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), - LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), - GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), - RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), - SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), - ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), - TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), - DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_Key_value_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue - - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { + return func() types.ReplicaStatus { + var u types.ReplicaStatus + if input == nil { + return u } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { + break + } } } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } + }() +} +func com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_FromDafny(input interface{}) *types.TimeToLiveDescription { + return func() *types.TimeToLiveDescription { + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } + return &types.TimeToLiveDescription{ + TimeToLiveStatus: com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_TimeToLiveStatus().UnwrapOr(nil)), + AttributeName: com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_AttributeName().UnwrapOr(nil)), } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - - return union }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { return func() *types.EnableKinesisStreamingConfiguration { if input == nil { return nil @@ -9444,47 +9347,73 @@ func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesi } }() } -func com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { + return func() types.ApproximateCreationDateTimePrecision { + var u types.ApproximateCreationDateTimePrecision + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input interface{}) []types.AttributeValue { - return func() []types.AttributeValue { - var fieldValue []types.AttributeValue +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { - return func() types.ReturnValue { - var u types.ReturnValue +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { break } } @@ -9492,23 +9421,35 @@ func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_FromDafny(input interfa return u.Values()[index] }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { + return func() *types.EnableKinesisStreamingConfiguration { if input == nil { return nil } - i = input.(int32) - return &i + return &types.EnableKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -9518,37 +9459,39 @@ func com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_FromDafny } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_FromDafny(input interface{}) *types.DeleteGlobalSecondaryIndexAction { - return func() *types.DeleteGlobalSecondaryIndexAction { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { + return func() *types.EnableKinesisStreamingConfiguration { if input == nil { return nil } - return &types.DeleteGlobalSecondaryIndexAction{ - IndexName: com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteGlobalSecondaryIndexAction).Dtor_IndexName()), + return &types.EnableKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_FromDafny(input interface{}) []types.BackupSummary { - return func() []types.BackupSummary { - var fieldValue []types.BackupSummary +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_BackupSummaries_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_KeySchemaElement_AttributeName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -9558,23 +9501,42 @@ func com_amazonaws_dynamodb_KeySchemaElement_AttributeName_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { + return func() *types.EnableKinesisStreamingConfiguration { if input == nil { return nil } - i = input.(int32) - return &i + return &types.EnableKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExecuteStatementInput_Statement_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -9584,31 +9546,33 @@ func com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue if input == nil { return nil } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_DescribeEndpointsOutput_Endpoints_FromDafny(input interface{}) []types.Endpoint { - return func() []types.Endpoint { - var fieldValue []types.Endpoint - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_Endpoints_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -9624,39 +9588,54 @@ func com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input i } }() } -func com_amazonaws_dynamodb_FailureException_ExceptionName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ReplicaNotFoundException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ExecuteStatementInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ExecuteStatementOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_BackupSummary_BackupArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -9672,127 +9651,93 @@ func com_amazonaws_dynamodb_BackupSummary_BackupArn_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny(input interface{}) string { - return func() string { - var s string +func com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_FromDafny(input interface{}) []types.ParameterizedStatement { + return func() []types.ParameterizedStatement { + var fieldValue []types.ParameterizedStatement - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ParameterizedStatements_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { - return func() *types.S3BucketSource { +func com_amazonaws_dynamodb_ParameterizedStatements_member_FromDafny(input interface{}) types.ParameterizedStatement { + return func() types.ParameterizedStatement { - return &types.S3BucketSource{ - S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), - S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), - S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), + return types.ParameterizedStatement{ + Statement: com_amazonaws_dynamodb_ParameterizedStatement_Statement_FromDafny(input.(ComAmazonawsDynamodbTypes.ParameterizedStatement).Dtor_Statement()), + Parameters: com_amazonaws_dynamodb_ParameterizedStatement_Parameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ParameterizedStatement).Dtor_Parameters().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_ParameterizedStatement_Statement_FromDafny(input interface{}) *string { + return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } - }() -} -func com_amazonaws_dynamodb_ReplicaUpdate_Delete_FromDafny(input interface{}) *types.DeleteReplicaAction { - return func() *types.DeleteReplicaAction { - if input == nil { - return nil - } - return &types.DeleteReplicaAction{ - RegionName: com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteReplicaAction).Dtor_RegionName()), - } }() } -func com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_ParameterizedStatement_Parameters_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { - if input == nil { - return nil - } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -9808,20 +9753,20 @@ func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_FromD } }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { - return func() types.DestinationStatus { - var u types.DestinationStatus +func com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { break } } @@ -9829,58 +9774,78 @@ func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationS return u.Values()[index] }() } -func com_amazonaws_dynamodb_FilterConditionMap_value_FromDafny(input interface{}) types.Condition { - return func() types.Condition { +func com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_FromDafny(input interface{}) []types.ItemResponse { + return func() []types.ItemResponse { + var fieldValue []types.ItemResponse + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(input interface{}) types.ItemResponse { + return func() types.ItemResponse { - return types.Condition{ - AttributeValueList: com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_AttributeValueList().UnwrapOr(nil)), - ComparisonOperator: com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_ComparisonOperator()), + return types.ItemResponse{ + Item: com_amazonaws_dynamodb_ItemResponse_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemResponse).Dtor_Item().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte +func com_amazonaws_dynamodb_ItemResponse_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] - } else { - b = append(b, val.(byte)) + break } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_Endpoints_member_FromDafny(input interface{}) types.Endpoint { - return func() types.Endpoint { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string - return types.Endpoint{ - Address: com_amazonaws_dynamodb_Endpoint_Address_FromDafny(input.(ComAmazonawsDynamodbTypes.Endpoint).Dtor_Address()), - CachePeriodInMinutes: com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_FromDafny(input.(ComAmazonawsDynamodbTypes.Endpoint).Dtor_CachePeriodInMinutes()), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_FromDafny(input interface{}) *time.Time { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_FromDafny(input interface{}) *time.Time { return func() *time.Time { var s string if input == nil { @@ -9905,7 +9870,7 @@ func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_FromD } }() } -func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -9921,41 +9886,66 @@ func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_BatchStatementError_Code_FromDafny(input interface{}) types.BatchStatementErrorCodeEnum { - return func() types.BatchStatementErrorCodeEnum { - var u types.BatchStatementErrorCodeEnum +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BatchStatementErrorCodeEnum_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input interface{}) types.InputCompressionType { - return func() types.InputCompressionType { - var u types.InputCompressionType +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_FromDafny(input interface{}) types.S3SseAlgorithm { + return func() types.S3SseAlgorithm { + var u types.S3SseAlgorithm if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.InputCompressionType) + inputEnum := input.(ComAmazonawsDynamodbTypes.S3SseAlgorithm) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.InputCompressionType).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm).Equals(inputEnum) { break } } @@ -9963,54 +9953,57 @@ func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafn return u.Values()[index] }() } -func com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_FromDafny(input interface{}) *string { + return func() *string { var s string - + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_dynamodb_CsvHeaderList_member_FromDafny(input interface{}) string { - return func() string { - var s string +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_FromDafny(input interface{}) types.ExportFormat { + return func() types.ExportFormat { + var u types.ExportFormat + if input == nil { + return u + } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportFormat).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input interface{}) types.BackupType { - return func() types.BackupType { - var u types.BackupType +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_FromDafny(input interface{}) types.ExportType { + return func() types.ExportType { + var u types.ExportType + if input == nil { + return u + } - inputEnum := input.(ComAmazonawsDynamodbTypes.BackupType) + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.BackupType).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { break } } @@ -10018,51 +10011,116 @@ func com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input interface{} return u.Values()[index] }() } -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_FromDafny(input interface{}) *types.IncrementalExportSpecification { + return func() *types.IncrementalExportSpecification { if input == nil { return nil } - i = input.(int64) - return &i + return &types.IncrementalExportSpecification{ + ExportFromTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportFromTime().UnwrapOr(nil)), + ExportToTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportToTime().UnwrapOr(nil)), + ExportViewType: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportViewType().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { - return func() *types.OnDemandThroughputOverride { +func com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_FromDafny(input interface{}) *types.ExportDescription { + return func() *types.ExportDescription { if input == nil { return nil } - return &types.OnDemandThroughputOverride{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + return &types.ExportDescription{ + ExportArn: com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportArn().UnwrapOr(nil)), + ExportStatus: com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportStatus().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_EndTime().UnwrapOr(nil)), + ExportManifest: com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportManifest().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableId().UnwrapOr(nil)), + ExportTime: com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportTime().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Bucket().UnwrapOr(nil)), + S3BucketOwner: com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Prefix: com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Prefix().UnwrapOr(nil)), + S3SseAlgorithm: com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseAlgorithm().UnwrapOr(nil)), + S3SseKmsKeyId: com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseKmsKeyId().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureMessage().UnwrapOr(nil)), + ExportFormat: com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportFormat().UnwrapOr(nil)), + BilledSizeBytes: com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_BilledSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ItemCount().UnwrapOr(nil)), + ExportType: com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportType().UnwrapOr(nil)), + IncrementalExportSpecification: com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_IncrementalExportSpecification().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_FromDafny(input interface{}) *types.FailureException { - return func() *types.FailureException { +func com_amazonaws_dynamodb_GetItemInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GetItemInput_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_GetItemInput_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - return &types.FailureException{ - ExceptionName: com_amazonaws_dynamodb_FailureException_ExceptionName_FromDafny(input.(ComAmazonawsDynamodbTypes.FailureException).Dtor_ExceptionName().UnwrapOr(nil)), - ExceptionDescription: com_amazonaws_dynamodb_FailureException_ExceptionDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.FailureException).Dtor_ExceptionDescription().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GetItemInput_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil } + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_CreateTableInput_TableClass_FromDafny(input interface{}) types.TableClass { - return func() types.TableClass { - var u types.TableClass +func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { break } } @@ -10070,21 +10128,13 @@ func com_amazonaws_dynamodb_CreateTableInput_TableClass_FromDafny(input interfac return u.Values()[index] }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { - return func() *types.EnableKinesisStreamingConfiguration { +func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.EnableKinesisStreamingConfiguration{ - ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -10094,68 +10144,87 @@ func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_FromDafny(input i } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_KeysAndAttributes_Keys_FromDafny(input interface{}) []map[string]types.AttributeValue { - return func() []map[string]types.AttributeValue { - var fieldValue []map[string]types.AttributeValue +func com_amazonaws_dynamodb_GetItemOutput_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeyList_member_FromDafny(val)) + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input interface{}) types.ExportViewType { - return func() types.ExportViewType { - var u types.ExportViewType +func com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { if input == nil { - return u + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), } + }() +} +func com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportViewType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportViewType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ExportViewType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ScanInput_TotalSegments_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - i = input.(int32) - return &i + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } }() } -func com_amazonaws_dynamodb_InternalServerError_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10171,7 +10240,7 @@ func com_amazonaws_dynamodb_InternalServerError_message_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ImportTableInput_ClientToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10187,23 +10256,107 @@ func com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input interface{ } }() } -func com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input interface{}) []types.ReplicaDescription { - return func() []types.ReplicaDescription { - var fieldValue []types.ReplicaDescription +func com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { + return func() *types.S3BucketSource { + + return &types.S3BucketSource{ + S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), + S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportTableInput_InputFormat_FromDafny(input interface{}) types.InputFormat { + return func() types.InputFormat { + var u types.InputFormat + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_FromDafny(input interface{}) *types.InputFormatOptions { + return func() *types.InputFormatOptions { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + return &types.InputFormatOptions{ + Csv: com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input.(ComAmazonawsDynamodbTypes.InputFormatOptions).Dtor_Csv().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_FromDafny(input interface{}) types.InputCompressionType { + return func() types.InputCompressionType { + var u types.InputCompressionType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputCompressionType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputCompressionType).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_FromDafny(input interface{}) *types.TableCreationParameters { + return func() *types.TableCreationParameters { + + return &types.TableCreationParameters{ + TableName: com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_TableName()), + AttributeDefinitions: com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_AttributeDefinitions()), + KeySchema: com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_KeySchema()), + BillingMode: com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_BillingMode().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_OnDemandThroughput().UnwrapOr(nil)), + SSESpecification: com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_SSESpecification().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_FromDafny(input interface{}) *types.ImportTableDescription { + return func() *types.ImportTableDescription { + + return &types.ImportTableDescription{ + ImportArn: com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportArn().UnwrapOr(nil)), + ImportStatus: com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportStatus().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableId().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3BucketSource: com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_S3BucketSource().UnwrapOr(nil)), + ErrorCount: com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ErrorCount().UnwrapOr(nil)), + CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), + InputFormat: com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormat().UnwrapOr(nil)), + InputFormatOptions: com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormatOptions().UnwrapOr(nil)), + InputCompressionType: com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputCompressionType().UnwrapOr(nil)), + TableCreationParameters: com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableCreationParameters().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_EndTime().UnwrapOr(nil)), + ProcessedSizeBytes: com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedSizeBytes().UnwrapOr(nil)), + ProcessedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedItemCount().UnwrapOr(nil)), + ImportedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportedItemCount().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureMessage().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10219,55 +10372,67 @@ func com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_FromDafny(input } }() } -func com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_ListBackupsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } - }() -} -func com_amazonaws_dynamodb_WriteRequests_member_FromDafny(input interface{}) types.WriteRequest { - return func() types.WriteRequest { - - return types.WriteRequest{ - PutRequest: com_amazonaws_dynamodb_WriteRequest_PutRequest_FromDafny(input.(ComAmazonawsDynamodbTypes.WriteRequest).Dtor_PutRequest().UnwrapOr(nil)), - DeleteRequest: com_amazonaws_dynamodb_WriteRequest_DeleteRequest_FromDafny(input.(ComAmazonawsDynamodbTypes.WriteRequest).Dtor_DeleteRequest().UnwrapOr(nil)), + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t } }() } -func com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_FromDafny(input interface{}) *types.TimeToLiveDescription { - return func() *types.TimeToLiveDescription { +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - return &types.TimeToLiveDescription{ - TimeToLiveStatus: com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_TimeToLiveStatus().UnwrapOr(nil)), - AttributeName: com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_AttributeName().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_TableNameList_member_FromDafny(input interface{}) string { - return func() string { - var s string - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10283,20 +10448,20 @@ func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_FromDafny(in } }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_FromDafny(input interface{}) types.ExportFormat { - return func() types.ExportFormat { - var u types.ExportFormat +func com_amazonaws_dynamodb_ListBackupsInput_BackupType_FromDafny(input interface{}) types.BackupTypeFilter { + return func() types.BackupTypeFilter { + var u types.BackupTypeFilter if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportFormat) + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupTypeFilter) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupTypeFilter_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ExportFormat).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.BackupTypeFilter).Equals(inputEnum) { break } } @@ -10304,89 +10469,56 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_FromDafny return u.Values()[index] }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_FromDafny(input interface{}) []types.BackupSummary { + return func() []types.BackupSummary { + var fieldValue []types.BackupSummary if input == nil { return nil } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_ReplicaList_member_FromDafny(input interface{}) types.Replica { - return func() types.Replica { - - return types.Replica{ - RegionName: com_amazonaws_dynamodb_Replica_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.Replica).Dtor_RegionName().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_AttributeUpdates_key_FromDafny(input interface{}) string { - return func() string { - var s string - if input == nil { - return s - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_dynamodb_ContributorInsightsRuleList_member_FromDafny(input interface{}) string { - return func() string { - var s string - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_BackupSummaries_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - if input == nil { - return nil - } +func com_amazonaws_dynamodb_BackupSummaries_member_FromDafny(input interface{}) types.BackupSummary { + return func() types.BackupSummary { - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return types.BackupSummary{ + TableName: com_amazonaws_dynamodb_BackupSummary_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableName().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_BackupSummary_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableId().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_BackupSummary_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableArn().UnwrapOr(nil)), + BackupArn: com_amazonaws_dynamodb_BackupSummary_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupArn().UnwrapOr(nil)), + BackupName: com_amazonaws_dynamodb_BackupSummary_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupName().UnwrapOr(nil)), + BackupCreationDateTime: com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupCreationDateTime().UnwrapOr(nil)), + BackupExpiryDateTime: com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), + BackupStatus: com_amazonaws_dynamodb_BackupSummary_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupStatus().UnwrapOr(nil)), + BackupType: com_amazonaws_dynamodb_BackupSummary_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupType().UnwrapOr(nil)), + BackupSizeBytes: com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupSizeBytes().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_BackupSummary_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_BackupSummary_TableId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10402,11 +10534,13 @@ func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_In } }() } -func com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_BackupSummary_TableArn_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -10416,33 +10550,23 @@ func com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_FromDafny(inp } }() } -func com_amazonaws_dynamodb_BatchStatementRequest_Parameters_FromDafny(input interface{}) []types.AttributeValue { - return func() []types.AttributeValue { - var fieldValue []types.AttributeValue +func com_amazonaws_dynamodb_BackupSummary_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_LocalSecondaryIndexes_member_FromDafny(input interface{}) types.LocalSecondaryIndexInfo { - return func() types.LocalSecondaryIndexInfo { - - return types.LocalSecondaryIndexInfo{ - IndexName: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_IndexName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_KeySchema().UnwrapOr(nil)), - Projection: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_Projection().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_TableAlreadyExistsException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_BackupSummary_BackupName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10458,62 +10582,70 @@ func com_amazonaws_dynamodb_TableAlreadyExistsException_message_FromDafny(input } }() } -func com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_FromDafny(input interface{}) *types.TimeToLiveSpecification { - return func() *types.TimeToLiveSpecification { +func com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - return &types.TimeToLiveSpecification{ - Enabled: com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_Enabled()), - AttributeName: com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_AttributeName()), - } - }() -} -func com_amazonaws_dynamodb_CreateBackupInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_PutItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input interface{}) types.GlobalTableStatus { - return func() types.GlobalTableStatus { - var u types.GlobalTableStatus +func com_amazonaws_dynamodb_BackupSummary_BackupStatus_FromDafny(input interface{}) types.BackupStatus { + return func() types.BackupStatus { + var u types.BackupStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.GlobalTableStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_GlobalTableStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.GlobalTableStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.BackupStatus).Equals(inputEnum) { break } } @@ -10521,135 +10653,160 @@ func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(i return u.Values()[index] }() } -func com_amazonaws_dynamodb_ScanOutput_Count_FromDafny(input interface{}) int32 { - return input.(int32) -} -func com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { - return func() types.ApproximateCreationDateTimePrecision { - var u types.ApproximateCreationDateTimePrecision +func com_amazonaws_dynamodb_BackupSummary_BackupType_FromDafny(input interface{}) types.BackupType { + return func() types.BackupType { + var u types.BackupType if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.BackupType).Equals(inputEnum) { break } } } - return u.Values()[index] + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) + }() +} +func com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - return &t } }() } -func com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) + }() +} +func com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_FromDafny(input interface{}) []types.ContributorInsightsSummary { + return func() []types.ContributorInsightsSummary { + var fieldValue []types.ContributorInsightsSummary + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } - return &t + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ContributorInsightsSummaries_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexUpdate { - return func() types.GlobalSecondaryIndexUpdate { +func com_amazonaws_dynamodb_ContributorInsightsSummaries_member_FromDafny(input interface{}) types.ContributorInsightsSummary { + return func() types.ContributorInsightsSummary { - return types.GlobalSecondaryIndexUpdate{ - Update: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Update().UnwrapOr(nil)), - Create: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Create().UnwrapOr(nil)), - Delete: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Delete().UnwrapOr(nil)), + return types.ContributorInsightsSummary{ + TableName: com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_TableName().UnwrapOr(nil)), + IndexName: com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_IndexName().UnwrapOr(nil)), + ContributorInsightsStatus: com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_ContributorInsightsStatus().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DeleteItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { - return func() *types.AutoScalingSettingsDescription { +func com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.AutoScalingSettingsDescription{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { + return func() types.ContributorInsightsStatus { + var u types.ContributorInsightsStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { break } } @@ -10657,7 +10814,7 @@ func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_FromDaf return u.Values()[index] }() } -func com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10673,53 +10830,39 @@ func com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_FromDafny(inp } }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndex { - return func() []types.ReplicaGlobalSecondaryIndex { - var fieldValue []types.ReplicaGlobalSecondaryIndex - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_CreateTableInput_Tags_FromDafny(input interface{}) []types.Tag { - return func() []types.Tag { - var fieldValue []types.Tag +func com_amazonaws_dynamodb_ListExportsInput_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ListExportsInput_MaxResults_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - i = input.(int64) + i = input.(int32) return &i }() } -func com_amazonaws_dynamodb_Endpoint_Address_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListExportsInput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -10729,9 +10872,9 @@ func com_amazonaws_dynamodb_Endpoint_Address_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_FromDafny(input interface{}) []types.GlobalTable { - return func() []types.GlobalTable { - var fieldValue []types.GlobalTable +func com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_FromDafny(input interface{}) []types.ExportSummary { + return func() []types.ExportSummary { + var fieldValue []types.ExportSummary if input == nil { return nil } @@ -10740,62 +10883,28 @@ func com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_FromDafny(input if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalTableList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ExportSummaries_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_dynamodb_GetItemOutput_Item_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_TransactGetItemList_member_FromDafny(input interface{}) types.TransactGetItem { - return func() types.TransactGetItem { +func com_amazonaws_dynamodb_ExportSummaries_member_FromDafny(input interface{}) types.ExportSummary { + return func() types.ExportSummary { - return types.TransactGetItem{ - Get: com_amazonaws_dynamodb_TransactGetItem_Get_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactGetItem).Dtor_Get()), + return types.ExportSummary{ + ExportArn: com_amazonaws_dynamodb_ExportSummary_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportArn().UnwrapOr(nil)), + ExportStatus: com_amazonaws_dynamodb_ExportSummary_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportStatus().UnwrapOr(nil)), + ExportType: com_amazonaws_dynamodb_ExportSummary_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportType().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input interface{}) *types.BillingModeSummary { - return func() *types.BillingModeSummary { +func com_amazonaws_dynamodb_ExportSummary_ExportArn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.BillingModeSummary{ - BillingMode: com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_BillingMode().UnwrapOr(nil)), - LastUpdateToPayPerRequestDateTime: com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_LastUpdateToPayPerRequestDateTime().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -10805,40 +10914,20 @@ func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_FromDafny(inp } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndex { - return func() types.ReplicaGlobalSecondaryIndex { - - return types.ReplicaGlobalSecondaryIndex{ - IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_IndexName()), - ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), - OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { - return func() *types.ProvisionedThroughputOverride { - if input == nil { - return nil - } - return &types.ProvisionedThroughputOverride{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_ExportSummary_ExportStatus_FromDafny(input interface{}) types.ExportStatus { + return func() types.ExportStatus { + var u types.ExportStatus if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportStatus) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ExportStatus).Equals(inputEnum) { break } } @@ -10846,23 +10935,28 @@ func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_FromDafny(i return u.Values()[index] }() } -func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_FromDafny(input interface{}) []types.ReplicaSettingsDescription { - return func() []types.ReplicaSettingsDescription { - var fieldValue []types.ReplicaSettingsDescription +func com_amazonaws_dynamodb_ExportSummary_ExportType_FromDafny(input interface{}) types.ExportType { + return func() types.ExportType { + var u types.ExportType if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ImportTableInput_ClientToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListExportsOutput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10878,11 +10972,13 @@ func com_amazonaws_dynamodb_ImportTableInput_ClientToken_FromDafny(input interfa } }() } -func com_amazonaws_dynamodb_Tag_Key_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -10892,7 +10988,17 @@ func com_amazonaws_dynamodb_Tag_Key_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_dynamodb_GlobalTableNotFoundException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10908,23 +11014,32 @@ func com_amazonaws_dynamodb_GlobalTableNotFoundException_message_FromDafny(input } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_FromDafny(input interface{}) []types.GlobalTable { + return func() []types.GlobalTable { + var fieldValue []types.GlobalTable if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalTableList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ListBackupsInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GlobalTableList_member_FromDafny(input interface{}) types.GlobalTable { + return func() types.GlobalTable { + + return types.GlobalTable{ + GlobalTableName: com_amazonaws_dynamodb_GlobalTable_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTable).Dtor_GlobalTableName().UnwrapOr(nil)), + ReplicationGroup: com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTable).Dtor_ReplicationGroup().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalTable_GlobalTableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -10940,23 +11055,9 @@ func com_amazonaws_dynamodb_ListBackupsInput_TableName_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_Update_Key_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input interface{}) []types.ReplicaDescription { - return func() []types.ReplicaDescription { - var fieldValue []types.ReplicaDescription +func com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_FromDafny(input interface{}) []types.Replica { + return func() []types.Replica { + var fieldValue []types.Replica if input == nil { return nil } @@ -10965,16 +11066,18 @@ func com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input interface{ if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -10984,39 +11087,39 @@ func com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_TagKeyList_member_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_ListImportsInput_TableArn_FromDafny(input interface{}) *string { + return func() *string { var s string - + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { - return func() *types.GlobalTableDescription { +func com_amazonaws_dynamodb_ListImportsInput_PageSize_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - return &types.GlobalTableDescription{ - ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), - GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), - GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), - } + i = input.(int32) + return &i }() } -func com_amazonaws_dynamodb_Update_UpdateExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListImportsInput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -11026,23 +11129,38 @@ func com_amazonaws_dynamodb_Update_UpdateExpression_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_FromDafny(input interface{}) []types.ImportSummary { + return func() []types.ImportSummary { + var fieldValue []types.ImportSummary if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ImportSummaryList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ImportSummaryList_member_FromDafny(input interface{}) types.ImportSummary { + return func() types.ImportSummary { + + return types.ImportSummary{ + ImportArn: com_amazonaws_dynamodb_ImportSummary_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_ImportArn().UnwrapOr(nil)), + ImportStatus: com_amazonaws_dynamodb_ImportSummary_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_ImportStatus().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ImportSummary_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_TableArn().UnwrapOr(nil)), + S3BucketSource: com_amazonaws_dynamodb_ImportSummary_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_S3BucketSource().UnwrapOr(nil)), + CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), + InputFormat: com_amazonaws_dynamodb_ImportSummary_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_InputFormat().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ImportSummary_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ImportSummary_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_EndTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportSummary_ImportArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -11058,7 +11176,28 @@ func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(inpu } }() } -func com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ImportSummary_ImportStatus_FromDafny(input interface{}) types.ImportStatus { + return func() types.ImportStatus { + var u types.ImportStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ImportStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ImportStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportSummary_TableArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -11074,17 +11213,15 @@ func com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_FromDafny(inp } }() } -func com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } +func com_amazonaws_dynamodb_ImportSummary_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { + return func() *types.S3BucketSource { + if input == nil { + return nil + } + return &types.S3BucketSource{ + S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), + S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), } }() } @@ -11104,33 +11241,78 @@ func com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_FromDafny(input } }() } -func com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ImportSummary_InputFormat_FromDafny(input interface{}) types.InputFormat { + return func() types.InputFormat { + var u types.InputFormat + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportSummary_StartTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - i = input.(int64) - return &i + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_ImportSummary_EndTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListImportsOutput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -11146,11 +11328,13 @@ func com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -11160,58 +11344,47 @@ func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_FromD } }() } -func com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { - return func() *types.StreamSpecification { - if input == nil { - return nil - } - return &types.StreamSpecification{ - StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), - StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_ListTablesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - i = input.(int64) + i = input.(int32) return &i }() } -func com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ListTablesOutput_TableNames_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TableNameList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_QueryInput_TableName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_TableNameList_member_FromDafny(input interface{}) string { + return func() string { var s string - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -11227,7 +11400,7 @@ func com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_DeleteTableInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_FromDafny(input interface{}) *string { return func() *string { var s string @@ -11241,7 +11414,7 @@ func com_amazonaws_dynamodb_DeleteTableInput_TableName_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -11257,222 +11430,43 @@ func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_Fr } }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_QueryInput_ConsistentRead_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { - if input == nil { - return nil - } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), - } - }() -} -func com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input interface{}) *types.SSEDescription { - return func() *types.SSEDescription { - if input == nil { - return nil - } - return &types.SSEDescription{ - Status: com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_Status().UnwrapOr(nil)), - SSEType: com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_SSEType().UnwrapOr(nil)), - KMSMasterKeyArn: com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_KMSMasterKeyArn().UnwrapOr(nil)), - InaccessibleEncryptionDateTime: com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_InaccessibleEncryptionDateTime().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_FromDafny(input interface{}) *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { - return func() *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { - - return &types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{ - DisableScaleIn: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_DisableScaleIn().UnwrapOr(nil)), - ScaleInCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_ScaleInCooldown().UnwrapOr(nil)), - ScaleOutCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_ScaleOutCooldown().UnwrapOr(nil)), - TargetValue: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_TargetValue()), - } - }() -} -func com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag if input == nil { - return nil - } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), - } - }() -} -func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue - - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - }() -} -func com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ImportSummaryList_member_FromDafny(input interface{}) types.ImportSummary { - return func() types.ImportSummary { - - return types.ImportSummary{ - ImportArn: com_amazonaws_dynamodb_ImportSummary_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_ImportArn().UnwrapOr(nil)), - ImportStatus: com_amazonaws_dynamodb_ImportSummary_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_ImportStatus().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_ImportSummary_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_TableArn().UnwrapOr(nil)), - S3BucketSource: com_amazonaws_dynamodb_ImportSummary_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_S3BucketSource().UnwrapOr(nil)), - CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), - InputFormat: com_amazonaws_dynamodb_ImportSummary_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_InputFormat().UnwrapOr(nil)), - StartTime: com_amazonaws_dynamodb_ImportSummary_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_StartTime().UnwrapOr(nil)), - EndTime: com_amazonaws_dynamodb_ImportSummary_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_EndTime().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_CreateTableInput_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { - return func() *types.SSESpecification { +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.SSESpecification{ - Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), - SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), - KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_PutItemInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -11482,87 +11476,114 @@ func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_FromDafny(i } }() } -func com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement +func com_amazonaws_dynamodb_PutItemInput_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_ListTablesInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_PutItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { + return func() map[string]types.ExpectedAttributeValue { + var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) if input == nil { return nil } - i = input.(int32) - return &i + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_PutItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { + return func() types.ReturnValue { + var u types.ReturnValue if input == nil { - return nil + return u } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_FromDafny(input interface{}) []types.ExportSummary { - return func() []types.ExportSummary { - var fieldValue []types.ExportSummary +func com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ExportSummaries_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_FromDafny(input interface{}) types.ExportType { - return func() types.ExportType { - var u types.ExportType +func com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { break } } @@ -11570,21 +11591,20 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_FromDafny(i return u.Values()[index] }() } -func com_amazonaws_dynamodb_DeleteItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { - return func() map[string]types.ExpectedAttributeValue { - var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) +func com_amazonaws_dynamodb_PutItemInput_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { @@ -11604,23 +11624,96 @@ func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_FromDafny(inpu return m }() } -func com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { - return func() []types.AttributeDefinition { - var fieldValue []types.AttributeDefinition +func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { + return func() *types.ItemCollectionMetrics { + if input == nil { + return nil + } + return &types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - return fieldValue }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -11636,28 +11729,17 @@ func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_FromDafny } }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_FromDafny(input interface{}) types.S3SseAlgorithm { - return func() types.S3SseAlgorithm { - var u types.S3SseAlgorithm +func com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.S3SseAlgorithm) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm).Equals(inputEnum) { - break - } - } + return b } - return u.Values()[index] + b = input.(bool) + return b }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -11673,13 +11755,11 @@ func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDaf } }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_QueryInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -11689,76 +11769,70 @@ func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_Fr } }() } -func com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_QueryInput_IndexName_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { - return func() *types.ConsumedCapacity { +func com_amazonaws_dynamodb_QueryInput_Select_FromDafny(input interface{}) types.Select { + return func() types.Select { + var u types.Select if input == nil { - return nil + return u } - return &types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + + inputEnum := input.(ComAmazonawsDynamodbTypes.Select) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.Select).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_Update_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_QueryInput_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) } - return m + return fieldValue }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_QueryInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), - } + i = input.(int32) + return &i }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_FromDafny(input interface{}) *bool { +func com_amazonaws_dynamodb_QueryInput_ConsistentRead_FromDafny(input interface{}) *bool { return func() *bool { var b bool if input == nil { @@ -11768,25 +11842,51 @@ func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationD return &b }() } -func com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndex { - return func() []types.GlobalSecondaryIndex { - var fieldValue []types.GlobalSecondaryIndex +func com_amazonaws_dynamodb_QueryInput_KeyConditions_FromDafny(input interface{}) map[string]types.Condition { + return func() map[string]types.Condition { + var m map[string]types.Condition = make(map[string]types.Condition) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + m[com_amazonaws_dynamodb_KeyConditions_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_KeyConditions_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement +func com_amazonaws_dynamodb_KeyConditions_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_KeyConditions_value_FromDafny(input interface{}) types.Condition { + return func() types.Condition { + + return types.Condition{ + AttributeValueList: com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_AttributeValueList().UnwrapOr(nil)), + ComparisonOperator: com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_ComparisonOperator()), + } + }() +} +func com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue if input == nil { return nil } @@ -11795,14 +11895,32 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_FromDafny( if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input interface{}) types.ComparisonOperator { + return func() types.ComparisonOperator { + var u types.ComparisonOperator + + inputEnum := input.(ComAmazonawsDynamodbTypes.ComparisonOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ComparisonOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_QueryInput_QueryFilter_FromDafny(input interface{}) map[string]types.Condition { + return func() map[string]types.Condition { + var m map[string]types.Condition = make(map[string]types.Condition) if input == nil { return nil } @@ -11812,33 +11930,50 @@ func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_FromDafny(input if !ok { break } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[com_amazonaws_dynamodb_FilterConditionMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_FilterConditionMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m }() } -func com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(input interface{}) types.ItemResponse { - return func() types.ItemResponse { +func com_amazonaws_dynamodb_FilterConditionMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_FilterConditionMap_value_FromDafny(input interface{}) types.Condition { + return func() types.Condition { - return types.ItemResponse{ - Item: com_amazonaws_dynamodb_ItemResponse_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemResponse).Dtor_Item().UnwrapOr(nil)), + return types.Condition{ + AttributeValueList: com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_AttributeValueList().UnwrapOr(nil)), + ComparisonOperator: com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_ComparisonOperator()), } }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_FromDafny(input interface{}) types.BillingMode { - return func() types.BillingMode { - var u types.BillingMode +func com_amazonaws_dynamodb_QueryInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { break } } @@ -11846,79 +11981,61 @@ func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_F return u.Values()[index] }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexDescription { - return func() types.GlobalSecondaryIndexDescription { - - return types.GlobalSecondaryIndexDescription{ - IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_KeySchema().UnwrapOr(nil)), - Projection: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_Projection().UnwrapOr(nil)), - IndexStatus: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexStatus().UnwrapOr(nil)), - Backfilling: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_Backfilling().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - IndexSizeBytes: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_ItemCount().UnwrapOr(nil)), - IndexArn: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexArn().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_QueryInput_ScanIndexForward_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input interface{}) []types.AutoScalingPolicyDescription { - return func() []types.AutoScalingPolicyDescription { - var fieldValue []types.AutoScalingPolicyDescription +func com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_FromDafny(val)) + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { - return nil + return u } - b = input.(bool) - return &b + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_QueryInput_ProjectionExpression_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -11928,46 +12045,29 @@ func com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_FromDafny(input interf } }() } -func com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_QueryInput_FilterExpression_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_dynamodb_WriteRequest_PutRequest_FromDafny(input interface{}) *types.PutRequest { - return func() *types.PutRequest { +func com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.PutRequest{ - Item: com_amazonaws_dynamodb_PutRequest_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.PutRequest).Dtor_Item()), - } - }() -} -func com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -11977,19 +12077,26 @@ func com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_FromDafny(inpu } }() } -func com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { - return func() *types.ProvisionedThroughputOverride { +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - return &types.ProvisionedThroughputOverride{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_PutItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { - return func() map[string]types.ExpectedAttributeValue { - var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } @@ -11999,33 +12106,34 @@ func com_amazonaws_dynamodb_PutItemInput_Expected_FromDafny(input interface{}) m if !ok { break } - m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { - return func() types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { - - return types.ReplicaGlobalSecondaryIndexAutoScalingUpdate{ - IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate).Dtor_IndexName().UnwrapOr(nil)), - ProvisionedReadCapacityAutoScalingUpdate: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate).Dtor_ProvisionedReadCapacityAutoScalingUpdate().UnwrapOr(nil)), +func com_amazonaws_dynamodb_QueryOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + if input == nil { + return nil } - }() -} -func com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_FromDafny(input interface{}) types.ReplicaAutoScalingDescription { - return func() types.ReplicaAutoScalingDescription { - - return types.ReplicaAutoScalingDescription{ - RegionName: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_RegionName().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - ReplicaProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), - ReplicaProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), - ReplicaStatus: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_FromDafny(input interface{}) map[string]types.AttributeValue { +func com_amazonaws_dynamodb_QueryOutput_Count_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_QueryOutput_ScannedCount_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { return func() map[string]types.AttributeValue { var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { @@ -12037,40 +12145,42 @@ func com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_FromDafny(input if !ok { break } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m }() } -func com_amazonaws_dynamodb_SourceTableDetails_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement +func com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { - return func() *types.GlobalTableDescription { - if input == nil { - return nil - } - return &types.GlobalTableDescription{ - ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), - GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), - GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ParameterizedStatement_Statement_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_FromDafny(input interface{}) *string { return func() *string { var s string @@ -12084,42 +12194,127 @@ func com_amazonaws_dynamodb_ParameterizedStatement_Statement_FromDafny(input int } }() } -func com_amazonaws_dynamodb_PutItemInput_Item_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_FromDafny(input interface{}) []types.GlobalSecondaryIndex { + return func() []types.GlobalSecondaryIndex { + var fieldValue []types.GlobalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break } - m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_FromDafny(input interface{}) []types.LocalSecondaryIndex { + return func() []types.LocalSecondaryIndex { + var fieldValue []types.LocalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input interface{}) types.TableStatus { - return func() types.TableStatus { - var u types.TableStatus +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.TableStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.TableStatus).Equals(inputEnum) { - break - } - } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExportSummary_ExportArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -12135,48 +12330,27 @@ func com_amazonaws_dynamodb_ExportSummary_ExportArn_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } - }() -} -func com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i }() } -func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -12186,29 +12360,19 @@ func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_FromDafny(in } }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(input interface{}) types.GlobalTableGlobalSecondaryIndexSettingsUpdate { - return func() types.GlobalTableGlobalSecondaryIndexSettingsUpdate { - - return types.GlobalTableGlobalSecondaryIndexSettingsUpdate{ - IndexName: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_IndexName()), - ProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedWriteCapacityUnits().UnwrapOr(nil)), - ProvisionedWriteCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedWriteCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), - } + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_FromDafny(input interface{}) []types.CancellationReason { - return func() []types.CancellationReason { - var fieldValue []types.CancellationReason +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -12216,26 +12380,35 @@ func com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_Fro val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_CancellationReasonList_member_FromDafny(val)) } - return fieldValue + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { - return func() types.ApproximateCreationDateTimePrecision { - var u types.ApproximateCreationDateTimePrecision +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { break } } @@ -12243,9 +12416,9 @@ func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreat return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_FromDafny(input interface{}) []types.AttributeValue { - return func() []types.AttributeValue { - var fieldValue []types.AttributeValue +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_FromDafny(input interface{}) []types.GlobalSecondaryIndex { + return func() []types.GlobalSecondaryIndex { + var fieldValue []types.GlobalSecondaryIndex if input == nil { return nil } @@ -12254,55 +12427,95 @@ func com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_FromDafny( if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_FromDafny(input interface{}) []types.LocalSecondaryIndex { + return func() []types.LocalSecondaryIndex { + var fieldValue []types.LocalSecondaryIndex if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input interface{}) *types.CsvOptions { - return func() *types.CsvOptions { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { if input == nil { return nil } - return &types.CsvOptions{ - Delimiter: com_amazonaws_dynamodb_CsvOptions_Delimiter_FromDafny(input.(ComAmazonawsDynamodbTypes.CsvOptions).Dtor_Delimiter().UnwrapOr(nil)), - HeaderList: com_amazonaws_dynamodb_CsvOptions_HeaderList_FromDafny(input.(ComAmazonawsDynamodbTypes.CsvOptions).Dtor_HeaderList().UnwrapOr(nil)), + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), } }() } -func com_amazonaws_dynamodb_ListTablesOutput_TableNames_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_TableNameList_member_FromDafny(val)) + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { + if input == nil { + return nil + } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ScanInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -12316,11 +12529,13 @@ func com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_FromDafny(input interf } }() } -func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ScanInput_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -12330,43 +12545,46 @@ func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_FromDafny(input interf } }() } -func com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_ScanInput_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + return fieldValue + }() +} +func com_amazonaws_dynamodb_ScanInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil } + i = input.(int32) + return &i }() } -func com_amazonaws_dynamodb_AttributeValueUpdate_Action_FromDafny(input interface{}) types.AttributeAction { - return func() types.AttributeAction { - var u types.AttributeAction +func com_amazonaws_dynamodb_ScanInput_Select_FromDafny(input interface{}) types.Select { + return func() types.Select { + var u types.Select if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.AttributeAction) + inputEnum := input.(ComAmazonawsDynamodbTypes.Select) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeAction_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.AttributeAction).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.Select).Equals(inputEnum) { break } } @@ -12374,7 +12592,7 @@ func com_amazonaws_dynamodb_AttributeValueUpdate_Action_FromDafny(input interfac return u.Values()[index] }() } -func com_amazonaws_dynamodb_QueryInput_QueryFilter_FromDafny(input interface{}) map[string]types.Condition { +func com_amazonaws_dynamodb_ScanInput_ScanFilter_FromDafny(input interface{}) map[string]types.Condition { return func() map[string]types.Condition { var m map[string]types.Condition = make(map[string]types.Condition) if input == nil { @@ -12391,35 +12609,45 @@ func com_amazonaws_dynamodb_QueryInput_QueryFilter_FromDafny(input interface{}) return m }() } -func com_amazonaws_dynamodb_GetItemInput_Key_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_ScanInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator + if input == nil { + return u + } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_UntagResourceInput_TagKeys_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagKeyList_member_FromDafny(val)) + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { +func com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { return func() types.ReturnConsumedCapacity { var u types.ReturnConsumedCapacity if input == nil { @@ -12440,83 +12668,49 @@ func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_FromDafny(input return u.Values()[index] }() } -func com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_FromDafny(input interface{}) []types.AttributeValue { - return func() []types.AttributeValue { - var fieldValue []types.AttributeValue +func com_amazonaws_dynamodb_ScanInput_TotalSegments_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) - } - return fieldValue + i = input.(int32) + return &i }() } -func com_amazonaws_dynamodb_ParameterizedStatement_Parameters_FromDafny(input interface{}) []types.AttributeValue { - return func() []types.AttributeValue { - var fieldValue []types.AttributeValue +func com_amazonaws_dynamodb_ScanInput_Segment_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) - } - return fieldValue + i = input.(int32) + return &i }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { - return func() *types.AutoScalingSettingsUpdate { +func com_amazonaws_dynamodb_ScanInput_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.AutoScalingSettingsUpdate{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_FromDafny(input interface{}) *types.ImportTableDescription { - return func() *types.ImportTableDescription { - - return &types.ImportTableDescription{ - ImportArn: com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportArn().UnwrapOr(nil)), - ImportStatus: com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportStatus().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableId().UnwrapOr(nil)), - ClientToken: com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ClientToken().UnwrapOr(nil)), - S3BucketSource: com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_S3BucketSource().UnwrapOr(nil)), - ErrorCount: com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ErrorCount().UnwrapOr(nil)), - CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), - InputFormat: com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormat().UnwrapOr(nil)), - InputFormatOptions: com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormatOptions().UnwrapOr(nil)), - InputCompressionType: com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputCompressionType().UnwrapOr(nil)), - TableCreationParameters: com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableCreationParameters().UnwrapOr(nil)), - StartTime: com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_StartTime().UnwrapOr(nil)), - EndTime: com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_EndTime().UnwrapOr(nil)), - ProcessedSizeBytes: com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedSizeBytes().UnwrapOr(nil)), - ProcessedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedItemCount().UnwrapOr(nil)), - ImportedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportedItemCount().UnwrapOr(nil)), - FailureCode: com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureCode().UnwrapOr(nil)), - FailureMessage: com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureMessage().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ScanInput_FilterExpression_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -12526,75 +12720,53 @@ func com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_FromDafny(input interface{}) []types.GlobalTableGlobalSecondaryIndexSettingsUpdate { - return func() []types.GlobalTableGlobalSecondaryIndexSettingsUpdate { - var fieldValue []types.GlobalTableGlobalSecondaryIndexSettingsUpdate +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - b = input.(bool) - return &b + return m }() } -func com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ListExportsInput_MaxResults_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_ScanInput_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - i = input.(int32) - return &i - }() -} -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_ScanOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue if input == nil { return nil } @@ -12602,38 +12774,52 @@ func com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_FromDafny(input val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) + return fieldValue + }() +} +func com_amazonaws_dynamodb_ScanOutput_Count_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_ScanOutput_ScannedCount_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } - return &t + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ImportConflictException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TagResourceInput_ResourceArn_FromDafny(input interface{}) *string { return func() *string { var s string @@ -12647,67 +12833,68 @@ func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_TagResourceInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } +func com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_FromDafny(input interface{}) []types.TransactGetItem { + return func() []types.TransactGetItem { + var fieldValue []types.TransactGetItem + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TransactGetItemList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil +func com_amazonaws_dynamodb_TransactGetItemList_member_FromDafny(input interface{}) types.TransactGetItem { + return func() types.TransactGetItem { + + return types.TransactGetItem{ + Get: com_amazonaws_dynamodb_TransactGetItem_Get_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactGetItem).Dtor_Get()), } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + }() +} +func com_amazonaws_dynamodb_TransactGetItem_Get_FromDafny(input interface{}) *types.Get { + return func() *types.Get { + + return &types.Get{ + Key: com_amazonaws_dynamodb_Get_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_Key()), + TableName: com_amazonaws_dynamodb_Get_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_TableName()), + ProjectionExpression: com_amazonaws_dynamodb_Get_ProjectionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_ProjectionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_Get_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_StringSetAttributeValue_member_FromDafny(input interface{}) string { - return func() string { - var s string +func com_amazonaws_dynamodb_Get_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_UpdateTableInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_Get_TableName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -12721,78 +12908,53 @@ func com_amazonaws_dynamodb_UpdateTableInput_TableName_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { - return func() *types.TableDescription { +func com_amazonaws_dynamodb_Get_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.TableDescription{ - AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), - TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), - BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), - LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), - LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), - GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), - RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), - SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), - ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), - TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), - DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_Get_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) } - return &t + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { - return func() types.ReturnItemCollectionMetrics { - var u types.ReturnItemCollectionMetrics +func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { break } } @@ -12800,75 +12962,97 @@ func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_From return u.Values()[index] }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_FromDafny(input interface{}) *types.Projection { - return func() *types.Projection { +func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity if input == nil { return nil } - return &types.Projection{ - ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), - NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_FromDafny(input interface{}) []types.ItemResponse { + return func() []types.ItemResponse { + var fieldValue []types.ItemResponse if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { - return func() *types.ProvisionedThroughputOverride { - if input == nil { - return nil +func com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_FromDafny(input interface{}) []types.TransactWriteItem { + return func() []types.TransactWriteItem { + var fieldValue []types.TransactWriteItem + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TransactWriteItemList_member_FromDafny(val)) } - return &types.ProvisionedThroughputOverride{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + return fieldValue + }() +} +func com_amazonaws_dynamodb_TransactWriteItemList_member_FromDafny(input interface{}) types.TransactWriteItem { + return func() types.TransactWriteItem { + + return types.TransactWriteItem{ + ConditionCheck: com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_ConditionCheck().UnwrapOr(nil)), + Put: com_amazonaws_dynamodb_TransactWriteItem_Put_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Put().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_TransactWriteItem_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Delete().UnwrapOr(nil)), + Update: com_amazonaws_dynamodb_TransactWriteItem_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Update().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { - return func() *types.TableClassSummary { +func com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_FromDafny(input interface{}) *types.ConditionCheck { + return func() *types.ConditionCheck { if input == nil { return nil } - return &types.TableClassSummary{ - TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), - LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), + return &types.ConditionCheck{ + Key: com_amazonaws_dynamodb_ConditionCheck_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_Key()), + TableName: com_amazonaws_dynamodb_ConditionCheck_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_TableName()), + ConditionExpression: com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ConditionExpression()), + ExpressionAttributeNames: com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ConditionCheck_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_QueryInput_FilterExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ConditionCheck_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -12878,34 +13062,11 @@ func com_amazonaws_dynamodb_QueryInput_FilterExpression_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input interface{}) types.TimeToLiveStatus { - return func() types.TimeToLiveStatus { - var u types.TimeToLiveStatus - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.TimeToLiveStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TimeToLiveStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.TimeToLiveStatus).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_InvalidExportTimeException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -12915,88 +13076,95 @@ func com_amazonaws_dynamodb_InvalidExportTimeException_message_FromDafny(input i } }() } -func com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_NumberSetAttributeValue_member_FromDafny(val)) + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] - } else { - b = append(b, val.(byte)) + break } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_FromDafny(input interface{}) *types.Projection { - return func() *types.Projection { +func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { + return func() types.ReturnValuesOnConditionCheckFailure { + var u types.ReturnValuesOnConditionCheckFailure if input == nil { - return nil + return u } - return &types.Projection{ - ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), - NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_TransactWriteItem_Put_FromDafny(input interface{}) *types.Put { + return func() *types.Put { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.Put{ + Item: com_amazonaws_dynamodb_Put_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_Item()), + TableName: com_amazonaws_dynamodb_Put_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_TableName()), + ConditionExpression: com_amazonaws_dynamodb_Put_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_Put_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_Put_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_Put_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] - } else { - b = append(b, val.(byte)) + break } + m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_Put_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13006,7 +13174,7 @@ func com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input inte } }() } -func com_amazonaws_dynamodb_TransactionCanceledException_Message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_Put_ConditionExpression_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -13022,54 +13190,41 @@ func com_amazonaws_dynamodb_TransactionCanceledException_Message_FromDafny(input } }() } -func com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil - } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { - return func() *types.ItemCollectionMetrics { +func com_amazonaws_dynamodb_Put_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - return &types.ItemCollectionMetrics{ - ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), - SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_FailureException_ExceptionDescription_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_Put_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { +func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { return func() types.ReturnValuesOnConditionCheckFailure { var u types.ReturnValuesOnConditionCheckFailure if input == nil { @@ -13090,13 +13245,40 @@ func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_F return u.Values()[index] }() } -func com_amazonaws_dynamodb_InvalidRestoreTimeException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_TransactWriteItem_Delete_FromDafny(input interface{}) *types.Delete { + return func() *types.Delete { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + return &types.Delete{ + Key: com_amazonaws_dynamodb_Delete_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_Key()), + TableName: com_amazonaws_dynamodb_Delete_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_TableName()), + ConditionExpression: com_amazonaws_dynamodb_Delete_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Delete_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Delete_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13106,80 +13288,70 @@ func com_amazonaws_dynamodb_InvalidRestoreTimeException_message_FromDafny(input } }() } -func com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_FromDafny(input interface{}) []types.ItemResponse { - return func() []types.ItemResponse { - var fieldValue []types.ItemResponse +func com_amazonaws_dynamodb_Delete_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(val)) } - return fieldValue - }() -} -func com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - - b = input.(bool) - return &b }() } -func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { +func com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) } - return &t + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input interface{}) types.S3SseAlgorithm { - return func() types.S3SseAlgorithm { - var u types.S3SseAlgorithm +func com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { + return func() types.ReturnValuesOnConditionCheckFailure { + var u types.ReturnValuesOnConditionCheckFailure if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.S3SseAlgorithm) + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { break } } @@ -13187,88 +13359,6 @@ func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input int return u.Values()[index] }() } -func com_amazonaws_dynamodb_MapAttributeValue_value_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue - - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - }() -} -func com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} func com_amazonaws_dynamodb_TransactWriteItem_Update_FromDafny(input interface{}) *types.Update { return func() *types.Update { if input == nil { @@ -13285,13 +13375,25 @@ func com_amazonaws_dynamodb_TransactWriteItem_Update_FromDafny(input interface{} } }() } -func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_Update_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Update_UpdateExpression_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13301,32 +13403,21 @@ func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_FromDafny(in } }() } -func com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_Update_TableName_FromDafny(input interface{}) *string { + return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_dynamodb_ListImportsInput_TableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_Update_ConditionExpression_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -13342,69 +13433,104 @@ func com_amazonaws_dynamodb_ListImportsInput_TableArn_FromDafny(input interface{ } }() } -func com_amazonaws_dynamodb_QueryInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_dynamodb_Update_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - i = input.(int32) - return &i + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m }() } -func com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { +func com_amazonaws_dynamodb_Update_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { - return func() *types.AutoScalingSettingsDescription { +func com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { + return func() types.ReturnValuesOnConditionCheckFailure { + var u types.ReturnValuesOnConditionCheckFailure if input == nil { - return nil + return u } - return &types.AutoScalingSettingsDescription{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { - return func() *types.OnDemandThroughputOverride { +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity if input == nil { - return nil + return u } - return &types.OnDemandThroughputOverride{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -13420,7 +13546,7 @@ func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_FromDafny(input } }() } -func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { return func() []types.ConsumedCapacity { var fieldValue []types.ConsumedCapacity if input == nil { @@ -13436,7 +13562,24 @@ func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_FromDafny(in return fieldValue }() } -func com_amazonaws_dynamodb_Tag_Value_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_FromDafny(input interface{}) map[string][]types.ItemCollectionMetrics { + return func() map[string][]types.ItemCollectionMetrics { + var m map[string][]types.ItemCollectionMetrics = make(map[string][]types.ItemCollectionMetrics) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_FromDafny(input interface{}) *string { return func() *string { var s string @@ -13450,57 +13593,39 @@ func com_amazonaws_dynamodb_Tag_Value_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_FromDafny(input interface{}) *types.Projection { - return func() *types.Projection { - if input == nil { - return nil - } - return &types.Projection{ - ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), - NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_BackupSummaries_member_FromDafny(input interface{}) types.BackupSummary { - return func() types.BackupSummary { +func com_amazonaws_dynamodb_UntagResourceInput_TagKeys_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string - return types.BackupSummary{ - TableName: com_amazonaws_dynamodb_BackupSummary_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableName().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_BackupSummary_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableId().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_BackupSummary_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableArn().UnwrapOr(nil)), - BackupArn: com_amazonaws_dynamodb_BackupSummary_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupArn().UnwrapOr(nil)), - BackupName: com_amazonaws_dynamodb_BackupSummary_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupName().UnwrapOr(nil)), - BackupCreationDateTime: com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupCreationDateTime().UnwrapOr(nil)), - BackupExpiryDateTime: com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), - BackupStatus: com_amazonaws_dynamodb_BackupSummary_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupStatus().UnwrapOr(nil)), - BackupType: com_amazonaws_dynamodb_BackupSummary_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupType().UnwrapOr(nil)), - BackupSizeBytes: com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupSizeBytes().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagKeyList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_BackupNotFoundException_message_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_TagKeyList_member_FromDafny(input interface{}) string { + return func() string { var s string - if input == nil { - return nil - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_BatchStatementResponse_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13510,73 +13635,82 @@ func com_amazonaws_dynamodb_BatchStatementResponse_TableName_FromDafny(input int } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 - if input == nil { - return nil +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_FromDafny(input interface{}) *types.PointInTimeRecoverySpecification { + return func() *types.PointInTimeRecoverySpecification { + + return &types.PointInTimeRecoverySpecification{ + PointInTimeRecoveryEnabled: com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification).Dtor_PointInTimeRecoveryEnabled()), } - i = input.(int64) - return &i }() } -func com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool - i = input.(int64) - return &i + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_FromDafny(input interface{}) *types.CreateReplicationGroupMemberAction { - return func() *types.CreateReplicationGroupMemberAction { +func com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(input interface{}) *types.ContinuousBackupsDescription { + return func() *types.ContinuousBackupsDescription { if input == nil { return nil } - return &types.CreateReplicationGroupMemberAction{ - RegionName: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_RegionName()), - KMSMasterKeyId: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_KMSMasterKeyId().UnwrapOr(nil)), - ProvisionedThroughputOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), - OnDemandThroughputOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - TableClassOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_TableClassOverride().UnwrapOr(nil)), + return &types.ContinuousBackupsDescription{ + ContinuousBackupsStatus: com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_ContinuousBackupsStatus()), + PointInTimeRecoveryDescription: com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_PointInTimeRecoveryDescription().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_FromDafny(input interface{}) []types.BatchStatementResponse { - return func() []types.BatchStatementResponse { - var fieldValue []types.BatchStatementResponse - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_PartiQLBatchResponse_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_ItemResponse_Item_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_FromDafny(input interface{}) types.ContributorInsightsAction { + return func() types.ContributorInsightsAction { + var u types.ContributorInsightsAction + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsAction) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsAction_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsAction).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -13592,66 +13726,95 @@ func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDaf } }() } -func com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ImportSummary_EndTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { + return func() types.ContributorInsightsStatus { + var u types.ContributorInsightsStatus if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicaUpdate { + return func() []types.ReplicaUpdate { + var fieldValue []types.ReplicaUpdate + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } - return &t + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaUpdateList_member_FromDafny(input interface{}) types.ReplicaUpdate { + return func() types.ReplicaUpdate { + + return types.ReplicaUpdate{ + Create: com_amazonaws_dynamodb_ReplicaUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaUpdate).Dtor_Create().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_ReplicaUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaUpdate).Dtor_Delete().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_FromDafny(input interface{}) *types.UpdateGlobalSecondaryIndexAction { - return func() *types.UpdateGlobalSecondaryIndexAction { +func com_amazonaws_dynamodb_ReplicaUpdate_Create_FromDafny(input interface{}) *types.CreateReplicaAction { + return func() *types.CreateReplicaAction { if input == nil { return nil } - return &types.UpdateGlobalSecondaryIndexAction{ - IndexName: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_IndexName()), - ProvisionedThroughput: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_OnDemandThroughput().UnwrapOr(nil)), + return &types.CreateReplicaAction{ + RegionName: com_amazonaws_dynamodb_CreateReplicaAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicaAction).Dtor_RegionName()), } }() } -func com_amazonaws_dynamodb_BackupSummary_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13661,13 +13824,21 @@ func com_amazonaws_dynamodb_BackupSummary_TableName_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ReplicaUpdate_Delete_FromDafny(input interface{}) *types.DeleteReplicaAction { + return func() *types.DeleteReplicaAction { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + return &types.DeleteReplicaAction{ + RegionName: com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteReplicaAction).Dtor_RegionName()), + } + }() +} +func com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13677,159 +13848,25 @@ func com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input int } }() } -func com_amazonaws_dynamodb_AttributeMap_value_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue - - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), - } - } - - return union - }() -} -func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny(input interface{}) types.Capacity { - return func() types.Capacity { - - return types.Capacity{ - ReadCapacityUnits: com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_CapacityUnits().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue - - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } +func com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { + return func() *types.GlobalTableDescription { + if input == nil { + return nil } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), - } + return &types.GlobalTableDescription{ + ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), + GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), + GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), } - - return union }() } -func com_amazonaws_dynamodb_Update_ConditionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13839,100 +13876,136 @@ func com_amazonaws_dynamodb_Update_ConditionExpression_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexSettingsUpdate { - return func() types.ReplicaGlobalSecondaryIndexSettingsUpdate { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } - return types.ReplicaGlobalSecondaryIndexSettingsUpdate{ - IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_IndexName()), - ProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedReadCapacityUnits().UnwrapOr(nil)), - ProvisionedReadCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedReadCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_CreateTableInput_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } - return fieldValue + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_FromDafny(input interface{}) *types.Projection { - return func() *types.Projection { - - return &types.Projection{ - ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), - NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_TransactGetItem_Get_FromDafny(input interface{}) *types.Get { - return func() *types.Get { - - return &types.Get{ - Key: com_amazonaws_dynamodb_Get_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_Key()), - TableName: com_amazonaws_dynamodb_Get_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_TableName()), - ProjectionExpression: com_amazonaws_dynamodb_Get_ProjectionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_ProjectionExpression().UnwrapOr(nil)), - ExpressionAttributeNames: com_amazonaws_dynamodb_Get_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { - return func() *types.EnableKinesisStreamingConfiguration { +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - return &types.EnableKinesisStreamingConfiguration{ - ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), - } + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_FromDafny(input interface{}) float64 { - return func() float64 { - var b []byte - +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input interface{}) *types.AutoScalingPolicyUpdate { + return func() *types.AutoScalingPolicyUpdate { + if input == nil { + return nil + } + return &types.AutoScalingPolicyUpdate{ + PolicyName: com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyUpdate).Dtor_PolicyName().UnwrapOr(nil)), + TargetTrackingScalingPolicyConfiguration: com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyUpdate).Dtor_TargetTrackingScalingPolicyConfiguration()), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_FromDafny(input interface{}) *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + return func() *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + + return &types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{ + DisableScaleIn: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_DisableScaleIn().UnwrapOr(nil)), + ScaleInCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_ScaleInCooldown().UnwrapOr(nil)), + ScaleOutCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_ScaleOutCooldown().UnwrapOr(nil)), + TargetValue: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_TargetValue()), } }() } -func com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_FromDafny(input interface{}) *bool { return func() *bool { var b bool if input == nil { @@ -13942,52 +14015,71 @@ func com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_FromDafny return &b }() } -func com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny(input interface{}) string { - return func() string { - var s string +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_FromDafny(input interface{}) []types.GlobalTableGlobalSecondaryIndexSettingsUpdate { + return func() []types.GlobalTableGlobalSecondaryIndexSettingsUpdate { + var fieldValue []types.GlobalTableGlobalSecondaryIndexSettingsUpdate if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexAutoScalingUpdate { - return func() types.GlobalSecondaryIndexAutoScalingUpdate { +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(input interface{}) types.GlobalTableGlobalSecondaryIndexSettingsUpdate { + return func() types.GlobalTableGlobalSecondaryIndexSettingsUpdate { - return types.GlobalSecondaryIndexAutoScalingUpdate{ - IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate).Dtor_IndexName().UnwrapOr(nil)), - ProvisionedWriteCapacityAutoScalingUpdate: com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate).Dtor_ProvisionedWriteCapacityAutoScalingUpdate().UnwrapOr(nil)), + return types.GlobalTableGlobalSecondaryIndexSettingsUpdate{ + IndexName: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_IndexName()), + ProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedWriteCapacityUnits().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedWriteCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ReplicaDescription_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -13997,36 +14089,33 @@ func com_amazonaws_dynamodb_ReplicaDescription_RegionName_FromDafny(input interf } }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), - } + i = input.(int64) + return &i }() } -func com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_FromDafny(input interface{}) []types.ReplicaSettingsUpdate { + return func() []types.ReplicaSettingsUpdate { + var fieldValue []types.ReplicaSettingsUpdate if input == nil { return nil } @@ -14034,28 +14123,29 @@ func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDat val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_FromDafny(val)) } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_FromDafny(input interface{}) types.ReplicaSettingsUpdate { + return func() types.ReplicaSettingsUpdate { + + return types.ReplicaSettingsUpdate{ + RegionName: com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_RegionName()), + ReplicaProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaProvisionedReadCapacityUnits().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), + ReplicaGlobalSecondaryIndexSettingsUpdate: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaGlobalSecondaryIndexSettingsUpdate().UnwrapOr(nil)), + ReplicaTableClass: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaTableClass().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -14065,52 +14155,57 @@ func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_Fr } }() } -func com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndex { - return func() []types.LocalSecondaryIndex { - var fieldValue []types.LocalSecondaryIndex +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexSettingsUpdate { + return func() []types.ReplicaGlobalSecondaryIndexSettingsUpdate { + var fieldValue []types.ReplicaGlobalSecondaryIndexSettingsUpdate if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input interface{}) *types.RestoreSummary { - return func() *types.RestoreSummary { - if input == nil { - return nil - } - return &types.RestoreSummary{ - SourceBackupArn: com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_SourceBackupArn().UnwrapOr(nil)), - SourceTableArn: com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_SourceTableArn().UnwrapOr(nil)), - RestoreDateTime: com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_RestoreDateTime()), - RestoreInProgress: com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_RestoreInProgress()), +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexSettingsUpdate { + return func() types.ReplicaGlobalSecondaryIndexSettingsUpdate { + + return types.ReplicaGlobalSecondaryIndexSettingsUpdate{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_IndexName()), + ProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedReadCapacityUnits().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedReadCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_PutItemInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -14124,70 +14219,88 @@ func com_amazonaws_dynamodb_PutItemInput_TableName_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { if input == nil { return nil } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_MapAttributeValue_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_FromDafny(input interface{}) *types.UpdateKinesisStreamingConfiguration { - return func() *types.UpdateKinesisStreamingConfiguration { +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_FromDafny(input interface{}) []types.ReplicaSettingsDescription { + return func() []types.ReplicaSettingsDescription { + var fieldValue []types.ReplicaSettingsDescription if input == nil { return nil } - return &types.UpdateKinesisStreamingConfiguration{ - ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateItemInput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -14211,65 +14324,49 @@ func com_amazonaws_dynamodb_UpdateItemInput_Key_FromDafny(input interface{}) map return m }() } -func com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { - return func() types.ConditionalOperator { - var u types.ConditionalOperator - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { - return func() types.ReturnConsumedCapacity { - var u types.ReturnConsumedCapacity +func com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_FromDafny(input interface{}) map[string]types.AttributeValueUpdate { + return func() map[string]types.AttributeValueUpdate { + var m map[string]types.AttributeValueUpdate = make(map[string]types.AttributeValueUpdate) if input == nil { - return u + return nil } - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break } + m[com_amazonaws_dynamodb_AttributeUpdates_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeUpdates_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return u.Values()[index] + return m }() } -func com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_dynamodb_AttributeUpdates_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_FromDafny(input interface{}) types.AttributeValue { +func com_amazonaws_dynamodb_AttributeUpdates_value_FromDafny(input interface{}) types.AttributeValueUpdate { + return func() types.AttributeValueUpdate { + + return types.AttributeValueUpdate{ + Value: com_amazonaws_dynamodb_AttributeValueUpdate_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeValueUpdate).Dtor_Value().UnwrapOr(nil)), + Action: com_amazonaws_dynamodb_AttributeValueUpdate_Action_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeValueUpdate).Dtor_Action().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_AttributeValueUpdate_Value_FromDafny(input interface{}) types.AttributeValue { return func() types.AttributeValue { var union types.AttributeValue if input == nil { @@ -14340,36 +14437,30 @@ func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_FromDafny(input interfa return union }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_AttributeValueUpdate_Action_FromDafny(input interface{}) types.AttributeAction { + return func() types.AttributeAction { + var u types.AttributeAction if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsDynamodbTypes.AttributeAction) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeAction_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.AttributeAction).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { - if input == nil { - return nil - } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_UpdateItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { + return func() map[string]types.ExpectedAttributeValue { + var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) if input == nil { return nil } @@ -14379,28 +14470,54 @@ func com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_FromDafny(input interfa if !ok { break } - m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m }() } -func com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { - return func() []types.AttributeDefinition { - var fieldValue []types.AttributeDefinition +func com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { + return func() types.ReturnValue { + var u types.ReturnValue + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { +func com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { return func() types.ReturnConsumedCapacity { var u types.ReturnConsumedCapacity if input == nil { @@ -14421,7 +14538,28 @@ func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_FromDafny(input return u.Values()[index] }() } -func com_amazonaws_dynamodb_PutItemInput_ConditionExpression_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -14437,9 +14575,25 @@ func com_amazonaws_dynamodb_PutItemInput_ConditionExpression_FromDafny(input int } }() } -func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } @@ -14449,24 +14603,34 @@ func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_FromDafny( if !ok { break } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m }() } -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) if input == nil { return nil } - b = input.(bool) - return &b + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m }() } -func com_amazonaws_dynamodb_ItemList_member_FromDafny(input interface{}) map[string]types.AttributeValue { +func com_amazonaws_dynamodb_UpdateItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { return func() map[string]types.AttributeValue { var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() @@ -14478,83 +14642,93 @@ func com_amazonaws_dynamodb_ItemList_member_FromDafny(input interface{}) map[str return m }() } -func com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input interface{}) types.ProjectionType { - return func() types.ProjectionType { - var u types.ProjectionType +func com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ProjectionType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ProjectionType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ProjectionType).Equals(inputEnum) { - break - } - } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(input interface{}) *types.ContinuousBackupsDescription { - return func() *types.ContinuousBackupsDescription { +func com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { + return func() *types.ItemCollectionMetrics { if input == nil { return nil } - return &types.ContinuousBackupsDescription{ - ContinuousBackupsStatus: com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_ContinuousBackupsStatus()), - PointInTimeRecoveryDescription: com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_PointInTimeRecoveryDescription().UnwrapOr(nil)), + return &types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { + return func() *string { var s string - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexSettingsDescription { - return func() types.ReplicaGlobalSecondaryIndexSettingsDescription { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string - return types.ReplicaGlobalSecondaryIndexSettingsDescription{ - IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_IndexName()), - IndexStatus: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_IndexStatus().UnwrapOr(nil)), - ProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedReadCapacityUnits().UnwrapOr(nil)), - ProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), - ProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedWriteCapacityUnits().UnwrapOr(nil)), - ProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_Put_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_FromDafny(input interface{}) *types.UpdateKinesisStreamingConfiguration { + return func() *types.UpdateKinesisStreamingConfiguration { if input == nil { return nil } + return &types.UpdateKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { + return func() types.ApproximateCreationDateTimePrecision { + var u types.ApproximateCreationDateTimePrecision + if input == nil { + return u + } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_Replica_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -14570,21 +14744,13 @@ func com_amazonaws_dynamodb_Replica_RegionName_FromDafny(input interface{}) *str } }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { - return func() *int64 { - var i int64 +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - i = input.(int64) - return &i - }() -} -func com_amazonaws_dynamodb_GetItemInput_TableName_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -14594,42 +14760,40 @@ func com_amazonaws_dynamodb_GetItemInput_TableName_FromDafny(input interface{}) } }() } -func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + break + } } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_FromDafny(input interface{}) *types.UpdateKinesisStreamingConfiguration { + return func() *types.UpdateKinesisStreamingConfiguration { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.UpdateKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndexInfo { - return func() []types.LocalSecondaryIndexInfo { - var fieldValue []types.LocalSecondaryIndexInfo +func com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition if input == nil { return nil } @@ -14638,39 +14802,39 @@ func com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_From if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexes_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_FromDafny(input interface{}) []types.TransactWriteItem { - return func() []types.TransactWriteItem { - var fieldValue []types.TransactWriteItem +func com_amazonaws_dynamodb_UpdateTableInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_TransactWriteItemList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input interface{}) types.ImportStatus { - return func() types.ImportStatus { - var u types.ImportStatus +func com_amazonaws_dynamodb_UpdateTableInput_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ImportStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ImportStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { break } } @@ -14678,25 +14842,20 @@ func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input return u.Values()[index] }() } -func com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { - return func() *types.ConsumedCapacity { +func com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { if input == nil { return nil } - return &types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), } }() } -func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.GlobalSecondaryIndexUpdate { + return func() []types.GlobalSecondaryIndexUpdate { + var fieldValue []types.GlobalSecondaryIndexUpdate if input == nil { return nil } @@ -14704,77 +14863,39 @@ func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTim val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) } - return &t + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_FromDafny(input interface{}) int64 { - return func() int64 { - var i int64 - - i = input.(int64) - return i - }() -} -func com_amazonaws_dynamodb_Put_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) - if input == nil { - return nil - } +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexUpdate { + return func() types.GlobalSecondaryIndexUpdate { - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return types.GlobalSecondaryIndexUpdate{ + Update: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Update().UnwrapOr(nil)), + Create: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Create().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Delete().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_GetItemInput_ConsistentRead_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_FromDafny(input interface{}) *types.UpdateGlobalSecondaryIndexAction { + return func() *types.UpdateGlobalSecondaryIndexAction { if input == nil { return nil } - b = input.(bool) - return &b - }() -} -func com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_FromDafny(input interface{}) map[string][]types.WriteRequest { - return func() map[string][]types.WriteRequest { - var m map[string][]types.WriteRequest = make(map[string][]types.WriteRequest) - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return &types.UpdateGlobalSecondaryIndexAction{ + IndexName: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_IndexName()), + ProvisionedThroughput: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_OnDemandThroughput().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -14784,91 +14905,43 @@ func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_FromDafny( } }() } -func com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } - }() -} -func com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { - return func() types.ReturnValuesOnConditionCheckFailure { - var u types.ReturnValuesOnConditionCheckFailure - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), } - b = input.(bool) - return &b }() } -func com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { - return func() *types.ConsumedCapacity { +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { if input == nil { return nil } - return &types.ConsumedCapacity{ - TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), - ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(input interface{}) *types.TableAutoScalingDescription { - return func() *types.TableAutoScalingDescription { +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_FromDafny(input interface{}) *types.CreateGlobalSecondaryIndexAction { + return func() *types.CreateGlobalSecondaryIndexAction { if input == nil { return nil } - return &types.TableAutoScalingDescription{ - TableName: com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableName().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableStatus().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_Replicas().UnwrapOr(nil)), + return &types.CreateGlobalSecondaryIndexAction{ + IndexName: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_IndexName()), + KeySchema: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_KeySchema()), + Projection: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_Projection()), + ProvisionedThroughput: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_OnDemandThroughput().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_CreateTableInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -14882,104 +14955,66 @@ func com_amazonaws_dynamodb_CreateTableInput_TableName_FromDafny(input interface } }() } -func com_amazonaws_dynamodb_PartiQLBatchResponse_member_FromDafny(input interface{}) types.BatchStatementResponse { - return func() types.BatchStatementResponse { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement - return types.BatchStatementResponse{ - Error: com_amazonaws_dynamodb_BatchStatementResponse_Error_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_Error().UnwrapOr(nil)), - TableName: com_amazonaws_dynamodb_BatchStatementResponse_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_TableName().UnwrapOr(nil)), - Item: com_amazonaws_dynamodb_BatchStatementResponse_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_Item().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_FromDafny(input interface{}) *types.TableCreationParameters { - return func() *types.TableCreationParameters { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { - return &types.TableCreationParameters{ - TableName: com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_TableName()), - AttributeDefinitions: com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_AttributeDefinitions()), - KeySchema: com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_KeySchema()), - BillingMode: com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_BillingMode().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_OnDemandThroughput().UnwrapOr(nil)), - SSESpecification: com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_SSESpecification().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { - return func() *types.TableDescription { +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { if input == nil { return nil } - return &types.TableDescription{ - AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), - TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), - KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), - TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), - CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), - ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), - TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), - BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), - LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), - GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), - StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), - LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), - LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), - GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), - Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), - RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), - SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), - ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), - TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), - DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), - OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), } - }() -} -func com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) + }() +} +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_ImportSummary_TableArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_FromDafny(input interface{}) *types.DeleteGlobalSecondaryIndexAction { + return func() *types.DeleteGlobalSecondaryIndexAction { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.DeleteGlobalSecondaryIndexAction{ + IndexName: com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteGlobalSecondaryIndexAction).Dtor_IndexName()), } }() } -func com_amazonaws_dynamodb_TableNotFoundException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -14989,147 +15024,151 @@ func com_amazonaws_dynamodb_TableNotFoundException_message_FromDafny(input inter } }() } -func com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_FromDafny(input interface{}) *types.TimeToLiveDescription { - return func() *types.TimeToLiveDescription { +func com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { if input == nil { return nil } - return &types.TimeToLiveDescription{ - TimeToLiveStatus: com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_TimeToLiveStatus().UnwrapOr(nil)), - AttributeName: com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_AttributeName().UnwrapOr(nil)), + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_PutItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { - return func() types.ReturnValue { - var u types.ReturnValue +func com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { - break - } - } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicationGroupUpdate { + return func() []types.ReplicationGroupUpdate { + var fieldValue []types.ReplicationGroupUpdate if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_FromDafny(input interface{}) *types.BillingModeSummary { - return func() *types.BillingModeSummary { - if input == nil { - return nil - } - return &types.BillingModeSummary{ - BillingMode: com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_BillingMode().UnwrapOr(nil)), - LastUpdateToPayPerRequestDateTime: com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_LastUpdateToPayPerRequestDateTime().UnwrapOr(nil)), +func com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_FromDafny(input interface{}) types.ReplicationGroupUpdate { + return func() types.ReplicationGroupUpdate { + + return types.ReplicationGroupUpdate{ + Create: com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Create().UnwrapOr(nil)), + Update: com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Update().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Delete().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input interface{}) map[string]types.Capacity { - return func() map[string]types.Capacity { - var m map[string]types.Capacity = make(map[string]types.Capacity) +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_FromDafny(input interface{}) *types.CreateReplicationGroupMemberAction { + return func() *types.CreateReplicationGroupMemberAction { if input == nil { return nil } + return &types.CreateReplicationGroupMemberAction{ + RegionName: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_RegionName()), + KMSMasterKeyId: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + TableClassOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_TableClassOverride().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { if input == nil { return nil } - b = input.(bool) - return &b + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } }() } -func com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { - return func() types.ConditionalOperator { - var u types.ConditionalOperator +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndex { + return func() []types.ReplicaGlobalSecondaryIndex { + var fieldValue []types.ReplicaGlobalSecondaryIndex if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_dynamodb_InvalidEndpointException_Message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndex { + return func() types.ReplicaGlobalSecondaryIndex { + + return types.ReplicaGlobalSecondaryIndex{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_IndexName()), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -15139,65 +15178,40 @@ func com_amazonaws_dynamodb_InvalidEndpointException_Message_FromDafny(input int } }() } -func com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_FromDafny(input interface{}) types.PointInTimeRecoveryStatus { - return func() types.PointInTimeRecoveryStatus { - var u types.PointInTimeRecoveryStatus +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_PointInTimeRecoveryStatus_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus).Equals(inputEnum) { - break - } - } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - - b = input.(bool) - return &b }() } -func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { - return func() types.ContributorInsightsStatus { - var u types.ContributorInsightsStatus +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { break } } @@ -15205,24 +15219,22 @@ func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsS return u.Values()[index] }() } -func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_FromDafny(input interface{}) *types.UpdateReplicationGroupMemberAction { + return func() *types.UpdateReplicationGroupMemberAction { if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + return &types.UpdateReplicationGroupMemberAction{ + RegionName: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_RegionName()), + KMSMasterKeyId: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + TableClassOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_TableClassOverride().UnwrapOr(nil)), } - return m }() } -func com_amazonaws_dynamodb_DeleteItemInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -15236,17 +15248,7 @@ func com_amazonaws_dynamodb_DeleteItemInput_TableName_FromDafny(input interface{ } }() } -func com_amazonaws_dynamodb_WriteRequest_DeleteRequest_FromDafny(input interface{}) *types.DeleteRequest { - return func() *types.DeleteRequest { - if input == nil { - return nil - } - return &types.DeleteRequest{ - Key: com_amazonaws_dynamodb_DeleteRequest_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteRequest).Dtor_Key()), - } - }() -} -func com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -15262,43 +15264,29 @@ func com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input interfa } }() } -func com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { - - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil } - }() -} -func com_amazonaws_dynamodb_TransactWriteItemList_member_FromDafny(input interface{}) types.TransactWriteItem { - return func() types.TransactWriteItem { - - return types.TransactWriteItem{ - ConditionCheck: com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_ConditionCheck().UnwrapOr(nil)), - Put: com_amazonaws_dynamodb_TransactWriteItem_Put_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Put().UnwrapOr(nil)), - Delete: com_amazonaws_dynamodb_TransactWriteItem_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Delete().UnwrapOr(nil)), - Update: com_amazonaws_dynamodb_TransactWriteItem_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Update().UnwrapOr(nil)), + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_FromDafny(input interface{}) []types.ParameterizedStatement { - return func() []types.ParameterizedStatement { - var fieldValue []types.ParameterizedStatement - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ParameterizedStatements_member_FromDafny(val)) +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { + if input == nil { + return nil + } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { - return func() []types.ConsumedCapacity { - var fieldValue []types.ConsumedCapacity +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndex { + return func() []types.ReplicaGlobalSecondaryIndex { + var fieldValue []types.ReplicaGlobalSecondaryIndex if input == nil { return nil } @@ -15307,25 +15295,25 @@ func com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_FromDaf if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_CreateTableInput_BillingMode_FromDafny(input interface{}) types.BillingMode { - return func() types.BillingMode { - var u types.BillingMode +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass if input == nil { return u } - inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { break } } @@ -15333,14 +15321,27 @@ func com_amazonaws_dynamodb_CreateTableInput_BillingMode_FromDafny(input interfa return u.Values()[index] }() } -func com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_FromDafny(input interface{}) types.KinesisDataStreamDestination { - return func() types.KinesisDataStreamDestination { +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_FromDafny(input interface{}) *types.DeleteReplicationGroupMemberAction { + return func() *types.DeleteReplicationGroupMemberAction { + if input == nil { + return nil + } + return &types.DeleteReplicationGroupMemberAction{ + RegionName: com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteReplicationGroupMemberAction).Dtor_RegionName()), + } + }() +} +func com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string - return types.KinesisDataStreamDestination{ - StreamArn: com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_StreamArn().UnwrapOr(nil)), - DestinationStatus: com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_DestinationStatus().UnwrapOr(nil)), - DestinationStatusDescription: com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_DestinationStatusDescription().UnwrapOr(nil)), - ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } @@ -15365,7 +15366,86 @@ func com_amazonaws_dynamodb_UpdateTableInput_TableClass_FromDafny(input interfac return u.Values()[index] }() } -func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.GlobalSecondaryIndexAutoScalingUpdate { + return func() []types.GlobalSecondaryIndexAutoScalingUpdate { + var fieldValue []types.GlobalSecondaryIndexAutoScalingUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexAutoScalingUpdate { + return func() types.GlobalSecondaryIndexAutoScalingUpdate { + + return types.GlobalSecondaryIndexAutoScalingUpdate{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate).Dtor_IndexName().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingUpdate: com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate).Dtor_ProvisionedWriteCapacityAutoScalingUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -15381,66 +15461,51 @@ func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_FromDafny(i } }() } -func com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(input interface{}) *types.ContinuousBackupsDescription { - return func() *types.ContinuousBackupsDescription { +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { if input == nil { return nil } - return &types.ContinuousBackupsDescription{ - ContinuousBackupsStatus: com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_ContinuousBackupsStatus()), - PointInTimeRecoveryDescription: com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_PointInTimeRecoveryDescription().UnwrapOr(nil)), + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexSettingsUpdate { - return func() []types.ReplicaGlobalSecondaryIndexSettingsUpdate { - var fieldValue []types.ReplicaGlobalSecondaryIndexSettingsUpdate - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_FromDafny(input interface{}) *types.ExportDescription { - return func() *types.ExportDescription { +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { if input == nil { return nil } - return &types.ExportDescription{ - ExportArn: com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportArn().UnwrapOr(nil)), - ExportStatus: com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportStatus().UnwrapOr(nil)), - StartTime: com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_StartTime().UnwrapOr(nil)), - EndTime: com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_EndTime().UnwrapOr(nil)), - ExportManifest: com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportManifest().UnwrapOr(nil)), - TableArn: com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableArn().UnwrapOr(nil)), - TableId: com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableId().UnwrapOr(nil)), - ExportTime: com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportTime().UnwrapOr(nil)), - ClientToken: com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ClientToken().UnwrapOr(nil)), - S3Bucket: com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Bucket().UnwrapOr(nil)), - S3BucketOwner: com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3BucketOwner().UnwrapOr(nil)), - S3Prefix: com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Prefix().UnwrapOr(nil)), - S3SseAlgorithm: com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseAlgorithm().UnwrapOr(nil)), - S3SseKmsKeyId: com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseKmsKeyId().UnwrapOr(nil)), - FailureCode: com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureCode().UnwrapOr(nil)), - FailureMessage: com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureMessage().UnwrapOr(nil)), - ExportFormat: com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportFormat().UnwrapOr(nil)), - BilledSizeBytes: com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_BilledSizeBytes().UnwrapOr(nil)), - ItemCount: com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ItemCount().UnwrapOr(nil)), - ExportType: com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportType().UnwrapOr(nil)), - IncrementalExportSpecification: com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_IncrementalExportSpecification().UnwrapOr(nil)), + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input interface{}) []types.ReplicaAutoScalingDescription { - return func() []types.ReplicaAutoScalingDescription { - var fieldValue []types.ReplicaAutoScalingDescription +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicaAutoScalingUpdate { + return func() []types.ReplicaAutoScalingUpdate { + var fieldValue []types.ReplicaAutoScalingUpdate if input == nil { return nil } @@ -15449,26 +15514,38 @@ func com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input interface{}) *types.Capacity { - return func() *types.Capacity { - if input == nil { - return nil +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_FromDafny(input interface{}) types.ReplicaAutoScalingUpdate { + return func() types.ReplicaAutoScalingUpdate { + + return types.ReplicaAutoScalingUpdate{ + RegionName: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_RegionName()), + ReplicaGlobalSecondaryIndexUpdates: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_ReplicaGlobalSecondaryIndexUpdates().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingUpdate: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_ReplicaProvisionedReadCapacityAutoScalingUpdate().UnwrapOr(nil)), } - return &types.Capacity{ - ReadCapacityUnits: com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), - WriteCapacityUnits: com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), - CapacityUnits: com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_CapacityUnits().UnwrapOr(nil)), + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_GetItemInput_AttributesToGet_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + return func() []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + var fieldValue []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate if input == nil { return nil } @@ -15477,48 +15554,21 @@ func com_amazonaws_dynamodb_GetItemInput_AttributesToGet_FromDafny(input interfa if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_ScanInput_Select_FromDafny(input interface{}) types.Select { - return func() types.Select { - var u types.Select - if input == nil { - return u - } +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + return func() types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { - inputEnum := input.(ComAmazonawsDynamodbTypes.Select) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.Select).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_dynamodb_TransactWriteItem_Delete_FromDafny(input interface{}) *types.Delete { - return func() *types.Delete { - if input == nil { - return nil - } - return &types.Delete{ - Key: com_amazonaws_dynamodb_Delete_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_Key()), - TableName: com_amazonaws_dynamodb_Delete_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_TableName()), - ConditionExpression: com_amazonaws_dynamodb_Delete_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ConditionExpression().UnwrapOr(nil)), - ExpressionAttributeNames: com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), - ExpressionAttributeValues: com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), - ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), + return types.ReplicaGlobalSecondaryIndexAutoScalingUpdate{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate).Dtor_IndexName().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingUpdate: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate).Dtor_ProvisionedReadCapacityAutoScalingUpdate().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -15534,202 +15584,184 @@ func com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input interface{ } }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { - return func() *types.AutoScalingSettingsDescription { +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { if input == nil { return nil } - return &types.AutoScalingSettingsDescription{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_BatchGetResponseMap_value_FromDafny(input interface{}) []map[string]types.AttributeValue { - return func() []map[string]types.AttributeValue { - var fieldValue []map[string]types.AttributeValue +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(input interface{}) *types.TableAutoScalingDescription { + return func() *types.TableAutoScalingDescription { + if input == nil { + return nil + } + return &types.TableAutoScalingDescription{ + TableName: com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableName().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableStatus().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_Replicas().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(input interface{}) types.AttributeValue { - return func() types.AttributeValue { - var union types.AttributeValue +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_FromDafny(input interface{}) *types.TimeToLiveSpecification { + return func() *types.TimeToLiveSpecification { - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) - union = &types.AttributeValueMemberS{ - Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) - union = &types.AttributeValueMemberN{ - Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) - union = &types.AttributeValueMemberB{ - Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) - union = &types.AttributeValueMemberSS{ - Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) - union = &types.AttributeValueMemberNS{ - Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) - union = &types.AttributeValueMemberBS{ - Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) - union = &types.AttributeValueMemberM{ - Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) - union = &types.AttributeValueMemberL{ - Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) - union = &types.AttributeValueMemberNULL{ - Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), - } - } - if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { - var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) - union = &types.AttributeValueMemberBOOL{ - Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), - } + return &types.TimeToLiveSpecification{ + Enabled: com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_Enabled()), + AttributeName: com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_AttributeName()), } - - return union }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { - return func() *types.AutoScalingSettingsDescription { - if input == nil { - return nil - } - return &types.AutoScalingSettingsDescription{ - MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), - MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), - AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), - AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), - ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), - } +func com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + + b = input.(bool) + return &b }() } -func com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_FromDafny(input interface{}) map[string]types.KeysAndAttributes { - return func() map[string]types.KeysAndAttributes { - var m map[string]types.KeysAndAttributes = make(map[string]types.KeysAndAttributes) +func com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input interface{}) *string { + return func() *string { + var s string - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_ScanInput_AttributesToGet_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_FromDafny(input interface{}) *types.TimeToLiveSpecification { + return func() *types.TimeToLiveSpecification { + if input == nil { + return nil + } + return &types.TimeToLiveSpecification{ + Enabled: com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_Enabled()), + AttributeName: com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_AttributeName()), + } + }() +} +func com_amazonaws_dynamodb_BackupInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_AttributeValue_B_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_dynamodb_BackupNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_FromDafny(input interface{}) *types.SSESpecification { - return func() *types.SSESpecification { +func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.SSESpecification{ - Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), - SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), - KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_FromDafny(input interface{}) types.ItemCollectionMetrics { - return func() types.ItemCollectionMetrics { - - return types.ItemCollectionMetrics{ - ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), - SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), +func com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil } - }() -} -func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_FromDafny(input interface{}) *types.PointInTimeRecoverySpecification { - return func() *types.PointInTimeRecoverySpecification { - return &types.PointInTimeRecoverySpecification{ - PointInTimeRecoveryEnabled: com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification).Dtor_PointInTimeRecoveryEnabled()), + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { - return func() *types.OnDemandThroughputOverride { +func com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.OnDemandThroughputOverride{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_DuplicateItemException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -15745,53 +15777,45 @@ func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_FromDafny(input i } }() } -func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_dynamodb_ExportConflictException_message_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_dynamodb_AttributeValue_M_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_ExportNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_MapAttributeValue_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_MapAttributeValue_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_dynamodb_Put_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -15801,104 +15825,103 @@ func com_amazonaws_dynamodb_Put_TableName_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_dynamodb_AttributeValue_N_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_GlobalTableNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_FromDafny(input interface{}) *float64 { - return func() *float64 { - var b []byte - - for i := dafny.Iterate(input); ; { +func com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_AttributeValue_L_FromDafny(input interface{}) []types.AttributeValue { - return func() []types.AttributeValue { - var fieldValue []types.AttributeValue +func com_amazonaws_dynamodb_ImportConflictException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_ListAttributeValue_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(input interface{}) [][]byte { - return func() [][]byte { - var fieldValue [][]byte +func com_amazonaws_dynamodb_ImportNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_BinarySetAttributeValue_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_FromDafny(input interface{}) types.AutoScalingPolicyDescription { - return func() types.AutoScalingPolicyDescription { - - return types.AutoScalingPolicyDescription{ - PolicyName: com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription).Dtor_PolicyName().UnwrapOr(nil)), - TargetTrackingScalingPolicyConfiguration: com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription).Dtor_TargetTrackingScalingPolicyConfiguration().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_ScanInput_ConsistentRead_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_dynamodb_IndexNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - b = input.(bool) - return &b + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } }() } -func com_amazonaws_dynamodb_AttributeValue_S_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_InternalServerError_message_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { - return s + return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_CsvOptions_Delimiter_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_InvalidEndpointException_Message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -15914,57 +15937,61 @@ func com_amazonaws_dynamodb_CsvOptions_Delimiter_FromDafny(input interface{}) *s } }() } -func com_amazonaws_dynamodb_NonKeyAttributeNameList_member_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_dynamodb_InvalidExportTimeException_message_FromDafny(input interface{}) *string { + return func() *string { var s string - + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { - return func() *types.ItemCollectionMetrics { +func com_amazonaws_dynamodb_InvalidRestoreTimeException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.ItemCollectionMetrics{ - ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), - SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input interface{}) types.SSEType { - return func() types.SSEType { - var u types.SSEType +func com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.SSEType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.SSEType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_LimitExceededException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -15974,7 +16001,7 @@ func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_Fro } }() } -func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -15990,32 +16017,29 @@ func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(inp } }() } -func com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { +func com_amazonaws_dynamodb_PolicyNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_dynamodb_ScanInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -16025,7 +16049,7 @@ func com_amazonaws_dynamodb_ScanInput_TableName_FromDafny(input interface{}) *st } }() } -func com_amazonaws_dynamodb_TransactionInProgressException_Message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -16041,32 +16065,29 @@ func com_amazonaws_dynamodb_TransactionInProgressException_Message_FromDafny(inp } }() } -func com_amazonaws_dynamodb_ListBackupsInput_BackupType_FromDafny(input interface{}) types.BackupTypeFilter { - return func() types.BackupTypeFilter { - var u types.BackupTypeFilter +func com_amazonaws_dynamodb_ReplicaNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.BackupTypeFilter) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupTypeFilter_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.BackupTypeFilter).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_RequestLimitExceeded_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -16076,33 +16097,23 @@ func com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_FromDafny } }() } -func com_amazonaws_dynamodb_Get_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_dynamodb_ResourceInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_ReplicaUpdateList_member_FromDafny(input interface{}) types.ReplicaUpdate { - return func() types.ReplicaUpdate { - - return types.ReplicaUpdate{ - Create: com_amazonaws_dynamodb_ReplicaUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaUpdate).Dtor_Create().UnwrapOr(nil)), - Delete: com_amazonaws_dynamodb_ReplicaUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaUpdate).Dtor_Delete().UnwrapOr(nil)), } }() } -func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_ResourceNotFoundException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -16118,7 +16129,7 @@ func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input } }() } -func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TableAlreadyExistsException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -16134,49 +16145,39 @@ func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_FromDafny(in } }() } -func com_amazonaws_dynamodb_ImportSummary_InputFormat_FromDafny(input interface{}) types.InputFormat { - return func() types.InputFormat { - var u types.InputFormat +func com_amazonaws_dynamodb_TableInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_ScanInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { - return func() types.ConditionalOperator { - var u types.ConditionalOperator +func com_amazonaws_dynamodb_TableNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_TransactionCanceledException_Message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -16192,9 +16193,9 @@ func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_FromDafny(input inte } }() } -func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { - return func() []types.KeySchemaElement { - var fieldValue []types.KeySchemaElement +func com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_FromDafny(input interface{}) []types.CancellationReason { + return func() []types.CancellationReason { + var fieldValue []types.CancellationReason if input == nil { return nil } @@ -16203,30 +16204,45 @@ func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_FromDafny(i if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_dynamodb_CancellationReasonList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_dynamodb_CancellationReasonList_member_FromDafny(input interface{}) types.CancellationReason { + return func() types.CancellationReason { - for i := dafny.Iterate(input); ; { + return types.CancellationReason{ + Item: com_amazonaws_dynamodb_CancellationReason_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Item().UnwrapOr(nil)), + Code: com_amazonaws_dynamodb_CancellationReason_Code_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Code().UnwrapOr(nil)), + Message: com_amazonaws_dynamodb_CancellationReason_Message_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Message().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CancellationReason_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CancellationReason_Code_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -16236,7 +16252,7 @@ func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_FromDafny(input } }() } -func com_amazonaws_dynamodb_TableInUseException_message_FromDafny(input interface{}) *string { +func com_amazonaws_dynamodb_CancellationReason_Message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -16252,51 +16268,35 @@ func com_amazonaws_dynamodb_TableInUseException_message_FromDafny(input interfac } }() } -func com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_FromDafny(input interface{}) *types.Projection { - return func() *types.Projection { - - return &types.Projection{ - ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), - NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_dynamodb_CancellationReason_Item_FromDafny(input interface{}) map[string]types.AttributeValue { - return func() map[string]types.AttributeValue { - var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) +func com_amazonaws_dynamodb_TransactionConflictException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughput { - return func() *types.ProvisionedThroughput { - if input == nil { - return nil - } - return &types.ProvisionedThroughput{ - ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), - WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), } }() } -func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { - return func() *types.OnDemandThroughput { +func com_amazonaws_dynamodb_TransactionInProgressException_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.OnDemandThroughput{ - MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), - MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } diff --git a/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/DynamoDBwrapped/shim.go b/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/DynamoDBwrapped/shim.go new file mode 100644 index 000000000..3bcd19590 --- /dev/null +++ b/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/DynamoDBwrapped/shim.go @@ -0,0 +1,531 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package DynamoDBwrapped + +import ( + "context" + + "github.com/aws/aws-cryptographic-material-providers-library/dynamodb/ComAmazonawsDynamodbTypes" + "github.com/aws/aws-cryptographic-material-providers-library/dynamodb/comamazonawsdynamodbsmithygenerated" + "github.com/aws/aws-sdk-go-v2/service/dynamodb" + "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" + "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" +) + +type Shim struct { + ComAmazonawsDynamodbTypes.IDynamoDBClient + Client *dynamodb.Client +} + +func (shim *Shim) BatchExecuteStatement(input ComAmazonawsDynamodbTypes.BatchExecuteStatementInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.BatchExecuteStatementInput_FromDafny(input) + var native_response, native_error = shim.Client.BatchExecuteStatement(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.BatchExecuteStatementOutput_ToDafny(*native_response)) +} + +func (shim *Shim) BatchGetItem(input ComAmazonawsDynamodbTypes.BatchGetItemInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.BatchGetItemInput_FromDafny(input) + var native_response, native_error = shim.Client.BatchGetItem(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.BatchGetItemOutput_ToDafny(*native_response)) +} + +func (shim *Shim) BatchWriteItem(input ComAmazonawsDynamodbTypes.BatchWriteItemInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.BatchWriteItemInput_FromDafny(input) + var native_response, native_error = shim.Client.BatchWriteItem(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.BatchWriteItemOutput_ToDafny(*native_response)) +} + +func (shim *Shim) CreateBackup(input ComAmazonawsDynamodbTypes.CreateBackupInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.CreateBackupInput_FromDafny(input) + var native_response, native_error = shim.Client.CreateBackup(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.CreateBackupOutput_ToDafny(*native_response)) +} + +func (shim *Shim) CreateGlobalTable(input ComAmazonawsDynamodbTypes.CreateGlobalTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.CreateGlobalTableInput_FromDafny(input) + var native_response, native_error = shim.Client.CreateGlobalTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.CreateGlobalTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) CreateTable(input ComAmazonawsDynamodbTypes.CreateTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.CreateTableInput_FromDafny(input) + var native_response, native_error = shim.Client.CreateTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.CreateTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DeleteBackup(input ComAmazonawsDynamodbTypes.DeleteBackupInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DeleteBackupInput_FromDafny(input) + var native_response, native_error = shim.Client.DeleteBackup(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DeleteBackupOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DeleteItem(input ComAmazonawsDynamodbTypes.DeleteItemInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DeleteItemInput_FromDafny(input) + var native_response, native_error = shim.Client.DeleteItem(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DeleteItemOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DeleteResourcePolicy(input ComAmazonawsDynamodbTypes.DeleteResourcePolicyInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DeleteResourcePolicyInput_FromDafny(input) + var native_response, native_error = shim.Client.DeleteResourcePolicy(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DeleteResourcePolicyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DeleteTable(input ComAmazonawsDynamodbTypes.DeleteTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DeleteTableInput_FromDafny(input) + var native_response, native_error = shim.Client.DeleteTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DeleteTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeBackup(input ComAmazonawsDynamodbTypes.DescribeBackupInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeBackupInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeBackup(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeBackupOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeContinuousBackups(input ComAmazonawsDynamodbTypes.DescribeContinuousBackupsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeContinuousBackupsInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeContinuousBackups(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeContinuousBackupsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeContributorInsights(input ComAmazonawsDynamodbTypes.DescribeContributorInsightsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeContributorInsightsInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeContributorInsights(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeContributorInsightsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeEndpoints(input ComAmazonawsDynamodbTypes.DescribeEndpointsRequest) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeEndpointsInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeEndpoints(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeEndpointsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeExport(input ComAmazonawsDynamodbTypes.DescribeExportInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeExportInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeExport(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeExportOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeGlobalTable(input ComAmazonawsDynamodbTypes.DescribeGlobalTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeGlobalTableInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeGlobalTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeGlobalTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeGlobalTableSettings(input ComAmazonawsDynamodbTypes.DescribeGlobalTableSettingsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeGlobalTableSettingsInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeGlobalTableSettings(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeGlobalTableSettingsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeImport(input ComAmazonawsDynamodbTypes.DescribeImportInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeImportInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeImport(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeImportOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeKinesisStreamingDestination(input ComAmazonawsDynamodbTypes.DescribeKinesisStreamingDestinationInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeKinesisStreamingDestinationInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeKinesisStreamingDestination(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeKinesisStreamingDestinationOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeLimits(input ComAmazonawsDynamodbTypes.DescribeLimitsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeLimitsInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeLimits(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeLimitsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeTable(input ComAmazonawsDynamodbTypes.DescribeTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeTableInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeTableReplicaAutoScaling(input ComAmazonawsDynamodbTypes.DescribeTableReplicaAutoScalingInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeTableReplicaAutoScalingInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeTableReplicaAutoScaling(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeTableReplicaAutoScalingOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeTimeToLive(input ComAmazonawsDynamodbTypes.DescribeTimeToLiveInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DescribeTimeToLiveInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeTimeToLive(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DescribeTimeToLiveOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DisableKinesisStreamingDestination(input ComAmazonawsDynamodbTypes.DisableKinesisStreamingDestinationInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.DisableKinesisStreamingDestinationInput_FromDafny(input) + var native_response, native_error = shim.Client.DisableKinesisStreamingDestination(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.DisableKinesisStreamingDestinationOutput_ToDafny(*native_response)) +} + +func (shim *Shim) EnableKinesisStreamingDestination(input ComAmazonawsDynamodbTypes.EnableKinesisStreamingDestinationInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.EnableKinesisStreamingDestinationInput_FromDafny(input) + var native_response, native_error = shim.Client.EnableKinesisStreamingDestination(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.EnableKinesisStreamingDestinationOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ExecuteStatement(input ComAmazonawsDynamodbTypes.ExecuteStatementInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ExecuteStatementInput_FromDafny(input) + var native_response, native_error = shim.Client.ExecuteStatement(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ExecuteStatementOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ExecuteTransaction(input ComAmazonawsDynamodbTypes.ExecuteTransactionInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ExecuteTransactionInput_FromDafny(input) + var native_response, native_error = shim.Client.ExecuteTransaction(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ExecuteTransactionOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ExportTableToPointInTime(input ComAmazonawsDynamodbTypes.ExportTableToPointInTimeInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ExportTableToPointInTimeInput_FromDafny(input) + var native_response, native_error = shim.Client.ExportTableToPointInTime(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ExportTableToPointInTimeOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GetItem(input ComAmazonawsDynamodbTypes.GetItemInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.GetItemInput_FromDafny(input) + var native_response, native_error = shim.Client.GetItem(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.GetItemOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GetResourcePolicy(input ComAmazonawsDynamodbTypes.GetResourcePolicyInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.GetResourcePolicyInput_FromDafny(input) + var native_response, native_error = shim.Client.GetResourcePolicy(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.GetResourcePolicyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ImportTable(input ComAmazonawsDynamodbTypes.ImportTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ImportTableInput_FromDafny(input) + var native_response, native_error = shim.Client.ImportTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ImportTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListBackups(input ComAmazonawsDynamodbTypes.ListBackupsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ListBackupsInput_FromDafny(input) + var native_response, native_error = shim.Client.ListBackups(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ListBackupsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListContributorInsights(input ComAmazonawsDynamodbTypes.ListContributorInsightsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ListContributorInsightsInput_FromDafny(input) + var native_response, native_error = shim.Client.ListContributorInsights(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ListContributorInsightsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListExports(input ComAmazonawsDynamodbTypes.ListExportsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ListExportsInput_FromDafny(input) + var native_response, native_error = shim.Client.ListExports(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ListExportsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListGlobalTables(input ComAmazonawsDynamodbTypes.ListGlobalTablesInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ListGlobalTablesInput_FromDafny(input) + var native_response, native_error = shim.Client.ListGlobalTables(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ListGlobalTablesOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListImports(input ComAmazonawsDynamodbTypes.ListImportsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ListImportsInput_FromDafny(input) + var native_response, native_error = shim.Client.ListImports(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ListImportsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListTables(input ComAmazonawsDynamodbTypes.ListTablesInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ListTablesInput_FromDafny(input) + var native_response, native_error = shim.Client.ListTables(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ListTablesOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListTagsOfResource(input ComAmazonawsDynamodbTypes.ListTagsOfResourceInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ListTagsOfResourceInput_FromDafny(input) + var native_response, native_error = shim.Client.ListTagsOfResource(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ListTagsOfResourceOutput_ToDafny(*native_response)) +} + +func (shim *Shim) PutItem(input ComAmazonawsDynamodbTypes.PutItemInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.PutItemInput_FromDafny(input) + var native_response, native_error = shim.Client.PutItem(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.PutItemOutput_ToDafny(*native_response)) +} + +func (shim *Shim) PutResourcePolicy(input ComAmazonawsDynamodbTypes.PutResourcePolicyInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.PutResourcePolicyInput_FromDafny(input) + var native_response, native_error = shim.Client.PutResourcePolicy(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.PutResourcePolicyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) Query(input ComAmazonawsDynamodbTypes.QueryInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.QueryInput_FromDafny(input) + var native_response, native_error = shim.Client.Query(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.QueryOutput_ToDafny(*native_response)) +} + +func (shim *Shim) RestoreTableFromBackup(input ComAmazonawsDynamodbTypes.RestoreTableFromBackupInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.RestoreTableFromBackupInput_FromDafny(input) + var native_response, native_error = shim.Client.RestoreTableFromBackup(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.RestoreTableFromBackupOutput_ToDafny(*native_response)) +} + +func (shim *Shim) RestoreTableToPointInTime(input ComAmazonawsDynamodbTypes.RestoreTableToPointInTimeInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.RestoreTableToPointInTimeInput_FromDafny(input) + var native_response, native_error = shim.Client.RestoreTableToPointInTime(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.RestoreTableToPointInTimeOutput_ToDafny(*native_response)) +} + +func (shim *Shim) Scan(input ComAmazonawsDynamodbTypes.ScanInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.ScanInput_FromDafny(input) + var native_response, native_error = shim.Client.Scan(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.ScanOutput_ToDafny(*native_response)) +} + +func (shim *Shim) TagResource(input ComAmazonawsDynamodbTypes.TagResourceInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.TagResourceInput_FromDafny(input) + var _, native_error = shim.Client.TagResource(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) TransactGetItems(input ComAmazonawsDynamodbTypes.TransactGetItemsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.TransactGetItemsInput_FromDafny(input) + var native_response, native_error = shim.Client.TransactGetItems(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.TransactGetItemsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) TransactWriteItems(input ComAmazonawsDynamodbTypes.TransactWriteItemsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.TransactWriteItemsInput_FromDafny(input) + var native_response, native_error = shim.Client.TransactWriteItems(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.TransactWriteItemsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UntagResource(input ComAmazonawsDynamodbTypes.UntagResourceInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UntagResourceInput_FromDafny(input) + var _, native_error = shim.Client.UntagResource(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) UpdateContinuousBackups(input ComAmazonawsDynamodbTypes.UpdateContinuousBackupsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateContinuousBackupsInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateContinuousBackups(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateContinuousBackupsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateContributorInsights(input ComAmazonawsDynamodbTypes.UpdateContributorInsightsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateContributorInsightsInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateContributorInsights(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateContributorInsightsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateGlobalTable(input ComAmazonawsDynamodbTypes.UpdateGlobalTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateGlobalTableInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateGlobalTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateGlobalTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateGlobalTableSettings(input ComAmazonawsDynamodbTypes.UpdateGlobalTableSettingsInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateGlobalTableSettingsInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateGlobalTableSettings(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateGlobalTableSettingsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateItem(input ComAmazonawsDynamodbTypes.UpdateItemInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateItemInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateItem(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateItemOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateKinesisStreamingDestination(input ComAmazonawsDynamodbTypes.UpdateKinesisStreamingDestinationInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateKinesisStreamingDestinationInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateKinesisStreamingDestination(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateKinesisStreamingDestinationOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateTable(input ComAmazonawsDynamodbTypes.UpdateTableInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateTableInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateTable(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateTableOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateTableReplicaAutoScaling(input ComAmazonawsDynamodbTypes.UpdateTableReplicaAutoScalingInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateTableReplicaAutoScalingInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateTableReplicaAutoScaling(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateTableReplicaAutoScalingOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateTimeToLive(input ComAmazonawsDynamodbTypes.UpdateTimeToLiveInput) Wrappers.Result { + var native_request = comamazonawsdynamodbsmithygenerated.UpdateTimeToLiveInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateTimeToLive(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawsdynamodbsmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawsdynamodbsmithygenerated.UpdateTimeToLiveOutput_ToDafny(*native_response)) +} diff --git a/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go b/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go new file mode 100644 index 000000000..b1d4d98d3 --- /dev/null +++ b/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_dafny.go @@ -0,0 +1,11687 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comamazonawsdynamodbsmithygenerated + +import ( + "encoding/binary" + "errors" + "math" + "time" + + "github.com/aws/aws-cryptographic-material-providers-library/dynamodb/ComAmazonawsDynamodbTypes" + "github.com/aws/aws-sdk-go-v2/service/dynamodb" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" + "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" +) + +func BatchExecuteStatementInput_ToDafny(nativeInput dynamodb.BatchExecuteStatementInput) ComAmazonawsDynamodbTypes.BatchExecuteStatementInput { + + return func() ComAmazonawsDynamodbTypes.BatchExecuteStatementInput { + + return ComAmazonawsDynamodbTypes.Companion_BatchExecuteStatementInput_.Create_BatchExecuteStatementInput_(com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_ToDafny(nativeInput.Statements), com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity)) + }() + +} + +func BatchExecuteStatementOutput_ToDafny(nativeOutput dynamodb.BatchExecuteStatementOutput) ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput { + + return func() ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput { + + return ComAmazonawsDynamodbTypes.Companion_BatchExecuteStatementOutput_.Create_BatchExecuteStatementOutput_(com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_ToDafny(nativeOutput.Responses), com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity)) + }() + +} + +func BatchGetItemInput_ToDafny(nativeInput dynamodb.BatchGetItemInput) ComAmazonawsDynamodbTypes.BatchGetItemInput { + + return func() ComAmazonawsDynamodbTypes.BatchGetItemInput { + + return ComAmazonawsDynamodbTypes.Companion_BatchGetItemInput_.Create_BatchGetItemInput_(com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_ToDafny(nativeInput.RequestItems), com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity)) + }() + +} + +func BatchGetItemOutput_ToDafny(nativeOutput dynamodb.BatchGetItemOutput) ComAmazonawsDynamodbTypes.BatchGetItemOutput { + + return func() ComAmazonawsDynamodbTypes.BatchGetItemOutput { + + return ComAmazonawsDynamodbTypes.Companion_BatchGetItemOutput_.Create_BatchGetItemOutput_(com_amazonaws_dynamodb_BatchGetItemOutput_Responses_ToDafny(nativeOutput.Responses), com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_ToDafny(nativeOutput.UnprocessedKeys), com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity)) + }() + +} + +func BatchWriteItemInput_ToDafny(nativeInput dynamodb.BatchWriteItemInput) ComAmazonawsDynamodbTypes.BatchWriteItemInput { + + return func() ComAmazonawsDynamodbTypes.BatchWriteItemInput { + + return ComAmazonawsDynamodbTypes.Companion_BatchWriteItemInput_.Create_BatchWriteItemInput_(com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_ToDafny(nativeInput.RequestItems), com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_ToDafny(nativeInput.ReturnItemCollectionMetrics)) + }() + +} + +func BatchWriteItemOutput_ToDafny(nativeOutput dynamodb.BatchWriteItemOutput) ComAmazonawsDynamodbTypes.BatchWriteItemOutput { + + return func() ComAmazonawsDynamodbTypes.BatchWriteItemOutput { + + return ComAmazonawsDynamodbTypes.Companion_BatchWriteItemOutput_.Create_BatchWriteItemOutput_(com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_ToDafny(nativeOutput.UnprocessedItems), com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_ToDafny(nativeOutput.ItemCollectionMetrics), com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity)) + }() + +} + +func CreateBackupInput_ToDafny(nativeInput dynamodb.CreateBackupInput) ComAmazonawsDynamodbTypes.CreateBackupInput { + + return func() ComAmazonawsDynamodbTypes.CreateBackupInput { + + return ComAmazonawsDynamodbTypes.Companion_CreateBackupInput_.Create_CreateBackupInput_(com_amazonaws_dynamodb_CreateBackupInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_CreateBackupInput_BackupName_ToDafny(nativeInput.BackupName)) + }() + +} + +func CreateBackupOutput_ToDafny(nativeOutput dynamodb.CreateBackupOutput) ComAmazonawsDynamodbTypes.CreateBackupOutput { + + return func() ComAmazonawsDynamodbTypes.CreateBackupOutput { + + return ComAmazonawsDynamodbTypes.Companion_CreateBackupOutput_.Create_CreateBackupOutput_(com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_ToDafny(nativeOutput.BackupDetails)) + }() + +} + +func CreateGlobalTableInput_ToDafny(nativeInput dynamodb.CreateGlobalTableInput) ComAmazonawsDynamodbTypes.CreateGlobalTableInput { + + return func() ComAmazonawsDynamodbTypes.CreateGlobalTableInput { + + return ComAmazonawsDynamodbTypes.Companion_CreateGlobalTableInput_.Create_CreateGlobalTableInput_(com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_ToDafny(nativeInput.GlobalTableName), com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_ToDafny(nativeInput.ReplicationGroup)) + }() + +} + +func CreateGlobalTableOutput_ToDafny(nativeOutput dynamodb.CreateGlobalTableOutput) ComAmazonawsDynamodbTypes.CreateGlobalTableOutput { + + return func() ComAmazonawsDynamodbTypes.CreateGlobalTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_CreateGlobalTableOutput_.Create_CreateGlobalTableOutput_(com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_ToDafny(nativeOutput.GlobalTableDescription)) + }() + +} + +func CreateTableInput_ToDafny(nativeInput dynamodb.CreateTableInput) ComAmazonawsDynamodbTypes.CreateTableInput { + + return func() ComAmazonawsDynamodbTypes.CreateTableInput { + + return ComAmazonawsDynamodbTypes.Companion_CreateTableInput_.Create_CreateTableInput_(com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_ToDafny(nativeInput.AttributeDefinitions), com_amazonaws_dynamodb_CreateTableInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_CreateTableInput_KeySchema_ToDafny(nativeInput.KeySchema), com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_ToDafny(nativeInput.LocalSecondaryIndexes), com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_ToDafny(nativeInput.GlobalSecondaryIndexes), com_amazonaws_dynamodb_CreateTableInput_BillingMode_ToDafny(nativeInput.BillingMode), com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_ToDafny(nativeInput.ProvisionedThroughput), com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_ToDafny(nativeInput.StreamSpecification), com_amazonaws_dynamodb_CreateTableInput_SSESpecification_ToDafny(nativeInput.SSESpecification), com_amazonaws_dynamodb_CreateTableInput_Tags_ToDafny(nativeInput.Tags), com_amazonaws_dynamodb_CreateTableInput_TableClass_ToDafny(nativeInput.TableClass), com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_ToDafny(nativeInput.DeletionProtectionEnabled), com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_ToDafny(nativeInput.ResourcePolicy), com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_ToDafny(nativeInput.OnDemandThroughput)) + }() + +} + +func CreateTableOutput_ToDafny(nativeOutput dynamodb.CreateTableOutput) ComAmazonawsDynamodbTypes.CreateTableOutput { + + return func() ComAmazonawsDynamodbTypes.CreateTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_CreateTableOutput_.Create_CreateTableOutput_(com_amazonaws_dynamodb_CreateTableOutput_TableDescription_ToDafny(nativeOutput.TableDescription)) + }() + +} + +func DeleteBackupInput_ToDafny(nativeInput dynamodb.DeleteBackupInput) ComAmazonawsDynamodbTypes.DeleteBackupInput { + + return func() ComAmazonawsDynamodbTypes.DeleteBackupInput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteBackupInput_.Create_DeleteBackupInput_(com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_ToDafny(nativeInput.BackupArn)) + }() + +} + +func DeleteBackupOutput_ToDafny(nativeOutput dynamodb.DeleteBackupOutput) ComAmazonawsDynamodbTypes.DeleteBackupOutput { + + return func() ComAmazonawsDynamodbTypes.DeleteBackupOutput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteBackupOutput_.Create_DeleteBackupOutput_(com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_ToDafny(nativeOutput.BackupDescription)) + }() + +} + +func DeleteItemInput_ToDafny(nativeInput dynamodb.DeleteItemInput) ComAmazonawsDynamodbTypes.DeleteItemInput { + + return func() ComAmazonawsDynamodbTypes.DeleteItemInput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteItemInput_.Create_DeleteItemInput_(com_amazonaws_dynamodb_DeleteItemInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_DeleteItemInput_Key_ToDafny(nativeInput.Key), com_amazonaws_dynamodb_DeleteItemInput_Expected_ToDafny(nativeInput.Expected), com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_ToDafny(nativeInput.ConditionalOperator), com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_ToDafny(nativeInput.ReturnValues), com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_ToDafny(nativeInput.ReturnItemCollectionMetrics), com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_ToDafny(nativeInput.ConditionExpression), com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_ToDafny(nativeInput.ExpressionAttributeNames), com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_ToDafny(nativeInput.ExpressionAttributeValues)) + }() + +} + +func DeleteItemOutput_ToDafny(nativeOutput dynamodb.DeleteItemOutput) ComAmazonawsDynamodbTypes.DeleteItemOutput { + + return func() ComAmazonawsDynamodbTypes.DeleteItemOutput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteItemOutput_.Create_DeleteItemOutput_(com_amazonaws_dynamodb_DeleteItemOutput_Attributes_ToDafny(nativeOutput.Attributes), com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity), com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_ToDafny(nativeOutput.ItemCollectionMetrics)) + }() + +} + +func DeleteResourcePolicyInput_ToDafny(nativeInput dynamodb.DeleteResourcePolicyInput) ComAmazonawsDynamodbTypes.DeleteResourcePolicyInput { + + return func() ComAmazonawsDynamodbTypes.DeleteResourcePolicyInput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteResourcePolicyInput_.Create_DeleteResourcePolicyInput_(com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_ToDafny(nativeInput.ResourceArn), com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_ToDafny(nativeInput.ExpectedRevisionId)) + }() + +} + +func DeleteResourcePolicyOutput_ToDafny(nativeOutput dynamodb.DeleteResourcePolicyOutput) ComAmazonawsDynamodbTypes.DeleteResourcePolicyOutput { + + return func() ComAmazonawsDynamodbTypes.DeleteResourcePolicyOutput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteResourcePolicyOutput_.Create_DeleteResourcePolicyOutput_(com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_ToDafny(nativeOutput.RevisionId)) + }() + +} + +func DeleteTableInput_ToDafny(nativeInput dynamodb.DeleteTableInput) ComAmazonawsDynamodbTypes.DeleteTableInput { + + return func() ComAmazonawsDynamodbTypes.DeleteTableInput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteTableInput_.Create_DeleteTableInput_(com_amazonaws_dynamodb_DeleteTableInput_TableName_ToDafny(nativeInput.TableName)) + }() + +} + +func DeleteTableOutput_ToDafny(nativeOutput dynamodb.DeleteTableOutput) ComAmazonawsDynamodbTypes.DeleteTableOutput { + + return func() ComAmazonawsDynamodbTypes.DeleteTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_DeleteTableOutput_.Create_DeleteTableOutput_(com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_ToDafny(nativeOutput.TableDescription)) + }() + +} + +func DescribeBackupInput_ToDafny(nativeInput dynamodb.DescribeBackupInput) ComAmazonawsDynamodbTypes.DescribeBackupInput { + + return func() ComAmazonawsDynamodbTypes.DescribeBackupInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeBackupInput_.Create_DescribeBackupInput_(com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_ToDafny(nativeInput.BackupArn)) + }() + +} + +func DescribeBackupOutput_ToDafny(nativeOutput dynamodb.DescribeBackupOutput) ComAmazonawsDynamodbTypes.DescribeBackupOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeBackupOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeBackupOutput_.Create_DescribeBackupOutput_(com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_ToDafny(nativeOutput.BackupDescription)) + }() + +} + +func DescribeContinuousBackupsInput_ToDafny(nativeInput dynamodb.DescribeContinuousBackupsInput) ComAmazonawsDynamodbTypes.DescribeContinuousBackupsInput { + + return func() ComAmazonawsDynamodbTypes.DescribeContinuousBackupsInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeContinuousBackupsInput_.Create_DescribeContinuousBackupsInput_(com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_ToDafny(nativeInput.TableName)) + }() + +} + +func DescribeContinuousBackupsOutput_ToDafny(nativeOutput dynamodb.DescribeContinuousBackupsOutput) ComAmazonawsDynamodbTypes.DescribeContinuousBackupsOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeContinuousBackupsOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeContinuousBackupsOutput_.Create_DescribeContinuousBackupsOutput_(com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(nativeOutput.ContinuousBackupsDescription)) + }() + +} + +func DescribeContributorInsightsInput_ToDafny(nativeInput dynamodb.DescribeContributorInsightsInput) ComAmazonawsDynamodbTypes.DescribeContributorInsightsInput { + + return func() ComAmazonawsDynamodbTypes.DescribeContributorInsightsInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeContributorInsightsInput_.Create_DescribeContributorInsightsInput_(com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_ToDafny(nativeInput.IndexName)) + }() + +} + +func DescribeContributorInsightsOutput_ToDafny(nativeOutput dynamodb.DescribeContributorInsightsOutput) ComAmazonawsDynamodbTypes.DescribeContributorInsightsOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeContributorInsightsOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeContributorInsightsOutput_.Create_DescribeContributorInsightsOutput_(com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_ToDafny(nativeOutput.TableName), com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_ToDafny(nativeOutput.IndexName), com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_ToDafny(nativeOutput.ContributorInsightsRuleList), com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_ToDafny(nativeOutput.ContributorInsightsStatus), com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_ToDafny(nativeOutput.LastUpdateDateTime), com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_ToDafny(nativeOutput.FailureException)) + }() + +} + +func DescribeEndpointsInput_ToDafny(nativeInput dynamodb.DescribeEndpointsInput) ComAmazonawsDynamodbTypes.DescribeEndpointsRequest { + + return func() ComAmazonawsDynamodbTypes.DescribeEndpointsRequest { + + return ComAmazonawsDynamodbTypes.Companion_DescribeEndpointsRequest_.Create_DescribeEndpointsRequest_() + }() + +} + +func DescribeEndpointsOutput_ToDafny(nativeOutput dynamodb.DescribeEndpointsOutput) ComAmazonawsDynamodbTypes.DescribeEndpointsResponse { + + return func() ComAmazonawsDynamodbTypes.DescribeEndpointsResponse { + + return ComAmazonawsDynamodbTypes.Companion_DescribeEndpointsResponse_.Create_DescribeEndpointsResponse_(com_amazonaws_dynamodb_DescribeEndpointsResponse_Endpoints_ToDafny(nativeOutput.Endpoints)) + }() + +} + +func DescribeExportInput_ToDafny(nativeInput dynamodb.DescribeExportInput) ComAmazonawsDynamodbTypes.DescribeExportInput { + + return func() ComAmazonawsDynamodbTypes.DescribeExportInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeExportInput_.Create_DescribeExportInput_(com_amazonaws_dynamodb_DescribeExportInput_ExportArn_ToDafny(nativeInput.ExportArn)) + }() + +} + +func DescribeExportOutput_ToDafny(nativeOutput dynamodb.DescribeExportOutput) ComAmazonawsDynamodbTypes.DescribeExportOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeExportOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeExportOutput_.Create_DescribeExportOutput_(com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_ToDafny(nativeOutput.ExportDescription)) + }() + +} + +func DescribeGlobalTableInput_ToDafny(nativeInput dynamodb.DescribeGlobalTableInput) ComAmazonawsDynamodbTypes.DescribeGlobalTableInput { + + return func() ComAmazonawsDynamodbTypes.DescribeGlobalTableInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeGlobalTableInput_.Create_DescribeGlobalTableInput_(com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_ToDafny(nativeInput.GlobalTableName)) + }() + +} + +func DescribeGlobalTableOutput_ToDafny(nativeOutput dynamodb.DescribeGlobalTableOutput) ComAmazonawsDynamodbTypes.DescribeGlobalTableOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeGlobalTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeGlobalTableOutput_.Create_DescribeGlobalTableOutput_(com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_ToDafny(nativeOutput.GlobalTableDescription)) + }() + +} + +func DescribeGlobalTableSettingsInput_ToDafny(nativeInput dynamodb.DescribeGlobalTableSettingsInput) ComAmazonawsDynamodbTypes.DescribeGlobalTableSettingsInput { + + return func() ComAmazonawsDynamodbTypes.DescribeGlobalTableSettingsInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeGlobalTableSettingsInput_.Create_DescribeGlobalTableSettingsInput_(com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_ToDafny(nativeInput.GlobalTableName)) + }() + +} + +func DescribeGlobalTableSettingsOutput_ToDafny(nativeOutput dynamodb.DescribeGlobalTableSettingsOutput) ComAmazonawsDynamodbTypes.DescribeGlobalTableSettingsOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeGlobalTableSettingsOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeGlobalTableSettingsOutput_.Create_DescribeGlobalTableSettingsOutput_(com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_ToDafny(nativeOutput.GlobalTableName), com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_ToDafny(nativeOutput.ReplicaSettings)) + }() + +} + +func DescribeImportInput_ToDafny(nativeInput dynamodb.DescribeImportInput) ComAmazonawsDynamodbTypes.DescribeImportInput { + + return func() ComAmazonawsDynamodbTypes.DescribeImportInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeImportInput_.Create_DescribeImportInput_(com_amazonaws_dynamodb_DescribeImportInput_ImportArn_ToDafny(nativeInput.ImportArn)) + }() + +} + +func DescribeImportOutput_ToDafny(nativeOutput dynamodb.DescribeImportOutput) ComAmazonawsDynamodbTypes.DescribeImportOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeImportOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeImportOutput_.Create_DescribeImportOutput_(com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_ToDafny(nativeOutput.ImportTableDescription)) + }() + +} + +func DescribeKinesisStreamingDestinationInput_ToDafny(nativeInput dynamodb.DescribeKinesisStreamingDestinationInput) ComAmazonawsDynamodbTypes.DescribeKinesisStreamingDestinationInput { + + return func() ComAmazonawsDynamodbTypes.DescribeKinesisStreamingDestinationInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeKinesisStreamingDestinationInput_.Create_DescribeKinesisStreamingDestinationInput_(com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_ToDafny(nativeInput.TableName)) + }() + +} + +func DescribeKinesisStreamingDestinationOutput_ToDafny(nativeOutput dynamodb.DescribeKinesisStreamingDestinationOutput) ComAmazonawsDynamodbTypes.DescribeKinesisStreamingDestinationOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeKinesisStreamingDestinationOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeKinesisStreamingDestinationOutput_.Create_DescribeKinesisStreamingDestinationOutput_(com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_ToDafny(nativeOutput.TableName), com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_ToDafny(nativeOutput.KinesisDataStreamDestinations)) + }() + +} + +func DescribeLimitsInput_ToDafny(nativeInput dynamodb.DescribeLimitsInput) ComAmazonawsDynamodbTypes.DescribeLimitsInput { + + return func() ComAmazonawsDynamodbTypes.DescribeLimitsInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeLimitsInput_.Create_DescribeLimitsInput_() + }() + +} + +func DescribeLimitsOutput_ToDafny(nativeOutput dynamodb.DescribeLimitsOutput) ComAmazonawsDynamodbTypes.DescribeLimitsOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeLimitsOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeLimitsOutput_.Create_DescribeLimitsOutput_(com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxReadCapacityUnits_ToDafny(nativeOutput.AccountMaxReadCapacityUnits), com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_ToDafny(nativeOutput.AccountMaxWriteCapacityUnits), com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_ToDafny(nativeOutput.TableMaxReadCapacityUnits), com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_ToDafny(nativeOutput.TableMaxWriteCapacityUnits)) + }() + +} + +func DescribeTableInput_ToDafny(nativeInput dynamodb.DescribeTableInput) ComAmazonawsDynamodbTypes.DescribeTableInput { + + return func() ComAmazonawsDynamodbTypes.DescribeTableInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeTableInput_.Create_DescribeTableInput_(com_amazonaws_dynamodb_DescribeTableInput_TableName_ToDafny(nativeInput.TableName)) + }() + +} + +func DescribeTableOutput_ToDafny(nativeOutput dynamodb.DescribeTableOutput) ComAmazonawsDynamodbTypes.DescribeTableOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeTableOutput_.Create_DescribeTableOutput_(com_amazonaws_dynamodb_DescribeTableOutput_Table_ToDafny(nativeOutput.Table)) + }() + +} + +func DescribeTableReplicaAutoScalingInput_ToDafny(nativeInput dynamodb.DescribeTableReplicaAutoScalingInput) ComAmazonawsDynamodbTypes.DescribeTableReplicaAutoScalingInput { + + return func() ComAmazonawsDynamodbTypes.DescribeTableReplicaAutoScalingInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeTableReplicaAutoScalingInput_.Create_DescribeTableReplicaAutoScalingInput_(com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_ToDafny(nativeInput.TableName)) + }() + +} + +func DescribeTableReplicaAutoScalingOutput_ToDafny(nativeOutput dynamodb.DescribeTableReplicaAutoScalingOutput) ComAmazonawsDynamodbTypes.DescribeTableReplicaAutoScalingOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeTableReplicaAutoScalingOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeTableReplicaAutoScalingOutput_.Create_DescribeTableReplicaAutoScalingOutput_(com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(nativeOutput.TableAutoScalingDescription)) + }() + +} + +func DescribeTimeToLiveInput_ToDafny(nativeInput dynamodb.DescribeTimeToLiveInput) ComAmazonawsDynamodbTypes.DescribeTimeToLiveInput { + + return func() ComAmazonawsDynamodbTypes.DescribeTimeToLiveInput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeTimeToLiveInput_.Create_DescribeTimeToLiveInput_(com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_ToDafny(nativeInput.TableName)) + }() + +} + +func DescribeTimeToLiveOutput_ToDafny(nativeOutput dynamodb.DescribeTimeToLiveOutput) ComAmazonawsDynamodbTypes.DescribeTimeToLiveOutput { + + return func() ComAmazonawsDynamodbTypes.DescribeTimeToLiveOutput { + + return ComAmazonawsDynamodbTypes.Companion_DescribeTimeToLiveOutput_.Create_DescribeTimeToLiveOutput_(com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_ToDafny(nativeOutput.TimeToLiveDescription)) + }() + +} + +func DisableKinesisStreamingDestinationInput_ToDafny(nativeInput dynamodb.DisableKinesisStreamingDestinationInput) ComAmazonawsDynamodbTypes.DisableKinesisStreamingDestinationInput { + + return func() ComAmazonawsDynamodbTypes.DisableKinesisStreamingDestinationInput { + + return ComAmazonawsDynamodbTypes.Companion_DisableKinesisStreamingDestinationInput_.Create_DisableKinesisStreamingDestinationInput_(com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_ToDafny(nativeInput.StreamArn), com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(nativeInput.EnableKinesisStreamingConfiguration)) + }() + +} + +func DisableKinesisStreamingDestinationOutput_ToDafny(nativeOutput dynamodb.DisableKinesisStreamingDestinationOutput) ComAmazonawsDynamodbTypes.DisableKinesisStreamingDestinationOutput { + + return func() ComAmazonawsDynamodbTypes.DisableKinesisStreamingDestinationOutput { + + return ComAmazonawsDynamodbTypes.Companion_DisableKinesisStreamingDestinationOutput_.Create_DisableKinesisStreamingDestinationOutput_(com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_ToDafny(nativeOutput.TableName), com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_ToDafny(nativeOutput.StreamArn), com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(nativeOutput.DestinationStatus), com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(nativeOutput.EnableKinesisStreamingConfiguration)) + }() + +} + +func EnableKinesisStreamingDestinationInput_ToDafny(nativeInput dynamodb.EnableKinesisStreamingDestinationInput) ComAmazonawsDynamodbTypes.EnableKinesisStreamingDestinationInput { + + return func() ComAmazonawsDynamodbTypes.EnableKinesisStreamingDestinationInput { + + return ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingDestinationInput_.Create_EnableKinesisStreamingDestinationInput_(com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_ToDafny(nativeInput.StreamArn), com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(nativeInput.EnableKinesisStreamingConfiguration)) + }() + +} + +func EnableKinesisStreamingDestinationOutput_ToDafny(nativeOutput dynamodb.EnableKinesisStreamingDestinationOutput) ComAmazonawsDynamodbTypes.EnableKinesisStreamingDestinationOutput { + + return func() ComAmazonawsDynamodbTypes.EnableKinesisStreamingDestinationOutput { + + return ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingDestinationOutput_.Create_EnableKinesisStreamingDestinationOutput_(com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_ToDafny(nativeOutput.TableName), com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_ToDafny(nativeOutput.StreamArn), com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(nativeOutput.DestinationStatus), com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(nativeOutput.EnableKinesisStreamingConfiguration)) + }() + +} + +func ExecuteStatementInput_ToDafny(nativeInput dynamodb.ExecuteStatementInput) ComAmazonawsDynamodbTypes.ExecuteStatementInput { + + return func() ComAmazonawsDynamodbTypes.ExecuteStatementInput { + + return ComAmazonawsDynamodbTypes.Companion_ExecuteStatementInput_.Create_ExecuteStatementInput_(com_amazonaws_dynamodb_ExecuteStatementInput_Statement_ToDafny(nativeInput.Statement), com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_ToDafny(nativeInput.Parameters), com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_ToDafny(nativeInput.ConsistentRead), com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_ToDafny(nativeInput.NextToken), com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_ExecuteStatementInput_Limit_ToDafny(nativeInput.Limit)) + }() + +} + +func ExecuteStatementOutput_ToDafny(nativeOutput dynamodb.ExecuteStatementOutput) ComAmazonawsDynamodbTypes.ExecuteStatementOutput { + + return func() ComAmazonawsDynamodbTypes.ExecuteStatementOutput { + + return ComAmazonawsDynamodbTypes.Companion_ExecuteStatementOutput_.Create_ExecuteStatementOutput_(com_amazonaws_dynamodb_ExecuteStatementOutput_Items_ToDafny(nativeOutput.Items), com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_ToDafny(nativeOutput.NextToken), com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity), com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_ToDafny(nativeOutput.LastEvaluatedKey)) + }() + +} + +func ExecuteTransactionInput_ToDafny(nativeInput dynamodb.ExecuteTransactionInput) ComAmazonawsDynamodbTypes.ExecuteTransactionInput { + + return func() ComAmazonawsDynamodbTypes.ExecuteTransactionInput { + + return ComAmazonawsDynamodbTypes.Companion_ExecuteTransactionInput_.Create_ExecuteTransactionInput_(com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_ToDafny(nativeInput.TransactStatements), com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_ToDafny(nativeInput.ClientRequestToken), com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity)) + }() + +} + +func ExecuteTransactionOutput_ToDafny(nativeOutput dynamodb.ExecuteTransactionOutput) ComAmazonawsDynamodbTypes.ExecuteTransactionOutput { + + return func() ComAmazonawsDynamodbTypes.ExecuteTransactionOutput { + + return ComAmazonawsDynamodbTypes.Companion_ExecuteTransactionOutput_.Create_ExecuteTransactionOutput_(com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_ToDafny(nativeOutput.Responses), com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity)) + }() + +} + +func ExportTableToPointInTimeInput_ToDafny(nativeInput dynamodb.ExportTableToPointInTimeInput) ComAmazonawsDynamodbTypes.ExportTableToPointInTimeInput { + + return func() ComAmazonawsDynamodbTypes.ExportTableToPointInTimeInput { + + return ComAmazonawsDynamodbTypes.Companion_ExportTableToPointInTimeInput_.Create_ExportTableToPointInTimeInput_(com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_ToDafny(nativeInput.TableArn), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_ToDafny(nativeInput.ExportTime), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_ToDafny(nativeInput.ClientToken), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_ToDafny(nativeInput.S3Bucket), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_ToDafny(nativeInput.S3BucketOwner), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_ToDafny(nativeInput.S3Prefix), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_ToDafny(nativeInput.S3SseAlgorithm), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_ToDafny(nativeInput.S3SseKmsKeyId), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_ToDafny(nativeInput.ExportFormat), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_ToDafny(nativeInput.ExportType), com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_ToDafny(nativeInput.IncrementalExportSpecification)) + }() + +} + +func ExportTableToPointInTimeOutput_ToDafny(nativeOutput dynamodb.ExportTableToPointInTimeOutput) ComAmazonawsDynamodbTypes.ExportTableToPointInTimeOutput { + + return func() ComAmazonawsDynamodbTypes.ExportTableToPointInTimeOutput { + + return ComAmazonawsDynamodbTypes.Companion_ExportTableToPointInTimeOutput_.Create_ExportTableToPointInTimeOutput_(com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_ToDafny(nativeOutput.ExportDescription)) + }() + +} + +func GetItemInput_ToDafny(nativeInput dynamodb.GetItemInput) ComAmazonawsDynamodbTypes.GetItemInput { + + return func() ComAmazonawsDynamodbTypes.GetItemInput { + + return ComAmazonawsDynamodbTypes.Companion_GetItemInput_.Create_GetItemInput_(com_amazonaws_dynamodb_GetItemInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_GetItemInput_Key_ToDafny(nativeInput.Key), com_amazonaws_dynamodb_GetItemInput_AttributesToGet_ToDafny(nativeInput.AttributesToGet), com_amazonaws_dynamodb_GetItemInput_ConsistentRead_ToDafny(nativeInput.ConsistentRead), com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_ToDafny(nativeInput.ProjectionExpression), com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_ToDafny(nativeInput.ExpressionAttributeNames)) + }() + +} + +func GetItemOutput_ToDafny(nativeOutput dynamodb.GetItemOutput) ComAmazonawsDynamodbTypes.GetItemOutput { + + return func() ComAmazonawsDynamodbTypes.GetItemOutput { + + return ComAmazonawsDynamodbTypes.Companion_GetItemOutput_.Create_GetItemOutput_(com_amazonaws_dynamodb_GetItemOutput_Item_ToDafny(nativeOutput.Item), com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity)) + }() + +} + +func GetResourcePolicyInput_ToDafny(nativeInput dynamodb.GetResourcePolicyInput) ComAmazonawsDynamodbTypes.GetResourcePolicyInput { + + return func() ComAmazonawsDynamodbTypes.GetResourcePolicyInput { + + return ComAmazonawsDynamodbTypes.Companion_GetResourcePolicyInput_.Create_GetResourcePolicyInput_(com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_ToDafny(nativeInput.ResourceArn)) + }() + +} + +func GetResourcePolicyOutput_ToDafny(nativeOutput dynamodb.GetResourcePolicyOutput) ComAmazonawsDynamodbTypes.GetResourcePolicyOutput { + + return func() ComAmazonawsDynamodbTypes.GetResourcePolicyOutput { + + return ComAmazonawsDynamodbTypes.Companion_GetResourcePolicyOutput_.Create_GetResourcePolicyOutput_(com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_ToDafny(nativeOutput.Policy), com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_ToDafny(nativeOutput.RevisionId)) + }() + +} + +func ImportTableInput_ToDafny(nativeInput dynamodb.ImportTableInput) ComAmazonawsDynamodbTypes.ImportTableInput { + + return func() ComAmazonawsDynamodbTypes.ImportTableInput { + + return ComAmazonawsDynamodbTypes.Companion_ImportTableInput_.Create_ImportTableInput_(com_amazonaws_dynamodb_ImportTableInput_ClientToken_ToDafny(nativeInput.ClientToken), com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_ToDafny(nativeInput.S3BucketSource), com_amazonaws_dynamodb_ImportTableInput_InputFormat_ToDafny(nativeInput.InputFormat), com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_ToDafny(nativeInput.InputFormatOptions), com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_ToDafny(nativeInput.InputCompressionType), com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_ToDafny(nativeInput.TableCreationParameters)) + }() + +} + +func ImportTableOutput_ToDafny(nativeOutput dynamodb.ImportTableOutput) ComAmazonawsDynamodbTypes.ImportTableOutput { + + return func() ComAmazonawsDynamodbTypes.ImportTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_ImportTableOutput_.Create_ImportTableOutput_(com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_ToDafny(nativeOutput.ImportTableDescription)) + }() + +} + +func ListBackupsInput_ToDafny(nativeInput dynamodb.ListBackupsInput) ComAmazonawsDynamodbTypes.ListBackupsInput { + + return func() ComAmazonawsDynamodbTypes.ListBackupsInput { + + return ComAmazonawsDynamodbTypes.Companion_ListBackupsInput_.Create_ListBackupsInput_(com_amazonaws_dynamodb_ListBackupsInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_ListBackupsInput_Limit_ToDafny(nativeInput.Limit), com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_ToDafny(nativeInput.TimeRangeLowerBound), com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_ToDafny(nativeInput.TimeRangeUpperBound), com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_ToDafny(nativeInput.ExclusiveStartBackupArn), com_amazonaws_dynamodb_ListBackupsInput_BackupType_ToDafny(nativeInput.BackupType)) + }() + +} + +func ListBackupsOutput_ToDafny(nativeOutput dynamodb.ListBackupsOutput) ComAmazonawsDynamodbTypes.ListBackupsOutput { + + return func() ComAmazonawsDynamodbTypes.ListBackupsOutput { + + return ComAmazonawsDynamodbTypes.Companion_ListBackupsOutput_.Create_ListBackupsOutput_(com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_ToDafny(nativeOutput.BackupSummaries), com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_ToDafny(nativeOutput.LastEvaluatedBackupArn)) + }() + +} + +func ListContributorInsightsInput_ToDafny(nativeInput dynamodb.ListContributorInsightsInput) ComAmazonawsDynamodbTypes.ListContributorInsightsInput { + + return func() ComAmazonawsDynamodbTypes.ListContributorInsightsInput { + + return ComAmazonawsDynamodbTypes.Companion_ListContributorInsightsInput_.Create_ListContributorInsightsInput_(com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_ToDafny(nativeInput.NextToken), com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_ToDafny(nativeInput.MaxResults)) + }() + +} + +func ListContributorInsightsOutput_ToDafny(nativeOutput dynamodb.ListContributorInsightsOutput) ComAmazonawsDynamodbTypes.ListContributorInsightsOutput { + + return func() ComAmazonawsDynamodbTypes.ListContributorInsightsOutput { + + return ComAmazonawsDynamodbTypes.Companion_ListContributorInsightsOutput_.Create_ListContributorInsightsOutput_(com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_ToDafny(nativeOutput.ContributorInsightsSummaries), com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_ToDafny(nativeOutput.NextToken)) + }() + +} + +func ListExportsInput_ToDafny(nativeInput dynamodb.ListExportsInput) ComAmazonawsDynamodbTypes.ListExportsInput { + + return func() ComAmazonawsDynamodbTypes.ListExportsInput { + + return ComAmazonawsDynamodbTypes.Companion_ListExportsInput_.Create_ListExportsInput_(com_amazonaws_dynamodb_ListExportsInput_TableArn_ToDafny(nativeInput.TableArn), com_amazonaws_dynamodb_ListExportsInput_MaxResults_ToDafny(nativeInput.MaxResults), com_amazonaws_dynamodb_ListExportsInput_NextToken_ToDafny(nativeInput.NextToken)) + }() + +} + +func ListExportsOutput_ToDafny(nativeOutput dynamodb.ListExportsOutput) ComAmazonawsDynamodbTypes.ListExportsOutput { + + return func() ComAmazonawsDynamodbTypes.ListExportsOutput { + + return ComAmazonawsDynamodbTypes.Companion_ListExportsOutput_.Create_ListExportsOutput_(com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_ToDafny(nativeOutput.ExportSummaries), com_amazonaws_dynamodb_ListExportsOutput_NextToken_ToDafny(nativeOutput.NextToken)) + }() + +} + +func ListGlobalTablesInput_ToDafny(nativeInput dynamodb.ListGlobalTablesInput) ComAmazonawsDynamodbTypes.ListGlobalTablesInput { + + return func() ComAmazonawsDynamodbTypes.ListGlobalTablesInput { + + return ComAmazonawsDynamodbTypes.Companion_ListGlobalTablesInput_.Create_ListGlobalTablesInput_(com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_ToDafny(nativeInput.ExclusiveStartGlobalTableName), com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_ToDafny(nativeInput.Limit), com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_ToDafny(nativeInput.RegionName)) + }() + +} + +func ListGlobalTablesOutput_ToDafny(nativeOutput dynamodb.ListGlobalTablesOutput) ComAmazonawsDynamodbTypes.ListGlobalTablesOutput { + + return func() ComAmazonawsDynamodbTypes.ListGlobalTablesOutput { + + return ComAmazonawsDynamodbTypes.Companion_ListGlobalTablesOutput_.Create_ListGlobalTablesOutput_(com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_ToDafny(nativeOutput.GlobalTables), com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_ToDafny(nativeOutput.LastEvaluatedGlobalTableName)) + }() + +} + +func ListImportsInput_ToDafny(nativeInput dynamodb.ListImportsInput) ComAmazonawsDynamodbTypes.ListImportsInput { + + return func() ComAmazonawsDynamodbTypes.ListImportsInput { + + return ComAmazonawsDynamodbTypes.Companion_ListImportsInput_.Create_ListImportsInput_(com_amazonaws_dynamodb_ListImportsInput_TableArn_ToDafny(nativeInput.TableArn), com_amazonaws_dynamodb_ListImportsInput_PageSize_ToDafny(nativeInput.PageSize), com_amazonaws_dynamodb_ListImportsInput_NextToken_ToDafny(nativeInput.NextToken)) + }() + +} + +func ListImportsOutput_ToDafny(nativeOutput dynamodb.ListImportsOutput) ComAmazonawsDynamodbTypes.ListImportsOutput { + + return func() ComAmazonawsDynamodbTypes.ListImportsOutput { + + return ComAmazonawsDynamodbTypes.Companion_ListImportsOutput_.Create_ListImportsOutput_(com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_ToDafny(nativeOutput.ImportSummaryList), com_amazonaws_dynamodb_ListImportsOutput_NextToken_ToDafny(nativeOutput.NextToken)) + }() + +} + +func ListTablesInput_ToDafny(nativeInput dynamodb.ListTablesInput) ComAmazonawsDynamodbTypes.ListTablesInput { + + return func() ComAmazonawsDynamodbTypes.ListTablesInput { + + return ComAmazonawsDynamodbTypes.Companion_ListTablesInput_.Create_ListTablesInput_(com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_ToDafny(nativeInput.ExclusiveStartTableName), com_amazonaws_dynamodb_ListTablesInput_Limit_ToDafny(nativeInput.Limit)) + }() + +} + +func ListTablesOutput_ToDafny(nativeOutput dynamodb.ListTablesOutput) ComAmazonawsDynamodbTypes.ListTablesOutput { + + return func() ComAmazonawsDynamodbTypes.ListTablesOutput { + + return ComAmazonawsDynamodbTypes.Companion_ListTablesOutput_.Create_ListTablesOutput_(com_amazonaws_dynamodb_ListTablesOutput_TableNames_ToDafny(nativeOutput.TableNames), com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_ToDafny(nativeOutput.LastEvaluatedTableName)) + }() + +} + +func ListTagsOfResourceInput_ToDafny(nativeInput dynamodb.ListTagsOfResourceInput) ComAmazonawsDynamodbTypes.ListTagsOfResourceInput { + + return func() ComAmazonawsDynamodbTypes.ListTagsOfResourceInput { + + return ComAmazonawsDynamodbTypes.Companion_ListTagsOfResourceInput_.Create_ListTagsOfResourceInput_(com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_ToDafny(nativeInput.ResourceArn), com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_ToDafny(nativeInput.NextToken)) + }() + +} + +func ListTagsOfResourceOutput_ToDafny(nativeOutput dynamodb.ListTagsOfResourceOutput) ComAmazonawsDynamodbTypes.ListTagsOfResourceOutput { + + return func() ComAmazonawsDynamodbTypes.ListTagsOfResourceOutput { + + return ComAmazonawsDynamodbTypes.Companion_ListTagsOfResourceOutput_.Create_ListTagsOfResourceOutput_(com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_ToDafny(nativeOutput.Tags), com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_ToDafny(nativeOutput.NextToken)) + }() + +} + +func PutItemInput_ToDafny(nativeInput dynamodb.PutItemInput) ComAmazonawsDynamodbTypes.PutItemInput { + + return func() ComAmazonawsDynamodbTypes.PutItemInput { + + return ComAmazonawsDynamodbTypes.Companion_PutItemInput_.Create_PutItemInput_(com_amazonaws_dynamodb_PutItemInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_PutItemInput_Item_ToDafny(nativeInput.Item), com_amazonaws_dynamodb_PutItemInput_Expected_ToDafny(nativeInput.Expected), com_amazonaws_dynamodb_PutItemInput_ReturnValues_ToDafny(nativeInput.ReturnValues), com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_ToDafny(nativeInput.ReturnItemCollectionMetrics), com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_ToDafny(nativeInput.ConditionalOperator), com_amazonaws_dynamodb_PutItemInput_ConditionExpression_ToDafny(nativeInput.ConditionExpression), com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_ToDafny(nativeInput.ExpressionAttributeNames), com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_ToDafny(nativeInput.ExpressionAttributeValues)) + }() + +} + +func PutItemOutput_ToDafny(nativeOutput dynamodb.PutItemOutput) ComAmazonawsDynamodbTypes.PutItemOutput { + + return func() ComAmazonawsDynamodbTypes.PutItemOutput { + + return ComAmazonawsDynamodbTypes.Companion_PutItemOutput_.Create_PutItemOutput_(com_amazonaws_dynamodb_PutItemOutput_Attributes_ToDafny(nativeOutput.Attributes), com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity), com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_ToDafny(nativeOutput.ItemCollectionMetrics)) + }() + +} + +func PutResourcePolicyInput_ToDafny(nativeInput dynamodb.PutResourcePolicyInput) ComAmazonawsDynamodbTypes.PutResourcePolicyInput { + + return func() ComAmazonawsDynamodbTypes.PutResourcePolicyInput { + + return ComAmazonawsDynamodbTypes.Companion_PutResourcePolicyInput_.Create_PutResourcePolicyInput_(com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_ToDafny(nativeInput.ResourceArn), com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_ToDafny(nativeInput.Policy), com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_ToDafny(nativeInput.ExpectedRevisionId), com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_ToDafny(nativeInput.ConfirmRemoveSelfResourceAccess)) + }() + +} + +func PutResourcePolicyOutput_ToDafny(nativeOutput dynamodb.PutResourcePolicyOutput) ComAmazonawsDynamodbTypes.PutResourcePolicyOutput { + + return func() ComAmazonawsDynamodbTypes.PutResourcePolicyOutput { + + return ComAmazonawsDynamodbTypes.Companion_PutResourcePolicyOutput_.Create_PutResourcePolicyOutput_(com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_ToDafny(nativeOutput.RevisionId)) + }() + +} + +func QueryInput_ToDafny(nativeInput dynamodb.QueryInput) ComAmazonawsDynamodbTypes.QueryInput { + + return func() ComAmazonawsDynamodbTypes.QueryInput { + + return ComAmazonawsDynamodbTypes.Companion_QueryInput_.Create_QueryInput_(com_amazonaws_dynamodb_QueryInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_QueryInput_IndexName_ToDafny(nativeInput.IndexName), com_amazonaws_dynamodb_QueryInput_Select_ToDafny(nativeInput.Select), com_amazonaws_dynamodb_QueryInput_AttributesToGet_ToDafny(nativeInput.AttributesToGet), com_amazonaws_dynamodb_QueryInput_Limit_ToDafny(nativeInput.Limit), com_amazonaws_dynamodb_QueryInput_ConsistentRead_ToDafny(nativeInput.ConsistentRead), com_amazonaws_dynamodb_QueryInput_KeyConditions_ToDafny(nativeInput.KeyConditions), com_amazonaws_dynamodb_QueryInput_QueryFilter_ToDafny(nativeInput.QueryFilter), com_amazonaws_dynamodb_QueryInput_ConditionalOperator_ToDafny(nativeInput.ConditionalOperator), com_amazonaws_dynamodb_QueryInput_ScanIndexForward_ToDafny(nativeInput.ScanIndexForward), com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_ToDafny(nativeInput.ExclusiveStartKey), com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_QueryInput_ProjectionExpression_ToDafny(nativeInput.ProjectionExpression), com_amazonaws_dynamodb_QueryInput_FilterExpression_ToDafny(nativeInput.FilterExpression), com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_ToDafny(nativeInput.KeyConditionExpression), com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_ToDafny(nativeInput.ExpressionAttributeNames), com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_ToDafny(nativeInput.ExpressionAttributeValues)) + }() + +} + +func QueryOutput_ToDafny(nativeOutput dynamodb.QueryOutput) ComAmazonawsDynamodbTypes.QueryOutput { + + return func() ComAmazonawsDynamodbTypes.QueryOutput { + + return ComAmazonawsDynamodbTypes.Companion_QueryOutput_.Create_QueryOutput_(com_amazonaws_dynamodb_QueryOutput_Items_ToDafny(nativeOutput.Items), com_amazonaws_dynamodb_QueryOutput_Count_ToDafny(nativeOutput.Count), com_amazonaws_dynamodb_QueryOutput_ScannedCount_ToDafny(nativeOutput.ScannedCount), com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_ToDafny(nativeOutput.LastEvaluatedKey), com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity)) + }() + +} + +func RestoreTableFromBackupInput_ToDafny(nativeInput dynamodb.RestoreTableFromBackupInput) ComAmazonawsDynamodbTypes.RestoreTableFromBackupInput { + + return func() ComAmazonawsDynamodbTypes.RestoreTableFromBackupInput { + + return ComAmazonawsDynamodbTypes.Companion_RestoreTableFromBackupInput_.Create_RestoreTableFromBackupInput_(com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_ToDafny(nativeInput.TargetTableName), com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_ToDafny(nativeInput.BackupArn), com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_ToDafny(nativeInput.BillingModeOverride), com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_ToDafny(nativeInput.GlobalSecondaryIndexOverride), com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_ToDafny(nativeInput.LocalSecondaryIndexOverride), com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_ToDafny(nativeInput.ProvisionedThroughputOverride), com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_ToDafny(nativeInput.OnDemandThroughputOverride), com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_ToDafny(nativeInput.SSESpecificationOverride)) + }() + +} + +func RestoreTableFromBackupOutput_ToDafny(nativeOutput dynamodb.RestoreTableFromBackupOutput) ComAmazonawsDynamodbTypes.RestoreTableFromBackupOutput { + + return func() ComAmazonawsDynamodbTypes.RestoreTableFromBackupOutput { + + return ComAmazonawsDynamodbTypes.Companion_RestoreTableFromBackupOutput_.Create_RestoreTableFromBackupOutput_(com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_ToDafny(nativeOutput.TableDescription)) + }() + +} + +func RestoreTableToPointInTimeInput_ToDafny(nativeInput dynamodb.RestoreTableToPointInTimeInput) ComAmazonawsDynamodbTypes.RestoreTableToPointInTimeInput { + + return func() ComAmazonawsDynamodbTypes.RestoreTableToPointInTimeInput { + + return ComAmazonawsDynamodbTypes.Companion_RestoreTableToPointInTimeInput_.Create_RestoreTableToPointInTimeInput_(com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_ToDafny(nativeInput.SourceTableArn), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_ToDafny(nativeInput.SourceTableName), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_ToDafny(nativeInput.TargetTableName), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_ToDafny(nativeInput.UseLatestRestorableTime), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_ToDafny(nativeInput.RestoreDateTime), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_ToDafny(nativeInput.BillingModeOverride), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_ToDafny(nativeInput.GlobalSecondaryIndexOverride), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_ToDafny(nativeInput.LocalSecondaryIndexOverride), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_ToDafny(nativeInput.ProvisionedThroughputOverride), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_ToDafny(nativeInput.OnDemandThroughputOverride), com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_ToDafny(nativeInput.SSESpecificationOverride)) + }() + +} + +func RestoreTableToPointInTimeOutput_ToDafny(nativeOutput dynamodb.RestoreTableToPointInTimeOutput) ComAmazonawsDynamodbTypes.RestoreTableToPointInTimeOutput { + + return func() ComAmazonawsDynamodbTypes.RestoreTableToPointInTimeOutput { + + return ComAmazonawsDynamodbTypes.Companion_RestoreTableToPointInTimeOutput_.Create_RestoreTableToPointInTimeOutput_(com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_ToDafny(nativeOutput.TableDescription)) + }() + +} + +func ScanInput_ToDafny(nativeInput dynamodb.ScanInput) ComAmazonawsDynamodbTypes.ScanInput { + + return func() ComAmazonawsDynamodbTypes.ScanInput { + + return ComAmazonawsDynamodbTypes.Companion_ScanInput_.Create_ScanInput_(com_amazonaws_dynamodb_ScanInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_ScanInput_IndexName_ToDafny(nativeInput.IndexName), com_amazonaws_dynamodb_ScanInput_AttributesToGet_ToDafny(nativeInput.AttributesToGet), com_amazonaws_dynamodb_ScanInput_Limit_ToDafny(nativeInput.Limit), com_amazonaws_dynamodb_ScanInput_Select_ToDafny(nativeInput.Select), com_amazonaws_dynamodb_ScanInput_ScanFilter_ToDafny(nativeInput.ScanFilter), com_amazonaws_dynamodb_ScanInput_ConditionalOperator_ToDafny(nativeInput.ConditionalOperator), com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_ToDafny(nativeInput.ExclusiveStartKey), com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_ScanInput_TotalSegments_ToDafny(nativeInput.TotalSegments), com_amazonaws_dynamodb_ScanInput_Segment_ToDafny(nativeInput.Segment), com_amazonaws_dynamodb_ScanInput_ProjectionExpression_ToDafny(nativeInput.ProjectionExpression), com_amazonaws_dynamodb_ScanInput_FilterExpression_ToDafny(nativeInput.FilterExpression), com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_ToDafny(nativeInput.ExpressionAttributeNames), com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_ToDafny(nativeInput.ExpressionAttributeValues), com_amazonaws_dynamodb_ScanInput_ConsistentRead_ToDafny(nativeInput.ConsistentRead)) + }() + +} + +func ScanOutput_ToDafny(nativeOutput dynamodb.ScanOutput) ComAmazonawsDynamodbTypes.ScanOutput { + + return func() ComAmazonawsDynamodbTypes.ScanOutput { + + return ComAmazonawsDynamodbTypes.Companion_ScanOutput_.Create_ScanOutput_(com_amazonaws_dynamodb_ScanOutput_Items_ToDafny(nativeOutput.Items), com_amazonaws_dynamodb_ScanOutput_Count_ToDafny(nativeOutput.Count), com_amazonaws_dynamodb_ScanOutput_ScannedCount_ToDafny(nativeOutput.ScannedCount), com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_ToDafny(nativeOutput.LastEvaluatedKey), com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity)) + }() + +} + +func TagResourceInput_ToDafny(nativeInput dynamodb.TagResourceInput) ComAmazonawsDynamodbTypes.TagResourceInput { + + return func() ComAmazonawsDynamodbTypes.TagResourceInput { + + return ComAmazonawsDynamodbTypes.Companion_TagResourceInput_.Create_TagResourceInput_(com_amazonaws_dynamodb_TagResourceInput_ResourceArn_ToDafny(nativeInput.ResourceArn), com_amazonaws_dynamodb_TagResourceInput_Tags_ToDafny(nativeInput.Tags)) + }() + +} + +func TransactGetItemsInput_ToDafny(nativeInput dynamodb.TransactGetItemsInput) ComAmazonawsDynamodbTypes.TransactGetItemsInput { + + return func() ComAmazonawsDynamodbTypes.TransactGetItemsInput { + + return ComAmazonawsDynamodbTypes.Companion_TransactGetItemsInput_.Create_TransactGetItemsInput_(com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_ToDafny(nativeInput.TransactItems), com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity)) + }() + +} + +func TransactGetItemsOutput_ToDafny(nativeOutput dynamodb.TransactGetItemsOutput) ComAmazonawsDynamodbTypes.TransactGetItemsOutput { + + return func() ComAmazonawsDynamodbTypes.TransactGetItemsOutput { + + return ComAmazonawsDynamodbTypes.Companion_TransactGetItemsOutput_.Create_TransactGetItemsOutput_(com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity), com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_ToDafny(nativeOutput.Responses)) + }() + +} + +func TransactWriteItemsInput_ToDafny(nativeInput dynamodb.TransactWriteItemsInput) ComAmazonawsDynamodbTypes.TransactWriteItemsInput { + + return func() ComAmazonawsDynamodbTypes.TransactWriteItemsInput { + + return ComAmazonawsDynamodbTypes.Companion_TransactWriteItemsInput_.Create_TransactWriteItemsInput_(com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_ToDafny(nativeInput.TransactItems), com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_ToDafny(nativeInput.ReturnItemCollectionMetrics), com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_ToDafny(nativeInput.ClientRequestToken)) + }() + +} + +func TransactWriteItemsOutput_ToDafny(nativeOutput dynamodb.TransactWriteItemsOutput) ComAmazonawsDynamodbTypes.TransactWriteItemsOutput { + + return func() ComAmazonawsDynamodbTypes.TransactWriteItemsOutput { + + return ComAmazonawsDynamodbTypes.Companion_TransactWriteItemsOutput_.Create_TransactWriteItemsOutput_(com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity), com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_ToDafny(nativeOutput.ItemCollectionMetrics)) + }() + +} + +func UntagResourceInput_ToDafny(nativeInput dynamodb.UntagResourceInput) ComAmazonawsDynamodbTypes.UntagResourceInput { + + return func() ComAmazonawsDynamodbTypes.UntagResourceInput { + + return ComAmazonawsDynamodbTypes.Companion_UntagResourceInput_.Create_UntagResourceInput_(com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_ToDafny(nativeInput.ResourceArn), com_amazonaws_dynamodb_UntagResourceInput_TagKeys_ToDafny(nativeInput.TagKeys)) + }() + +} + +func UpdateContinuousBackupsInput_ToDafny(nativeInput dynamodb.UpdateContinuousBackupsInput) ComAmazonawsDynamodbTypes.UpdateContinuousBackupsInput { + + return func() ComAmazonawsDynamodbTypes.UpdateContinuousBackupsInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateContinuousBackupsInput_.Create_UpdateContinuousBackupsInput_(com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_ToDafny(nativeInput.PointInTimeRecoverySpecification)) + }() + +} + +func UpdateContinuousBackupsOutput_ToDafny(nativeOutput dynamodb.UpdateContinuousBackupsOutput) ComAmazonawsDynamodbTypes.UpdateContinuousBackupsOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateContinuousBackupsOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateContinuousBackupsOutput_.Create_UpdateContinuousBackupsOutput_(com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(nativeOutput.ContinuousBackupsDescription)) + }() + +} + +func UpdateContributorInsightsInput_ToDafny(nativeInput dynamodb.UpdateContributorInsightsInput) ComAmazonawsDynamodbTypes.UpdateContributorInsightsInput { + + return func() ComAmazonawsDynamodbTypes.UpdateContributorInsightsInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateContributorInsightsInput_.Create_UpdateContributorInsightsInput_(com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_ToDafny(nativeInput.IndexName), com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_ToDafny(nativeInput.ContributorInsightsAction)) + }() + +} + +func UpdateContributorInsightsOutput_ToDafny(nativeOutput dynamodb.UpdateContributorInsightsOutput) ComAmazonawsDynamodbTypes.UpdateContributorInsightsOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateContributorInsightsOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateContributorInsightsOutput_.Create_UpdateContributorInsightsOutput_(com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_ToDafny(nativeOutput.TableName), com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_ToDafny(nativeOutput.IndexName), com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_ToDafny(nativeOutput.ContributorInsightsStatus)) + }() + +} + +func UpdateGlobalTableInput_ToDafny(nativeInput dynamodb.UpdateGlobalTableInput) ComAmazonawsDynamodbTypes.UpdateGlobalTableInput { + + return func() ComAmazonawsDynamodbTypes.UpdateGlobalTableInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateGlobalTableInput_.Create_UpdateGlobalTableInput_(com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_ToDafny(nativeInput.GlobalTableName), com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_ToDafny(nativeInput.ReplicaUpdates)) + }() + +} + +func UpdateGlobalTableOutput_ToDafny(nativeOutput dynamodb.UpdateGlobalTableOutput) ComAmazonawsDynamodbTypes.UpdateGlobalTableOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateGlobalTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateGlobalTableOutput_.Create_UpdateGlobalTableOutput_(com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_ToDafny(nativeOutput.GlobalTableDescription)) + }() + +} + +func UpdateGlobalTableSettingsInput_ToDafny(nativeInput dynamodb.UpdateGlobalTableSettingsInput) ComAmazonawsDynamodbTypes.UpdateGlobalTableSettingsInput { + + return func() ComAmazonawsDynamodbTypes.UpdateGlobalTableSettingsInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateGlobalTableSettingsInput_.Create_UpdateGlobalTableSettingsInput_(com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_ToDafny(nativeInput.GlobalTableName), com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_ToDafny(nativeInput.GlobalTableBillingMode), com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_ToDafny(nativeInput.GlobalTableProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(nativeInput.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate), com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_ToDafny(nativeInput.GlobalTableGlobalSecondaryIndexSettingsUpdate), com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_ToDafny(nativeInput.ReplicaSettingsUpdate)) + }() + +} + +func UpdateGlobalTableSettingsOutput_ToDafny(nativeOutput dynamodb.UpdateGlobalTableSettingsOutput) ComAmazonawsDynamodbTypes.UpdateGlobalTableSettingsOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateGlobalTableSettingsOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateGlobalTableSettingsOutput_.Create_UpdateGlobalTableSettingsOutput_(com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_ToDafny(nativeOutput.GlobalTableName), com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_ToDafny(nativeOutput.ReplicaSettings)) + }() + +} + +func UpdateItemInput_ToDafny(nativeInput dynamodb.UpdateItemInput) ComAmazonawsDynamodbTypes.UpdateItemInput { + + return func() ComAmazonawsDynamodbTypes.UpdateItemInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateItemInput_.Create_UpdateItemInput_(com_amazonaws_dynamodb_UpdateItemInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_UpdateItemInput_Key_ToDafny(nativeInput.Key), com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_ToDafny(nativeInput.AttributeUpdates), com_amazonaws_dynamodb_UpdateItemInput_Expected_ToDafny(nativeInput.Expected), com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_ToDafny(nativeInput.ConditionalOperator), com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_ToDafny(nativeInput.ReturnValues), com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_ToDafny(nativeInput.ReturnConsumedCapacity), com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_ToDafny(nativeInput.ReturnItemCollectionMetrics), com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_ToDafny(nativeInput.UpdateExpression), com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_ToDafny(nativeInput.ConditionExpression), com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_ToDafny(nativeInput.ExpressionAttributeNames), com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_ToDafny(nativeInput.ExpressionAttributeValues)) + }() + +} + +func UpdateItemOutput_ToDafny(nativeOutput dynamodb.UpdateItemOutput) ComAmazonawsDynamodbTypes.UpdateItemOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateItemOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateItemOutput_.Create_UpdateItemOutput_(com_amazonaws_dynamodb_UpdateItemOutput_Attributes_ToDafny(nativeOutput.Attributes), com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_ToDafny(nativeOutput.ConsumedCapacity), com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_ToDafny(nativeOutput.ItemCollectionMetrics)) + }() + +} + +func UpdateKinesisStreamingDestinationInput_ToDafny(nativeInput dynamodb.UpdateKinesisStreamingDestinationInput) ComAmazonawsDynamodbTypes.UpdateKinesisStreamingDestinationInput { + + return func() ComAmazonawsDynamodbTypes.UpdateKinesisStreamingDestinationInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingDestinationInput_.Create_UpdateKinesisStreamingDestinationInput_(com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_ToDafny(nativeInput.StreamArn), com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_ToDafny(nativeInput.UpdateKinesisStreamingConfiguration)) + }() + +} + +func UpdateKinesisStreamingDestinationOutput_ToDafny(nativeOutput dynamodb.UpdateKinesisStreamingDestinationOutput) ComAmazonawsDynamodbTypes.UpdateKinesisStreamingDestinationOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateKinesisStreamingDestinationOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingDestinationOutput_.Create_UpdateKinesisStreamingDestinationOutput_(com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_ToDafny(nativeOutput.TableName), com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_ToDafny(nativeOutput.StreamArn), com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(nativeOutput.DestinationStatus), com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_ToDafny(nativeOutput.UpdateKinesisStreamingConfiguration)) + }() + +} + +func UpdateTableInput_ToDafny(nativeInput dynamodb.UpdateTableInput) ComAmazonawsDynamodbTypes.UpdateTableInput { + + return func() ComAmazonawsDynamodbTypes.UpdateTableInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateTableInput_.Create_UpdateTableInput_(com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_ToDafny(nativeInput.AttributeDefinitions), com_amazonaws_dynamodb_UpdateTableInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_UpdateTableInput_BillingMode_ToDafny(nativeInput.BillingMode), com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_ToDafny(nativeInput.ProvisionedThroughput), com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_ToDafny(nativeInput.GlobalSecondaryIndexUpdates), com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_ToDafny(nativeInput.StreamSpecification), com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_ToDafny(nativeInput.SSESpecification), com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_ToDafny(nativeInput.ReplicaUpdates), com_amazonaws_dynamodb_UpdateTableInput_TableClass_ToDafny(nativeInput.TableClass), com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_ToDafny(nativeInput.DeletionProtectionEnabled), com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_ToDafny(nativeInput.OnDemandThroughput)) + }() + +} + +func UpdateTableOutput_ToDafny(nativeOutput dynamodb.UpdateTableOutput) ComAmazonawsDynamodbTypes.UpdateTableOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateTableOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateTableOutput_.Create_UpdateTableOutput_(com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_ToDafny(nativeOutput.TableDescription)) + }() + +} + +func UpdateTableReplicaAutoScalingInput_ToDafny(nativeInput dynamodb.UpdateTableReplicaAutoScalingInput) ComAmazonawsDynamodbTypes.UpdateTableReplicaAutoScalingInput { + + return func() ComAmazonawsDynamodbTypes.UpdateTableReplicaAutoScalingInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateTableReplicaAutoScalingInput_.Create_UpdateTableReplicaAutoScalingInput_(com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_ToDafny(nativeInput.GlobalSecondaryIndexUpdates), com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(nativeInput.ProvisionedWriteCapacityAutoScalingUpdate), com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_ToDafny(nativeInput.ReplicaUpdates)) + }() + +} + +func UpdateTableReplicaAutoScalingOutput_ToDafny(nativeOutput dynamodb.UpdateTableReplicaAutoScalingOutput) ComAmazonawsDynamodbTypes.UpdateTableReplicaAutoScalingOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateTableReplicaAutoScalingOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateTableReplicaAutoScalingOutput_.Create_UpdateTableReplicaAutoScalingOutput_(com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(nativeOutput.TableAutoScalingDescription)) + }() + +} + +func UpdateTimeToLiveInput_ToDafny(nativeInput dynamodb.UpdateTimeToLiveInput) ComAmazonawsDynamodbTypes.UpdateTimeToLiveInput { + + return func() ComAmazonawsDynamodbTypes.UpdateTimeToLiveInput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateTimeToLiveInput_.Create_UpdateTimeToLiveInput_(com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_ToDafny(nativeInput.TableName), com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_ToDafny(nativeInput.TimeToLiveSpecification)) + }() + +} + +func UpdateTimeToLiveOutput_ToDafny(nativeOutput dynamodb.UpdateTimeToLiveOutput) ComAmazonawsDynamodbTypes.UpdateTimeToLiveOutput { + + return func() ComAmazonawsDynamodbTypes.UpdateTimeToLiveOutput { + + return ComAmazonawsDynamodbTypes.Companion_UpdateTimeToLiveOutput_.Create_UpdateTimeToLiveOutput_(com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_ToDafny(nativeOutput.TimeToLiveSpecification)) + }() + +} + +func BackupInUseException_ToDafny(nativeInput types.BackupInUseException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_BackupInUseException_(com_amazonaws_dynamodb_BackupInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func BackupNotFoundException_ToDafny(nativeInput types.BackupNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_BackupNotFoundException_(com_amazonaws_dynamodb_BackupNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ConditionalCheckFailedException_ToDafny(nativeInput types.ConditionalCheckFailedException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ConditionalCheckFailedException_(com_amazonaws_dynamodb_ConditionalCheckFailedException_message_ToDafny(nativeInput.Message), com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_ToDafny(nativeInput.Item)) + }() + +} + +func ContinuousBackupsUnavailableException_ToDafny(nativeInput types.ContinuousBackupsUnavailableException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ContinuousBackupsUnavailableException_(com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_ToDafny(nativeInput.Message)) + }() + +} + +func DuplicateItemException_ToDafny(nativeInput types.DuplicateItemException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_DuplicateItemException_(com_amazonaws_dynamodb_DuplicateItemException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ExportConflictException_ToDafny(nativeInput types.ExportConflictException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ExportConflictException_(com_amazonaws_dynamodb_ExportConflictException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ExportNotFoundException_ToDafny(nativeInput types.ExportNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ExportNotFoundException_(com_amazonaws_dynamodb_ExportNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func GlobalTableAlreadyExistsException_ToDafny(nativeInput types.GlobalTableAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_GlobalTableAlreadyExistsException_(com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_ToDafny(nativeInput.Message)) + }() + +} + +func GlobalTableNotFoundException_ToDafny(nativeInput types.GlobalTableNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_GlobalTableNotFoundException_(com_amazonaws_dynamodb_GlobalTableNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func IdempotentParameterMismatchException_ToDafny(nativeInput types.IdempotentParameterMismatchException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_IdempotentParameterMismatchException_(com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_ToDafny(nativeInput.Message)) + }() + +} + +func ImportConflictException_ToDafny(nativeInput types.ImportConflictException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ImportConflictException_(com_amazonaws_dynamodb_ImportConflictException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ImportNotFoundException_ToDafny(nativeInput types.ImportNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ImportNotFoundException_(com_amazonaws_dynamodb_ImportNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func IndexNotFoundException_ToDafny(nativeInput types.IndexNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_IndexNotFoundException_(com_amazonaws_dynamodb_IndexNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InternalServerError_ToDafny(nativeInput types.InternalServerError) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InternalServerError_(com_amazonaws_dynamodb_InternalServerError_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidEndpointException_ToDafny(nativeInput types.InvalidEndpointException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidEndpointException_(com_amazonaws_dynamodb_InvalidEndpointException_Message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidExportTimeException_ToDafny(nativeInput types.InvalidExportTimeException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidExportTimeException_(com_amazonaws_dynamodb_InvalidExportTimeException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidRestoreTimeException_ToDafny(nativeInput types.InvalidRestoreTimeException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_InvalidRestoreTimeException_(com_amazonaws_dynamodb_InvalidRestoreTimeException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ItemCollectionSizeLimitExceededException_ToDafny(nativeInput types.ItemCollectionSizeLimitExceededException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ItemCollectionSizeLimitExceededException_(com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_ToDafny(nativeInput.Message)) + }() + +} + +func LimitExceededException_ToDafny(nativeInput types.LimitExceededException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_LimitExceededException_(com_amazonaws_dynamodb_LimitExceededException_message_ToDafny(nativeInput.Message)) + }() + +} + +func PointInTimeRecoveryUnavailableException_ToDafny(nativeInput types.PointInTimeRecoveryUnavailableException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_PointInTimeRecoveryUnavailableException_(com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_ToDafny(nativeInput.Message)) + }() + +} + +func PolicyNotFoundException_ToDafny(nativeInput types.PolicyNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_PolicyNotFoundException_(com_amazonaws_dynamodb_PolicyNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ProvisionedThroughputExceededException_ToDafny(nativeInput types.ProvisionedThroughputExceededException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ProvisionedThroughputExceededException_(com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ReplicaAlreadyExistsException_ToDafny(nativeInput types.ReplicaAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ReplicaAlreadyExistsException_(com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ReplicaNotFoundException_ToDafny(nativeInput types.ReplicaNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ReplicaNotFoundException_(com_amazonaws_dynamodb_ReplicaNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func RequestLimitExceeded_ToDafny(nativeInput types.RequestLimitExceeded) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_RequestLimitExceeded_(com_amazonaws_dynamodb_RequestLimitExceeded_message_ToDafny(nativeInput.Message)) + }() + +} + +func ResourceInUseException_ToDafny(nativeInput types.ResourceInUseException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ResourceInUseException_(com_amazonaws_dynamodb_ResourceInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ResourceNotFoundException_ToDafny(nativeInput types.ResourceNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_ResourceNotFoundException_(com_amazonaws_dynamodb_ResourceNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func TableAlreadyExistsException_ToDafny(nativeInput types.TableAlreadyExistsException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableAlreadyExistsException_(com_amazonaws_dynamodb_TableAlreadyExistsException_message_ToDafny(nativeInput.Message)) + }() + +} + +func TableInUseException_ToDafny(nativeInput types.TableInUseException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableInUseException_(com_amazonaws_dynamodb_TableInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func TableNotFoundException_ToDafny(nativeInput types.TableNotFoundException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TableNotFoundException_(com_amazonaws_dynamodb_TableNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func TransactionCanceledException_ToDafny(nativeInput types.TransactionCanceledException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TransactionCanceledException_(com_amazonaws_dynamodb_TransactionCanceledException_Message_ToDafny(nativeInput.Message), com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_ToDafny(nativeInput.CancellationReasons)) + }() + +} + +func TransactionConflictException_ToDafny(nativeInput types.TransactionConflictException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TransactionConflictException_(com_amazonaws_dynamodb_TransactionConflictException_message_ToDafny(nativeInput.Message)) + }() + +} + +func TransactionInProgressException_ToDafny(nativeInput types.TransactionInProgressException) ComAmazonawsDynamodbTypes.Error { + return func() ComAmazonawsDynamodbTypes.Error { + + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_TransactionInProgressException_(com_amazonaws_dynamodb_TransactionInProgressException_Message_ToDafny(nativeInput.Message)) + }() + +} + +func OpaqueError_Input_ToDafny(nativeInput error) ComAmazonawsDynamodbTypes.Error { + return ComAmazonawsDynamodbTypes.Companion_Error_.Create_OpaqueWithText_(nativeInput, dafny.SeqOfChars([]dafny.Char(nativeInput.Error())...)) +} + +func Error_ToDafny(err error) ComAmazonawsDynamodbTypes.Error { + // Service Errors + var BackupInUseException *types.BackupInUseException + if errors.As(err, &BackupInUseException) { + return BackupInUseException_ToDafny(*BackupInUseException) + } + + var BackupNotFoundException *types.BackupNotFoundException + if errors.As(err, &BackupNotFoundException) { + return BackupNotFoundException_ToDafny(*BackupNotFoundException) + } + + var ConditionalCheckFailedException *types.ConditionalCheckFailedException + if errors.As(err, &ConditionalCheckFailedException) { + return ConditionalCheckFailedException_ToDafny(*ConditionalCheckFailedException) + } + + var ContinuousBackupsUnavailableException *types.ContinuousBackupsUnavailableException + if errors.As(err, &ContinuousBackupsUnavailableException) { + return ContinuousBackupsUnavailableException_ToDafny(*ContinuousBackupsUnavailableException) + } + + var DuplicateItemException *types.DuplicateItemException + if errors.As(err, &DuplicateItemException) { + return DuplicateItemException_ToDafny(*DuplicateItemException) + } + + var ExportConflictException *types.ExportConflictException + if errors.As(err, &ExportConflictException) { + return ExportConflictException_ToDafny(*ExportConflictException) + } + + var ExportNotFoundException *types.ExportNotFoundException + if errors.As(err, &ExportNotFoundException) { + return ExportNotFoundException_ToDafny(*ExportNotFoundException) + } + + var GlobalTableAlreadyExistsException *types.GlobalTableAlreadyExistsException + if errors.As(err, &GlobalTableAlreadyExistsException) { + return GlobalTableAlreadyExistsException_ToDafny(*GlobalTableAlreadyExistsException) + } + + var GlobalTableNotFoundException *types.GlobalTableNotFoundException + if errors.As(err, &GlobalTableNotFoundException) { + return GlobalTableNotFoundException_ToDafny(*GlobalTableNotFoundException) + } + + var IdempotentParameterMismatchException *types.IdempotentParameterMismatchException + if errors.As(err, &IdempotentParameterMismatchException) { + return IdempotentParameterMismatchException_ToDafny(*IdempotentParameterMismatchException) + } + + var ImportConflictException *types.ImportConflictException + if errors.As(err, &ImportConflictException) { + return ImportConflictException_ToDafny(*ImportConflictException) + } + + var ImportNotFoundException *types.ImportNotFoundException + if errors.As(err, &ImportNotFoundException) { + return ImportNotFoundException_ToDafny(*ImportNotFoundException) + } + + var IndexNotFoundException *types.IndexNotFoundException + if errors.As(err, &IndexNotFoundException) { + return IndexNotFoundException_ToDafny(*IndexNotFoundException) + } + + var InternalServerError *types.InternalServerError + if errors.As(err, &InternalServerError) { + return InternalServerError_ToDafny(*InternalServerError) + } + + var InvalidEndpointException *types.InvalidEndpointException + if errors.As(err, &InvalidEndpointException) { + return InvalidEndpointException_ToDafny(*InvalidEndpointException) + } + + var InvalidExportTimeException *types.InvalidExportTimeException + if errors.As(err, &InvalidExportTimeException) { + return InvalidExportTimeException_ToDafny(*InvalidExportTimeException) + } + + var InvalidRestoreTimeException *types.InvalidRestoreTimeException + if errors.As(err, &InvalidRestoreTimeException) { + return InvalidRestoreTimeException_ToDafny(*InvalidRestoreTimeException) + } + + var ItemCollectionSizeLimitExceededException *types.ItemCollectionSizeLimitExceededException + if errors.As(err, &ItemCollectionSizeLimitExceededException) { + return ItemCollectionSizeLimitExceededException_ToDafny(*ItemCollectionSizeLimitExceededException) + } + + var LimitExceededException *types.LimitExceededException + if errors.As(err, &LimitExceededException) { + return LimitExceededException_ToDafny(*LimitExceededException) + } + + var PointInTimeRecoveryUnavailableException *types.PointInTimeRecoveryUnavailableException + if errors.As(err, &PointInTimeRecoveryUnavailableException) { + return PointInTimeRecoveryUnavailableException_ToDafny(*PointInTimeRecoveryUnavailableException) + } + + var PolicyNotFoundException *types.PolicyNotFoundException + if errors.As(err, &PolicyNotFoundException) { + return PolicyNotFoundException_ToDafny(*PolicyNotFoundException) + } + + var ProvisionedThroughputExceededException *types.ProvisionedThroughputExceededException + if errors.As(err, &ProvisionedThroughputExceededException) { + return ProvisionedThroughputExceededException_ToDafny(*ProvisionedThroughputExceededException) + } + + var ReplicaAlreadyExistsException *types.ReplicaAlreadyExistsException + if errors.As(err, &ReplicaAlreadyExistsException) { + return ReplicaAlreadyExistsException_ToDafny(*ReplicaAlreadyExistsException) + } + + var ReplicaNotFoundException *types.ReplicaNotFoundException + if errors.As(err, &ReplicaNotFoundException) { + return ReplicaNotFoundException_ToDafny(*ReplicaNotFoundException) + } + + var RequestLimitExceeded *types.RequestLimitExceeded + if errors.As(err, &RequestLimitExceeded) { + return RequestLimitExceeded_ToDafny(*RequestLimitExceeded) + } + + var ResourceInUseException *types.ResourceInUseException + if errors.As(err, &ResourceInUseException) { + return ResourceInUseException_ToDafny(*ResourceInUseException) + } + + var ResourceNotFoundException *types.ResourceNotFoundException + if errors.As(err, &ResourceNotFoundException) { + return ResourceNotFoundException_ToDafny(*ResourceNotFoundException) + } + + var TableAlreadyExistsException *types.TableAlreadyExistsException + if errors.As(err, &TableAlreadyExistsException) { + return TableAlreadyExistsException_ToDafny(*TableAlreadyExistsException) + } + + var TableInUseException *types.TableInUseException + if errors.As(err, &TableInUseException) { + return TableInUseException_ToDafny(*TableInUseException) + } + + var TableNotFoundException *types.TableNotFoundException + if errors.As(err, &TableNotFoundException) { + return TableNotFoundException_ToDafny(*TableNotFoundException) + } + + var TransactionCanceledException *types.TransactionCanceledException + if errors.As(err, &TransactionCanceledException) { + return TransactionCanceledException_ToDafny(*TransactionCanceledException) + } + + var TransactionConflictException *types.TransactionConflictException + if errors.As(err, &TransactionConflictException) { + return TransactionConflictException_ToDafny(*TransactionConflictException) + } + + var TransactionInProgressException *types.TransactionInProgressException + if errors.As(err, &TransactionInProgressException) { + return TransactionInProgressException_ToDafny(*TransactionInProgressException) + } + + return OpaqueError_Input_ToDafny(err) +} + +func com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_ToDafny(input []types.BatchStatementRequest) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PartiQLBatchRequest_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_PartiQLBatchRequest_member_ToDafny(input types.BatchStatementRequest) ComAmazonawsDynamodbTypes.BatchStatementRequest { + return func() ComAmazonawsDynamodbTypes.BatchStatementRequest { + + return ComAmazonawsDynamodbTypes.Companion_BatchStatementRequest_.Create_BatchStatementRequest_(com_amazonaws_dynamodb_BatchStatementRequest_Statement_ToDafny(input.Statement), com_amazonaws_dynamodb_BatchStatementRequest_Parameters_ToDafny(input.Parameters), com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_ToDafny(input.ConsistentRead)) + }() +} + +func com_amazonaws_dynamodb_BatchStatementRequest_Statement_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_BatchStatementRequest_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input string) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) + }() +} + +func com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input string) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(input)...)) + }() +} + +func com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_StringSetAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_StringSetAttributeValue_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_NumberSetAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_NumberSetAttributeValue_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input [][]byte) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_BinarySetAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_BinarySetAttributeValue_member_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_MapAttributeValue_key_ToDafny(key), com_amazonaws_dynamodb_MapAttributeValue_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_MapAttributeValue_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_MapAttributeValue_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input []types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ListAttributeValue_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ListAttributeValue_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_ToDafny(input []types.BatchStatementResponse) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PartiQLBatchResponse_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_PartiQLBatchResponse_member_ToDafny(input types.BatchStatementResponse) ComAmazonawsDynamodbTypes.BatchStatementResponse { + return func() ComAmazonawsDynamodbTypes.BatchStatementResponse { + + return ComAmazonawsDynamodbTypes.Companion_BatchStatementResponse_.Create_BatchStatementResponse_(com_amazonaws_dynamodb_BatchStatementResponse_Error_ToDafny(input.Error), com_amazonaws_dynamodb_BatchStatementResponse_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_BatchStatementResponse_Item_ToDafny(input.Item)) + }() +} + +func com_amazonaws_dynamodb_BatchStatementResponse_Error_ToDafny(input *types.BatchStatementError) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BatchStatementError_.Create_BatchStatementError_(com_amazonaws_dynamodb_BatchStatementError_Code_ToDafny(input.Code), com_amazonaws_dynamodb_BatchStatementError_Message_ToDafny(input.Message))) + }() +} + +func com_amazonaws_dynamodb_BatchStatementError_Code_ToDafny(input types.BatchStatementErrorCodeEnum) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BatchStatementErrorCodeEnum_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum)) + }() +} + +func com_amazonaws_dynamodb_BatchStatementError_Message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BatchStatementResponse_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BatchStatementResponse_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_AttributeMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_AttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(input types.ConsumedCapacity) ComAmazonawsDynamodbTypes.ConsumedCapacity { + return func() ComAmazonawsDynamodbTypes.ConsumedCapacity { + + return ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input *float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input *float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input *float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input *types.Capacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Capacity_.Create_Capacity_(com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input.CapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input *float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input *float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input *float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input map[string]types.Capacity) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(key), com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(input types.Capacity) ComAmazonawsDynamodbTypes.Capacity { + return func() ComAmazonawsDynamodbTypes.Capacity { + + return ComAmazonawsDynamodbTypes.Companion_Capacity_.Create_Capacity_(com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_Capacity_CapacityUnits_ToDafny(input.CapacityUnits)) + }() +} + +func com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input map[string]types.Capacity) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_ToDafny(key), com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_ToDafny(input map[string]types.KeysAndAttributes) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(input types.KeysAndAttributes) ComAmazonawsDynamodbTypes.KeysAndAttributes { + return func() ComAmazonawsDynamodbTypes.KeysAndAttributes { + + return ComAmazonawsDynamodbTypes.Companion_KeysAndAttributes_.Create_KeysAndAttributes_(com_amazonaws_dynamodb_KeysAndAttributes_Keys_ToDafny(input.Keys), com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_ToDafny(input.AttributesToGet), com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_ToDafny(input.ConsistentRead), com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_ToDafny(input.ProjectionExpression), com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames)) + }() +} + +func com_amazonaws_dynamodb_KeysAndAttributes_Keys_ToDafny(input []map[string]types.AttributeValue) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_KeyList_member_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_Key_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_Key_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_BatchGetItemOutput_Responses_ToDafny(input map[string][]map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchGetResponseMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetResponseMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_BatchGetResponseMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_BatchGetResponseMap_value_ToDafny(input []map[string]types.AttributeValue) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_ItemList_member_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_ToDafny(input map[string]types.KeysAndAttributes) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchGetRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchGetRequestMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_ToDafny(input map[string][]types.WriteRequest) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(input []types.WriteRequest) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_WriteRequests_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_WriteRequests_member_ToDafny(input types.WriteRequest) ComAmazonawsDynamodbTypes.WriteRequest { + return func() ComAmazonawsDynamodbTypes.WriteRequest { + + return ComAmazonawsDynamodbTypes.Companion_WriteRequest_.Create_WriteRequest_(com_amazonaws_dynamodb_WriteRequest_PutRequest_ToDafny(input.PutRequest), com_amazonaws_dynamodb_WriteRequest_DeleteRequest_ToDafny(input.DeleteRequest)) + }() +} + +func com_amazonaws_dynamodb_WriteRequest_PutRequest_ToDafny(input *types.PutRequest) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_PutRequest_.Create_PutRequest_(com_amazonaws_dynamodb_PutRequest_Item_ToDafny(input.Item))) + }() +} + +func com_amazonaws_dynamodb_PutRequest_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_WriteRequest_DeleteRequest_ToDafny(input *types.DeleteRequest) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteRequest_.Create_DeleteRequest_(com_amazonaws_dynamodb_DeleteRequest_Key_ToDafny(input.Key))) + }() +} + +func com_amazonaws_dynamodb_DeleteRequest_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_ToDafny(input map[string][]types.WriteRequest) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_ToDafny(key), com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_ToDafny(input map[string][]types.ItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(input []types.ItemCollectionMetrics) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_ToDafny(input types.ItemCollectionMetrics) ComAmazonawsDynamodbTypes.ItemCollectionMetrics { + return func() ComAmazonawsDynamodbTypes.ItemCollectionMetrics { + + return ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB)) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input []float64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_ToDafny(input float64) dafny.Sequence { + return func() dafny.Sequence { + + var bits = math.Float64bits(input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_CreateBackupInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateBackupInput_BackupName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_ToDafny(input *types.BackupDetails) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDetails_.Create_BackupDetails_(com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input.BackupSizeBytes), com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime))) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input types.BackupStatus) ComAmazonawsDynamodbTypes.BackupStatus { + return func() ComAmazonawsDynamodbTypes.BackupStatus { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.BackupStatus) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input types.BackupType) ComAmazonawsDynamodbTypes.BackupType { + return func() ComAmazonawsDynamodbTypes.BackupType { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.BackupType) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input *time.Time) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return dafny.SeqOfChars([]dafny.Char(formattedTime)...) + }() +} + +func com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_ToDafny(input []types.Replica) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_ReplicaList_member_ToDafny(input types.Replica) ComAmazonawsDynamodbTypes.Replica { + return func() ComAmazonawsDynamodbTypes.Replica { + + return ComAmazonawsDynamodbTypes.Companion_Replica_.Create_Replica_(com_amazonaws_dynamodb_Replica_RegionName_ToDafny(input.RegionName)) + }() +} + +func com_amazonaws_dynamodb_Replica_RegionName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) + }() +} + +func com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input []types.ReplicaDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(input types.ReplicaDescription) ComAmazonawsDynamodbTypes.ReplicaDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaDescription_.Create_ReplicaDescription_(com_amazonaws_dynamodb_ReplicaDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_ToDafny(input.ReplicaStatus), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_ToDafny(input.ReplicaStatusDescription), com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_ToDafny(input.ReplicaStatusPercentProgress), com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_ToDafny(input.ReplicaInaccessibleDateTime), com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_ToDafny(input.ReplicaTableClassSummary)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_RegionName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndexDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexDescription_.Create_ReplicaGlobalSecondaryIndexDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) + }() +} + +func com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input types.TableClass) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + }() +} + +func com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input types.GlobalTableStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_GlobalTableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.GlobalTableStatus)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(input types.AttributeDefinition) ComAmazonawsDynamodbTypes.AttributeDefinition { + return func() ComAmazonawsDynamodbTypes.AttributeDefinition { + + return ComAmazonawsDynamodbTypes.Companion_AttributeDefinition_.Create_AttributeDefinition_(com_amazonaws_dynamodb_AttributeDefinition_AttributeName_ToDafny(input.AttributeName), com_amazonaws_dynamodb_AttributeDefinition_AttributeType_ToDafny(input.AttributeType)) + }() +} + +func com_amazonaws_dynamodb_AttributeDefinition_AttributeName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_AttributeDefinition_AttributeType_ToDafny(input types.ScalarAttributeType) ComAmazonawsDynamodbTypes.ScalarAttributeType { + return func() ComAmazonawsDynamodbTypes.ScalarAttributeType { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ScalarAttributeType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.ScalarAttributeType) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_KeySchema_member_ToDafny(input types.KeySchemaElement) ComAmazonawsDynamodbTypes.KeySchemaElement { + return func() ComAmazonawsDynamodbTypes.KeySchemaElement { + + return ComAmazonawsDynamodbTypes.Companion_KeySchemaElement_.Create_KeySchemaElement_(com_amazonaws_dynamodb_KeySchemaElement_AttributeName_ToDafny(input.AttributeName), com_amazonaws_dynamodb_KeySchemaElement_KeyType_ToDafny(input.KeyType)) + }() +} + +func com_amazonaws_dynamodb_KeySchemaElement_AttributeName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_KeySchemaElement_KeyType_ToDafny(input types.KeyType) ComAmazonawsDynamodbTypes.KeyType { + return func() ComAmazonawsDynamodbTypes.KeyType { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_KeyType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.KeyType) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(input types.LocalSecondaryIndex) ComAmazonawsDynamodbTypes.LocalSecondaryIndex { + return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndex { + + return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndex_.Create_LocalSecondaryIndex_(com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_ToDafny(input.Projection)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { + return func() ComAmazonawsDynamodbTypes.Projection { + if input == nil { + return ComAmazonawsDynamodbTypes.Projection{} + } + return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) + }() +} + +func com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input types.ProjectionType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ProjectionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ProjectionType)) + }() +} + +func com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_NonKeyAttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_NonKeyAttributeNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(input types.GlobalSecondaryIndex) ComAmazonawsDynamodbTypes.GlobalSecondaryIndex { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndex { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndex_.Create_GlobalSecondaryIndex_(com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { + return func() ComAmazonawsDynamodbTypes.Projection { + if input == nil { + return ComAmazonawsDynamodbTypes.Projection{} + } + return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input *int64) int64 { + return func() int64 { + if input == nil { + return 0 + } + return *input + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input *int64) int64 { + return func() int64 { + if input == nil { + return 0 + } + return *input + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + }() +} + +func com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input *bool) bool { + return func() bool { + if input == nil { + return false + } + return *input + }() +} + +func com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input types.StreamViewType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_StreamViewType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.StreamViewType)) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + }() +} + +func com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input types.SSEType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEType)) + }() +} + +func com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_Tags_ToDafny(input []types.Tag) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TagList_member_ToDafny(input types.Tag) ComAmazonawsDynamodbTypes.Tag { + return func() ComAmazonawsDynamodbTypes.Tag { + + return ComAmazonawsDynamodbTypes.Companion_Tag_.Create_Tag_(com_amazonaws_dynamodb_Tag_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Tag_Value_ToDafny(input.Value)) + }() +} + +func com_amazonaws_dynamodb_Tag_Key_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_Tag_Value_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_TableClass_ToDafny(input types.TableClass) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_CreateTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input types.TableStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableStatus)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughputDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputDescription_.Create_ProvisionedThroughputDescription_(com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input.LastIncreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input.LastDecreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input.NumberOfDecreasesToday), com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input *types.BillingModeSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BillingModeSummary_.Create_BillingModeSummary_(com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input.LastUpdateToPayPerRequestDateTime))) + }() +} + +func com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndexDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_ToDafny(input types.LocalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription { + return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription { + + return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndexDescription_.Create_LocalSecondaryIndexDescription_(com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input.IndexSizeBytes), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_ToDafny(input.IndexArn)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_ToDafny(input *types.Projection) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndexDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_ToDafny(input types.GlobalSecondaryIndexDescription) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexDescription_.Create_GlobalSecondaryIndexDescription_(com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_ToDafny(input.Backfilling), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input.IndexSizeBytes), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_ToDafny(input.IndexArn), com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_ToDafny(input *types.Projection) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughputDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputDescription_.Create_ProvisionedThroughputDescription_(com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_ToDafny(input.LastIncreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_ToDafny(input.LastDecreaseDateTime), com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_ToDafny(input.NumberOfDecreasesToday), com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + }() +} + +func com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input []types.ReplicaDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input *types.RestoreSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_RestoreSummary_.Create_RestoreSummary_(com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_ToDafny(input.SourceBackupArn), com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_ToDafny(input.SourceTableArn), com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_ToDafny(input.RestoreDateTime), com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_ToDafny(input.RestoreInProgress))) + }() +} + +func com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_ToDafny(input *time.Time) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return dafny.SeqOfChars([]dafny.Char(formattedTime)...) + }() +} + +func com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_ToDafny(input *bool) bool { + return func() bool { + if input == nil { + return false + } + return *input + }() +} + +func com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input *types.SSEDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSEDescription_.Create_SSEDescription_(com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input.Status), com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input.KMSMasterKeyArn), com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input.InaccessibleEncryptionDateTime))) + }() +} + +func com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input types.SSEStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEStatus)) + }() +} + +func com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input types.SSEType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.SSEType)) + }() +} + +func com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input *types.ArchivalSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ArchivalSummary_.Create_ArchivalSummary_(com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_ToDafny(input.ArchivalDateTime), com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_ToDafny(input.ArchivalReason), com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_ToDafny(input.ArchivalBackupArn))) + }() +} + +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) + }() +} + +func com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_ToDafny(input *types.BackupDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDescription_.Create_BackupDescription_(com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input.BackupDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input.SourceTableDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input.SourceTableFeatureDetails))) + }() +} + +func com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input *types.BackupDetails) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDetails_.Create_BackupDetails_(com_amazonaws_dynamodb_BackupDetails_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupDetails_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_ToDafny(input.BackupSizeBytes), com_amazonaws_dynamodb_BackupDetails_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupDetails_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime))) + }() +} + +func com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input *types.SourceTableDetails) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SourceTableDetails_.Create_SourceTableDetails_(com_amazonaws_dynamodb_SourceTableDetails_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_SourceTableDetails_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_SourceTableDetails_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_SourceTableDetails_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_ToDafny(input.TableCreationDateTime), com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_SourceTableDetails_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_SourceTableDetails_BillingMode_ToDafny(input.BillingMode))) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_TableId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_ToDafny(input *time.Time) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return dafny.SeqOfChars([]dafny.Char(formattedTime)...) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) ComAmazonawsDynamodbTypes.ProvisionedThroughput { + return func() ComAmazonawsDynamodbTypes.ProvisionedThroughput { + if input == nil { + return ComAmazonawsDynamodbTypes.ProvisionedThroughput{} + } + return ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits)) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_ItemCount_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_SourceTableDetails_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input *types.SourceTableFeatureDetails) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SourceTableFeatureDetails_.Create_SourceTableFeatureDetails_(com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_ToDafny(input.StreamDescription), com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_ToDafny(input.TimeToLiveDescription), com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_ToDafny(input.SSEDescription))) + }() +} + +func com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_ToDafny(input []types.LocalSecondaryIndexInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexes_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexes_member_ToDafny(input types.LocalSecondaryIndexInfo) ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo { + return func() ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo { + + return ComAmazonawsDynamodbTypes.Companion_LocalSecondaryIndexInfo_.Create_LocalSecondaryIndexInfo_(com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_ToDafny(input.Projection)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_ToDafny(input *types.Projection) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) + }() +} + +func com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndexInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_ToDafny(input types.GlobalSecondaryIndexInfo) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexInfo_.Create_GlobalSecondaryIndexInfo_(com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_ToDafny(input.OnDemandThroughput)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_ToDafny(input []types.KeySchemaElement) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_ToDafny(input *types.Projection) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes))) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_ToDafny(input *types.StreamSpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + }() +} + +func com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_ToDafny(input *types.TimeToLiveDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveDescription_.Create_TimeToLiveDescription_(com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input.TimeToLiveStatus), com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input.AttributeName))) + }() +} + +func com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input types.TimeToLiveStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TimeToLiveStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TimeToLiveStatus)) + }() +} + +func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_ToDafny(input *types.SSEDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSEDescription_.Create_SSEDescription_(com_amazonaws_dynamodb_SSEDescription_Status_ToDafny(input.Status), com_amazonaws_dynamodb_SSEDescription_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_ToDafny(input.KMSMasterKeyArn), com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_ToDafny(input.InaccessibleEncryptionDateTime))) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(input types.ExpectedAttributeValue) ComAmazonawsDynamodbTypes.ExpectedAttributeValue { + return func() ComAmazonawsDynamodbTypes.ExpectedAttributeValue { + + return ComAmazonawsDynamodbTypes.Companion_ExpectedAttributeValue_.Create_ExpectedAttributeValue_(com_amazonaws_dynamodb_ExpectedAttributeValue_Value_ToDafny(input.Value), com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_ToDafny(input.Exists), com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_ToDafny(input.ComparisonOperator), com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_ToDafny(input.AttributeValueList)) + }() +} + +func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_ToDafny(input types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map))) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool))) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool))) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_ToDafny(input types.ComparisonOperator) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ComparisonOperator)) + }() +} + +func com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_ToDafny(input []types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(input types.AttributeValue) ComAmazonawsDynamodbTypes.AttributeValue { + return func() ComAmazonawsDynamodbTypes.AttributeValue { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map)) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence)) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool)) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool)) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_DeleteItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) + }() +} + +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DeleteTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_ToDafny(input *types.BackupDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BackupDescription_.Create_BackupDescription_(com_amazonaws_dynamodb_BackupDescription_BackupDetails_ToDafny(input.BackupDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_ToDafny(input.SourceTableDetails), com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_ToDafny(input.SourceTableFeatureDetails))) + }() +} + +func com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(input *types.ContinuousBackupsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ContinuousBackupsDescription_.Create_ContinuousBackupsDescription_(com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input.ContinuousBackupsStatus), com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input.PointInTimeRecoveryDescription))) + }() +} + +func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input types.ContinuousBackupsStatus) ComAmazonawsDynamodbTypes.ContinuousBackupsStatus { + return func() ComAmazonawsDynamodbTypes.ContinuousBackupsStatus { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContinuousBackupsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus) + }() +} + +func com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input *types.PointInTimeRecoveryDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_PointInTimeRecoveryDescription_.Create_PointInTimeRecoveryDescription_(com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_ToDafny(input.PointInTimeRecoveryStatus), com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_ToDafny(input.EarliestRestorableDateTime), com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_ToDafny(input.LatestRestorableDateTime))) + }() +} + +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_ToDafny(input types.PointInTimeRecoveryStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_PointInTimeRecoveryStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus)) + }() +} + +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ContributorInsightsRuleList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ContributorInsightsRuleList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_ToDafny(input *types.FailureException) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_FailureException_.Create_FailureException_(com_amazonaws_dynamodb_FailureException_ExceptionName_ToDafny(input.ExceptionName), com_amazonaws_dynamodb_FailureException_ExceptionDescription_ToDafny(input.ExceptionDescription))) + }() +} + +func com_amazonaws_dynamodb_FailureException_ExceptionName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_FailureException_ExceptionDescription_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeEndpointsResponse_Endpoints_ToDafny(input []types.Endpoint) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_Endpoints_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_Endpoints_member_ToDafny(input types.Endpoint) ComAmazonawsDynamodbTypes.Endpoint { + return func() ComAmazonawsDynamodbTypes.Endpoint { + + return ComAmazonawsDynamodbTypes.Companion_Endpoint_.Create_Endpoint_(com_amazonaws_dynamodb_Endpoint_Address_ToDafny(input.Address), com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_ToDafny(input.CachePeriodInMinutes)) + }() +} + +func com_amazonaws_dynamodb_Endpoint_Address_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_ToDafny(input int64) int64 { + return func() int64 { + + return input + }() +} + +func com_amazonaws_dynamodb_DescribeExportInput_ExportArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_ToDafny(input *types.ExportDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ExportDescription_.Create_ExportDescription_(com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input.ExportManifest), com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input.ExportTime), com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input.S3Prefix), com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input.S3SseAlgorithm), com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input.S3SseKmsKeyId), com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input.FailureMessage), com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input.ExportFormat), com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input.BilledSizeBytes), com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input.ExportType), com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input.IncrementalExportSpecification))) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input types.ExportStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportStatus)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input types.S3SseAlgorithm) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input types.ExportFormat) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportFormat)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input types.ExportType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) + }() +} + +func com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input *types.IncrementalExportSpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_IncrementalExportSpecification_.Create_IncrementalExportSpecification_(com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input.ExportFromTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input.ExportToTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input.ExportViewType))) + }() +} + +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input types.ExportViewType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportViewType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportViewType)) + }() +} + +func com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) + }() +} + +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_ToDafny(input []types.ReplicaSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(input types.ReplicaSettingsDescription) ComAmazonawsDynamodbTypes.ReplicaSettingsDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaSettingsDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaSettingsDescription_.Create_ReplicaSettingsDescription_(com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_ToDafny(input.ReplicaStatus), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_ToDafny(input.ReplicaBillingModeSummary), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_ToDafny(input.ReplicaProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_ToDafny(input.ReplicaProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedWriteCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_ToDafny(input.ReplicaGlobalSecondaryIndexSettings), com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_ToDafny(input.ReplicaTableClassSummary)) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_ToDafny(input *types.BillingModeSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_BillingModeSummary_.Create_BillingModeSummary_(com_amazonaws_dynamodb_BillingModeSummary_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_ToDafny(input.LastUpdateToPayPerRequestDateTime))) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input []types.AutoScalingPolicyDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_ToDafny(input types.AutoScalingPolicyDescription) ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription { + return func() ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription { + + return ComAmazonawsDynamodbTypes.Companion_AutoScalingPolicyDescription_.Create_AutoScalingPolicyDescription_(com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_ToDafny(input.PolicyName), com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_ToDafny(input.TargetTrackingScalingPolicyConfiguration)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_ToDafny(input *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_.Create_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_(com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_ToDafny(input.DisableScaleIn), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_ToDafny(input.ScaleInCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_ToDafny(input.ScaleOutCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_ToDafny(input.TargetValue))) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_ToDafny(input *float64) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_ToDafny(input []types.ReplicaGlobalSecondaryIndexSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexSettingsDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexSettingsDescription_.Create_ReplicaGlobalSecondaryIndexSettingsDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_ToDafny(input.ProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_ToDafny(input.ProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettings)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_ToDafny(input *types.TableClassSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableClassSummary_.Create_TableClassSummary_(com_amazonaws_dynamodb_TableClassSummary_TableClass_ToDafny(input.TableClass), com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_ToDafny(input.LastUpdateDateTime))) + }() +} + +func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_ToDafny(input *types.ImportTableDescription) ComAmazonawsDynamodbTypes.ImportTableDescription { + return func() ComAmazonawsDynamodbTypes.ImportTableDescription { + if input == nil { + return ComAmazonawsDynamodbTypes.ImportTableDescription{} + } + return ComAmazonawsDynamodbTypes.Companion_ImportTableDescription_.Create_ImportTableDescription_(com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input.ErrorCount), com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input.InputFormatOptions), com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input.InputCompressionType), com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input.TableCreationParameters), com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input.ProcessedSizeBytes), com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input.ProcessedItemCount), com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input.ImportedItemCount), com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input.FailureMessage)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input types.ImportStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ImportStatus)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input *types.S3BucketSource) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix))) + }() +} + +func com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input int64) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input types.InputFormat) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputFormat)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input *types.InputFormatOptions) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_InputFormatOptions_.Create_InputFormatOptions_(com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input.Csv))) + }() +} + +func com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input *types.CsvOptions) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CsvOptions_.Create_CsvOptions_(com_amazonaws_dynamodb_CsvOptions_Delimiter_ToDafny(input.Delimiter), com_amazonaws_dynamodb_CsvOptions_HeaderList_ToDafny(input.HeaderList))) + }() +} + +func com_amazonaws_dynamodb_CsvOptions_Delimiter_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_CsvOptions_HeaderList_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_CsvHeaderList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_CsvHeaderList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input types.InputCompressionType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputCompressionType)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input *types.TableCreationParameters) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableCreationParameters_.Create_TableCreationParameters_(com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input.SSESpecification), com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + }() +} + +func com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input int64) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input int64) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_ToDafny(input []types.KinesisDataStreamDestination) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_ToDafny(input types.KinesisDataStreamDestination) ComAmazonawsDynamodbTypes.KinesisDataStreamDestination { + return func() ComAmazonawsDynamodbTypes.KinesisDataStreamDestination { + + return ComAmazonawsDynamodbTypes.Companion_KinesisDataStreamDestination_.Create_KinesisDataStreamDestination_(com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_ToDafny(input.StreamArn), com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_ToDafny(input.DestinationStatus), com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_ToDafny(input.DestinationStatusDescription), com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision)) + }() +} + +func com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) + }() +} + +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) + }() +} + +func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_DescribeTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeTableOutput_Table_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(input *types.TableAutoScalingDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableAutoScalingDescription_.Create_TableAutoScalingDescription_(com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input.Replicas))) + }() +} + +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input types.TableStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableStatus)) + }() +} + +func com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input []types.ReplicaAutoScalingDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_ToDafny(input types.ReplicaAutoScalingDescription) ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaAutoScalingDescription_.Create_ReplicaAutoScalingDescription_(com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ReplicaProvisionedWriteCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_ToDafny(input.ReplicaStatus)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndexAutoScalingDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexAutoScalingDescription) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexAutoScalingDescription_.Create_ReplicaGlobalSecondaryIndexAutoScalingDescription_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_ToDafny(input.IndexStatus), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input.ProvisionedReadCapacityAutoScalingSettings), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettings)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_ToDafny(input types.IndexStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.IndexStatus)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_ToDafny(input *types.AutoScalingSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsDescription_.Create_AutoScalingSettingsDescription_(com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_ToDafny(input.ScalingPolicies))) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_ToDafny(input types.ReplicaStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReplicaStatus)) + }() +} + +func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_ToDafny(input *types.TimeToLiveDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveDescription_.Create_TimeToLiveDescription_(com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_ToDafny(input.TimeToLiveStatus), com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_ToDafny(input.AttributeName))) + }() +} + +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) + }() +} + +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) + }() +} + +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) + }() +} + +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_ToDafny(input *types.EnableKinesisStreamingConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_EnableKinesisStreamingConfiguration_.Create_EnableKinesisStreamingConfiguration_(com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementInput_Statement_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_ToDafny(input []types.ParameterizedStatement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ParameterizedStatements_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_ParameterizedStatements_member_ToDafny(input types.ParameterizedStatement) ComAmazonawsDynamodbTypes.ParameterizedStatement { + return func() ComAmazonawsDynamodbTypes.ParameterizedStatement { + + return ComAmazonawsDynamodbTypes.Companion_ParameterizedStatement_.Create_ParameterizedStatement_(com_amazonaws_dynamodb_ParameterizedStatement_Statement_ToDafny(input.Statement), com_amazonaws_dynamodb_ParameterizedStatement_Parameters_ToDafny(input.Parameters)) + }() +} + +func com_amazonaws_dynamodb_ParameterizedStatement_Statement_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ParameterizedStatement_Parameters_ToDafny(input []types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_PreparedStatementParameters_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_ToDafny(input []types.ItemResponse) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(input types.ItemResponse) ComAmazonawsDynamodbTypes.ItemResponse { + return func() ComAmazonawsDynamodbTypes.ItemResponse { + + return ComAmazonawsDynamodbTypes.Companion_ItemResponse_.Create_ItemResponse_(com_amazonaws_dynamodb_ItemResponse_Item_ToDafny(input.Item)) + }() +} + +func com_amazonaws_dynamodb_ItemResponse_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_ToDafny(input types.S3SseAlgorithm) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_ToDafny(input types.ExportFormat) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportFormat)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_ToDafny(input types.ExportType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_ToDafny(input *types.IncrementalExportSpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_IncrementalExportSpecification_.Create_IncrementalExportSpecification_(com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_ToDafny(input.ExportFromTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_ToDafny(input.ExportToTime), com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_ToDafny(input.ExportViewType))) + }() +} + +func com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_ToDafny(input *types.ExportDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ExportDescription_.Create_ExportDescription_(com_amazonaws_dynamodb_ExportDescription_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportDescription_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ExportDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ExportDescription_ExportManifest_ToDafny(input.ExportManifest), com_amazonaws_dynamodb_ExportDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ExportDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ExportDescription_ExportTime_ToDafny(input.ExportTime), com_amazonaws_dynamodb_ExportDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ExportDescription_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_ExportDescription_S3Prefix_ToDafny(input.S3Prefix), com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_ToDafny(input.S3SseAlgorithm), com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_ToDafny(input.S3SseKmsKeyId), com_amazonaws_dynamodb_ExportDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ExportDescription_FailureMessage_ToDafny(input.FailureMessage), com_amazonaws_dynamodb_ExportDescription_ExportFormat_ToDafny(input.ExportFormat), com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_ToDafny(input.BilledSizeBytes), com_amazonaws_dynamodb_ExportDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_ExportDescription_ExportType_ToDafny(input.ExportType), com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_ToDafny(input.IncrementalExportSpecification))) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_GetItemInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_GetItemOutput_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableInput_ClientToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_ToDafny(input *types.S3BucketSource) ComAmazonawsDynamodbTypes.S3BucketSource { + return func() ComAmazonawsDynamodbTypes.S3BucketSource { + if input == nil { + return ComAmazonawsDynamodbTypes.S3BucketSource{} + } + return ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix)) + }() +} + +func com_amazonaws_dynamodb_ImportTableInput_InputFormat_ToDafny(input types.InputFormat) ComAmazonawsDynamodbTypes.InputFormat { + return func() ComAmazonawsDynamodbTypes.InputFormat { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.InputFormat) + }() +} + +func com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_ToDafny(input *types.InputFormatOptions) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_InputFormatOptions_.Create_InputFormatOptions_(com_amazonaws_dynamodb_InputFormatOptions_Csv_ToDafny(input.Csv))) + }() +} + +func com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_ToDafny(input types.InputCompressionType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputCompressionType)) + }() +} + +func com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_ToDafny(input *types.TableCreationParameters) ComAmazonawsDynamodbTypes.TableCreationParameters { + return func() ComAmazonawsDynamodbTypes.TableCreationParameters { + if input == nil { + return ComAmazonawsDynamodbTypes.TableCreationParameters{} + } + return ComAmazonawsDynamodbTypes.Companion_TableCreationParameters_.Create_TableCreationParameters_(com_amazonaws_dynamodb_TableCreationParameters_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableCreationParameters_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableCreationParameters_BillingMode_ToDafny(input.BillingMode), com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_ToDafny(input.OnDemandThroughput), com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_ToDafny(input.SSESpecification), com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes)) + }() +} + +func com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_ToDafny(input *types.ImportTableDescription) ComAmazonawsDynamodbTypes.ImportTableDescription { + return func() ComAmazonawsDynamodbTypes.ImportTableDescription { + if input == nil { + return ComAmazonawsDynamodbTypes.ImportTableDescription{} + } + return ComAmazonawsDynamodbTypes.Companion_ImportTableDescription_.Create_ImportTableDescription_(com_amazonaws_dynamodb_ImportTableDescription_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportTableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportTableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_ImportTableDescription_ClientToken_ToDafny(input.ClientToken), com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_ToDafny(input.ErrorCount), com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportTableDescription_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_ToDafny(input.InputFormatOptions), com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_ToDafny(input.InputCompressionType), com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_ToDafny(input.TableCreationParameters), com_amazonaws_dynamodb_ImportTableDescription_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportTableDescription_EndTime_ToDafny(input.EndTime), com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_ToDafny(input.ProcessedSizeBytes), com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_ToDafny(input.ProcessedItemCount), com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_ToDafny(input.ImportedItemCount), com_amazonaws_dynamodb_ImportTableDescription_FailureCode_ToDafny(input.FailureCode), com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_ToDafny(input.FailureMessage)) + }() +} + +func com_amazonaws_dynamodb_ListBackupsInput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListBackupsInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListBackupsInput_BackupType_ToDafny(input types.BackupTypeFilter) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupTypeFilter_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupTypeFilter)) + }() +} + +func com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_ToDafny(input []types.BackupSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_BackupSummaries_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummaries_member_ToDafny(input types.BackupSummary) ComAmazonawsDynamodbTypes.BackupSummary { + return func() ComAmazonawsDynamodbTypes.BackupSummary { + + return ComAmazonawsDynamodbTypes.Companion_BackupSummary_.Create_BackupSummary_(com_amazonaws_dynamodb_BackupSummary_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_BackupSummary_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_BackupSummary_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_BackupSummary_BackupArn_ToDafny(input.BackupArn), com_amazonaws_dynamodb_BackupSummary_BackupName_ToDafny(input.BackupName), com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_ToDafny(input.BackupCreationDateTime), com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_ToDafny(input.BackupExpiryDateTime), com_amazonaws_dynamodb_BackupSummary_BackupStatus_ToDafny(input.BackupStatus), com_amazonaws_dynamodb_BackupSummary_BackupType_ToDafny(input.BackupType), com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_ToDafny(input.BackupSizeBytes)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_TableId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_BackupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_BackupName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_BackupStatus_ToDafny(input types.BackupStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupStatus)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_BackupType_ToDafny(input types.BackupType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BackupType)) + }() +} + +func com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_ToDafny(input []types.ContributorInsightsSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ContributorInsightsSummaries_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ContributorInsightsSummaries_member_ToDafny(input types.ContributorInsightsSummary) ComAmazonawsDynamodbTypes.ContributorInsightsSummary { + return func() ComAmazonawsDynamodbTypes.ContributorInsightsSummary { + + return ComAmazonawsDynamodbTypes.Companion_ContributorInsightsSummary_.Create_ContributorInsightsSummary_(com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_ToDafny(input.ContributorInsightsStatus)) + }() +} + +func com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) + }() +} + +func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListExportsInput_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListExportsInput_MaxResults_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ListExportsInput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_ToDafny(input []types.ExportSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ExportSummaries_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ExportSummaries_member_ToDafny(input types.ExportSummary) ComAmazonawsDynamodbTypes.ExportSummary { + return func() ComAmazonawsDynamodbTypes.ExportSummary { + + return ComAmazonawsDynamodbTypes.Companion_ExportSummary_.Create_ExportSummary_(com_amazonaws_dynamodb_ExportSummary_ExportArn_ToDafny(input.ExportArn), com_amazonaws_dynamodb_ExportSummary_ExportStatus_ToDafny(input.ExportStatus), com_amazonaws_dynamodb_ExportSummary_ExportType_ToDafny(input.ExportType)) + }() +} + +func com_amazonaws_dynamodb_ExportSummary_ExportArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportSummary_ExportStatus_ToDafny(input types.ExportStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportStatus)) + }() +} + +func com_amazonaws_dynamodb_ExportSummary_ExportType_ToDafny(input types.ExportType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ExportType)) + }() +} + +func com_amazonaws_dynamodb_ListExportsOutput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_ToDafny(input []types.GlobalTable) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalTableList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableList_member_ToDafny(input types.GlobalTable) ComAmazonawsDynamodbTypes.GlobalTable { + return func() ComAmazonawsDynamodbTypes.GlobalTable { + + return ComAmazonawsDynamodbTypes.Companion_GlobalTable_.Create_GlobalTable_(com_amazonaws_dynamodb_GlobalTable_GlobalTableName_ToDafny(input.GlobalTableName), com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_ToDafny(input.ReplicationGroup)) + }() +} + +func com_amazonaws_dynamodb_GlobalTable_GlobalTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_ToDafny(input []types.Replica) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListImportsInput_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListImportsInput_PageSize_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ListImportsInput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_ToDafny(input []types.ImportSummary) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ImportSummaryList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ImportSummaryList_member_ToDafny(input types.ImportSummary) ComAmazonawsDynamodbTypes.ImportSummary { + return func() ComAmazonawsDynamodbTypes.ImportSummary { + + return ComAmazonawsDynamodbTypes.Companion_ImportSummary_.Create_ImportSummary_(com_amazonaws_dynamodb_ImportSummary_ImportArn_ToDafny(input.ImportArn), com_amazonaws_dynamodb_ImportSummary_ImportStatus_ToDafny(input.ImportStatus), com_amazonaws_dynamodb_ImportSummary_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_ImportSummary_S3BucketSource_ToDafny(input.S3BucketSource), com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_ToDafny(input.CloudWatchLogGroupArn), com_amazonaws_dynamodb_ImportSummary_InputFormat_ToDafny(input.InputFormat), com_amazonaws_dynamodb_ImportSummary_StartTime_ToDafny(input.StartTime), com_amazonaws_dynamodb_ImportSummary_EndTime_ToDafny(input.EndTime)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_ImportArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_ImportStatus_ToDafny(input types.ImportStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ImportStatus)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_TableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_S3BucketSource_ToDafny(input *types.S3BucketSource) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_S3BucketSource_.Create_S3BucketSource_(com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_ToDafny(input.S3BucketOwner), com_amazonaws_dynamodb_S3BucketSource_S3Bucket_ToDafny(input.S3Bucket), com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_ToDafny(input.S3KeyPrefix))) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_InputFormat_ToDafny(input types.InputFormat) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.InputFormat)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_StartTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ImportSummary_EndTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_ListImportsOutput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListTablesInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ListTablesOutput_TableNames_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TableNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TableNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_ToDafny(input []types.Tag) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_PutItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_PutItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_QueryInput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_Select_ToDafny(input types.Select) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.Select)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_QueryInput_KeyConditions_ToDafny(input map[string]types.Condition) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_KeyConditions_key_ToDafny(key), com_amazonaws_dynamodb_KeyConditions_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_KeyConditions_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_KeyConditions_value_ToDafny(input types.Condition) ComAmazonawsDynamodbTypes.Condition { + return func() ComAmazonawsDynamodbTypes.Condition { + + return ComAmazonawsDynamodbTypes.Companion_Condition_.Create_Condition_(com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input.AttributeValueList), com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input.ComparisonOperator)) + }() +} + +func com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input []types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeValueList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input types.ComparisonOperator) ComAmazonawsDynamodbTypes.ComparisonOperator { + return func() ComAmazonawsDynamodbTypes.ComparisonOperator { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.ComparisonOperator) + }() +} + +func com_amazonaws_dynamodb_QueryInput_QueryFilter_ToDafny(input map[string]types.Condition) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_FilterConditionMap_key_ToDafny(key), com_amazonaws_dynamodb_FilterConditionMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_FilterConditionMap_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_FilterConditionMap_value_ToDafny(input types.Condition) ComAmazonawsDynamodbTypes.Condition { + return func() ComAmazonawsDynamodbTypes.Condition { + + return ComAmazonawsDynamodbTypes.Companion_Condition_.Create_Condition_(com_amazonaws_dynamodb_Condition_AttributeValueList_ToDafny(input.AttributeValueList), com_amazonaws_dynamodb_Condition_ComparisonOperator_ToDafny(input.ComparisonOperator)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ScanIndexForward_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_FilterExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_QueryOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_QueryOutput_Count_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_QueryOutput_ScannedCount_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_ToDafny(input *types.SSESpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_ToDafny(input []types.GlobalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_ToDafny(input []types.LocalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_LocalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_ToDafny(input *types.SSESpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + }() +} + +func com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_ScanInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ScanInput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_AttributesToGet_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ScanInput_Select_ToDafny(input types.Select) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.Select)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ScanFilter_ToDafny(input map[string]types.Condition) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_FilterConditionMap_key_ToDafny(key), com_amazonaws_dynamodb_FilterConditionMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_TotalSegments_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ScanInput_Segment_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ProjectionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_FilterExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ScanInput_ConsistentRead_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ScanOutput_Items_ToDafny(input []map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ScanOutput_Count_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_ScanOutput_ScannedCount_ToDafny(input int32) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_TagResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_TagResourceInput_Tags_ToDafny(input []types.Tag) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_ToDafny(input []types.TransactGetItem) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TransactGetItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TransactGetItemList_member_ToDafny(input types.TransactGetItem) ComAmazonawsDynamodbTypes.TransactGetItem { + return func() ComAmazonawsDynamodbTypes.TransactGetItem { + + return ComAmazonawsDynamodbTypes.Companion_TransactGetItem_.Create_TransactGetItem_(com_amazonaws_dynamodb_TransactGetItem_Get_ToDafny(input.Get)) + }() +} + +func com_amazonaws_dynamodb_TransactGetItem_Get_ToDafny(input *types.Get) ComAmazonawsDynamodbTypes.Get { + return func() ComAmazonawsDynamodbTypes.Get { + if input == nil { + return ComAmazonawsDynamodbTypes.Get{} + } + return ComAmazonawsDynamodbTypes.Companion_Get_.Create_Get_(com_amazonaws_dynamodb_Get_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Get_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Get_ProjectionExpression_ToDafny(input.ProjectionExpression), com_amazonaws_dynamodb_Get_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames)) + }() +} + +func com_amazonaws_dynamodb_Get_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_Get_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_Get_ProjectionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_Get_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_ToDafny(input []types.ItemResponse) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ItemResponseList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_ToDafny(input []types.TransactWriteItem) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TransactWriteItemList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItemList_member_ToDafny(input types.TransactWriteItem) ComAmazonawsDynamodbTypes.TransactWriteItem { + return func() ComAmazonawsDynamodbTypes.TransactWriteItem { + + return ComAmazonawsDynamodbTypes.Companion_TransactWriteItem_.Create_TransactWriteItem_(com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_ToDafny(input.ConditionCheck), com_amazonaws_dynamodb_TransactWriteItem_Put_ToDafny(input.Put), com_amazonaws_dynamodb_TransactWriteItem_Delete_ToDafny(input.Delete), com_amazonaws_dynamodb_TransactWriteItem_Update_ToDafny(input.Update)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_ToDafny(input *types.ConditionCheck) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConditionCheck_.Create_ConditionCheck_(com_amazonaws_dynamodb_ConditionCheck_Key_ToDafny(input.Key), com_amazonaws_dynamodb_ConditionCheck_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + }() +} + +func com_amazonaws_dynamodb_ConditionCheck_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_ConditionCheck_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItem_Put_ToDafny(input *types.Put) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Put_.Create_Put_(com_amazonaws_dynamodb_Put_Item_ToDafny(input.Item), com_amazonaws_dynamodb_Put_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Put_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Put_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Put_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + }() +} + +func com_amazonaws_dynamodb_Put_Item_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_PutItemInputAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_PutItemInputAttributeMap_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_Put_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_Put_ConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_Put_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_Put_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItem_Delete_ToDafny(input *types.Delete) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Delete_.Create_Delete_(com_amazonaws_dynamodb_Delete_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Delete_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Delete_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + }() +} + +func com_amazonaws_dynamodb_Delete_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_Delete_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_Delete_ConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItem_Update_ToDafny(input *types.Update) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_Update_.Create_Update_(com_amazonaws_dynamodb_Update_Key_ToDafny(input.Key), com_amazonaws_dynamodb_Update_UpdateExpression_ToDafny(input.UpdateExpression), com_amazonaws_dynamodb_Update_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_Update_ConditionExpression_ToDafny(input.ConditionExpression), com_amazonaws_dynamodb_Update_ExpressionAttributeNames_ToDafny(input.ExpressionAttributeNames), com_amazonaws_dynamodb_Update_ExpressionAttributeValues_ToDafny(input.ExpressionAttributeValues), com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_ToDafny(input.ReturnValuesOnConditionCheckFailure))) + }() +} + +func com_amazonaws_dynamodb_Update_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_Update_UpdateExpression_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_Update_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_Update_ConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_Update_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_Update_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_ToDafny(input types.ReturnValuesOnConditionCheckFailure) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_ToDafny(input []types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_ToDafny(input map[string][]types.ItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_ToDafny(key), com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UntagResourceInput_TagKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_TagKeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_TagKeyList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_ToDafny(input *types.PointInTimeRecoverySpecification) ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification { + return func() ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification { + if input == nil { + return ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification{} + } + return ComAmazonawsDynamodbTypes.Companion_PointInTimeRecoverySpecification_.Create_PointInTimeRecoverySpecification_(com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_ToDafny(input.PointInTimeRecoveryEnabled)) + }() +} + +func com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_ToDafny(input *bool) bool { + return func() bool { + if input == nil { + return false + } + return *input + }() +} + +func com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_ToDafny(input *types.ContinuousBackupsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ContinuousBackupsDescription_.Create_ContinuousBackupsDescription_(com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_ToDafny(input.ContinuousBackupsStatus), com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_ToDafny(input.PointInTimeRecoveryDescription))) + }() +} + +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_ToDafny(input types.ContributorInsightsAction) ComAmazonawsDynamodbTypes.ContributorInsightsAction { + return func() ComAmazonawsDynamodbTypes.ContributorInsightsAction { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsAction_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsDynamodbTypes.ContributorInsightsAction) + }() +} + +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_ToDafny(input types.ContributorInsightsStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus)) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_ToDafny(input []types.ReplicaUpdate) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_ReplicaUpdateList_member_ToDafny(input types.ReplicaUpdate) ComAmazonawsDynamodbTypes.ReplicaUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaUpdate_.Create_ReplicaUpdate_(com_amazonaws_dynamodb_ReplicaUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_ReplicaUpdate_Delete_ToDafny(input.Delete)) + }() +} + +func com_amazonaws_dynamodb_ReplicaUpdate_Create_ToDafny(input *types.CreateReplicaAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateReplicaAction_.Create_CreateReplicaAction_(com_amazonaws_dynamodb_CreateReplicaAction_RegionName_ToDafny(input.RegionName))) + }() +} + +func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaUpdate_Delete_ToDafny(input *types.DeleteReplicaAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteReplicaAction_.Create_DeleteReplicaAction_(com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_ToDafny(input.RegionName))) + }() +} + +func com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_ToDafny(input *types.GlobalTableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_GlobalTableDescription_.Create_GlobalTableDescription_(com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_ToDafny(input.ReplicationGroup), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_ToDafny(input.GlobalTableArn), com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_ToDafny(input.GlobalTableStatus), com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_ToDafny(input.GlobalTableName))) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input *types.AutoScalingPolicyUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingPolicyUpdate_.Create_AutoScalingPolicyUpdate_(com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_ToDafny(input.PolicyName), com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_ToDafny(input.TargetTrackingScalingPolicyConfiguration))) + }() +} + +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_ToDafny(input *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + return func() ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + if input == nil { + return ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{} + } + return ComAmazonawsDynamodbTypes.Companion_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_.Create_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_(com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_ToDafny(input.DisableScaleIn), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_ToDafny(input.ScaleInCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_ToDafny(input.ScaleOutCooldown), com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_ToDafny(input.TargetValue)) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_ToDafny(input *float64) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return dafny.SeqOf() + } + var bits = math.Float64bits(*input) + var bytes = make([]byte, 8) + binary.LittleEndian.PutUint64(bytes, bits) + var v []interface{} + for _, e := range bytes { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_ToDafny(input []types.GlobalTableGlobalSecondaryIndexSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(input types.GlobalTableGlobalSecondaryIndexSettingsUpdate) ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate { + return func() ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate { + + return ComAmazonawsDynamodbTypes.Companion_GlobalTableGlobalSecondaryIndexSettingsUpdate_.Create_GlobalTableGlobalSecondaryIndexSettingsUpdate_(com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_ToDafny(input.ProvisionedWriteCapacityUnits), com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input.ProvisionedWriteCapacityAutoScalingSettingsUpdate)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_ToDafny(input []types.ReplicaSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_ToDafny(input types.ReplicaSettingsUpdate) ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaSettingsUpdate_.Create_ReplicaSettingsUpdate_(com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_ToDafny(input.ReplicaProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_ToDafny(input.ReplicaGlobalSecondaryIndexSettingsUpdate), com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_ToDafny(input.ReplicaTableClass)) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_ToDafny(input []types.ReplicaGlobalSecondaryIndexSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexSettingsUpdate) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexSettingsUpdate_.Create_ReplicaGlobalSecondaryIndexSettingsUpdate_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_ToDafny(input.ProvisionedReadCapacityUnits), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input.ProvisionedReadCapacityAutoScalingSettingsUpdate)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_ToDafny(input *int64) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_ToDafny(input types.TableClass) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_ToDafny(input []types.ReplicaSettingsDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_Key_ToDafny(input map[string]types.AttributeValue) dafny.Map { + return func() dafny.Map { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_Key_key_ToDafny(key), com_amazonaws_dynamodb_Key_value_ToDafny(val)) + } + return fieldValue.ToMap() + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_ToDafny(input map[string]types.AttributeValueUpdate) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeUpdates_key_ToDafny(key), com_amazonaws_dynamodb_AttributeUpdates_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_AttributeUpdates_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_dynamodb_AttributeUpdates_value_ToDafny(input types.AttributeValueUpdate) ComAmazonawsDynamodbTypes.AttributeValueUpdate { + return func() ComAmazonawsDynamodbTypes.AttributeValueUpdate { + + return ComAmazonawsDynamodbTypes.Companion_AttributeValueUpdate_.Create_AttributeValueUpdate_(com_amazonaws_dynamodb_AttributeValueUpdate_Value_ToDafny(input.Value), com_amazonaws_dynamodb_AttributeValueUpdate_Action_ToDafny(input.Action)) + }() +} + +func com_amazonaws_dynamodb_AttributeValueUpdate_Value_ToDafny(input types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + switch input.(type) { + case *types.AttributeValueMemberS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_S_ToDafny(input.(*types.AttributeValueMemberS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_S_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberN: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_N_ToDafny(input.(*types.AttributeValueMemberN).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_N_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberB: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_B_ToDafny(input.(*types.AttributeValueMemberB).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_B_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberSS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_SS_ToDafny(input.(*types.AttributeValueMemberSS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_SS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberNS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NS_ToDafny(input.(*types.AttributeValueMemberNS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberBS: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BS_ToDafny(input.(*types.AttributeValueMemberBS).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BS_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberM: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_M_ToDafny(input.(*types.AttributeValueMemberM).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_M_(inputToConversion.UnwrapOr(nil).(dafny.Map))) + case *types.AttributeValueMemberL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_L_ToDafny(input.(*types.AttributeValueMemberL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_L_(inputToConversion.UnwrapOr(nil).(dafny.Sequence))) + case *types.AttributeValueMemberNULL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_NULL_ToDafny(input.(*types.AttributeValueMemberNULL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_NULL_(inputToConversion.UnwrapOr(nil).(bool))) + case *types.AttributeValueMemberBOOL: + var inputToConversion = com_amazonaws_dynamodb_AttributeValue_BOOL_ToDafny(input.(*types.AttributeValueMemberBOOL).Value) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeValue_{}.Create_BOOL_(inputToConversion.UnwrapOr(nil).(bool))) + + default: + panic("Unhandled union type") + } + }() +} + +func com_amazonaws_dynamodb_AttributeValueUpdate_Action_ToDafny(input types.AttributeAction) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeAction_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.AttributeAction)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_Expected_ToDafny(input map[string]types.ExpectedAttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpectedAttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpectedAttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_ToDafny(input types.ConditionalOperator) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ConditionalOperator)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_ToDafny(input types.ReturnValue) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnValue)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_ToDafny(input types.ReturnConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_ToDafny(input types.ReturnItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_ToDafny(key), com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_UpdateItemOutput_Attributes_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_ToDafny(input *types.ConsumedCapacity) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ConsumedCapacity_.Create_ConsumedCapacity_(com_amazonaws_dynamodb_ConsumedCapacity_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_ToDafny(input.CapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits), com_amazonaws_dynamodb_ConsumedCapacity_Table_ToDafny(input.Table), com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes))) + }() +} + +func com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_ToDafny(input *types.ItemCollectionMetrics) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ItemCollectionMetrics_.Create_ItemCollectionMetrics_(com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_ToDafny(input.ItemCollectionKey), com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_ToDafny(input.SizeEstimateRangeGB))) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_ToDafny(input *types.UpdateKinesisStreamingConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingConfiguration_.Create_UpdateKinesisStreamingConfiguration_(com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input types.ApproximateCreationDateTimePrecision) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision)) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_ToDafny(input types.DestinationStatus) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.DestinationStatus)) + }() +} + +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_ToDafny(input *types.UpdateKinesisStreamingConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateKinesisStreamingConfiguration_.Create_UpdateKinesisStreamingConfiguration_(com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_ToDafny(input.ApproximateCreationDateTimePrecision))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_ToDafny(input []types.AttributeDefinition) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_AttributeDefinitions_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_BillingMode_ToDafny(input types.BillingMode) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.BillingMode)) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_ToDafny(input []types.GlobalSecondaryIndexUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_ToDafny(input types.GlobalSecondaryIndexUpdate) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexUpdate_.Create_GlobalSecondaryIndexUpdate_(com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_ToDafny(input.Update), com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_ToDafny(input.Delete)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_ToDafny(input *types.UpdateGlobalSecondaryIndexAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateGlobalSecondaryIndexAction_.Create_UpdateGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_ToDafny(input *types.CreateGlobalSecondaryIndexAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateGlobalSecondaryIndexAction_.Create_CreateGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_ToDafny(input.Projection), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_ToDafny(input []types.KeySchemaElement) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_KeySchema_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_ToDafny(input *types.Projection) ComAmazonawsDynamodbTypes.Projection { + return func() ComAmazonawsDynamodbTypes.Projection { + if input == nil { + return ComAmazonawsDynamodbTypes.Projection{} + } + return ComAmazonawsDynamodbTypes.Companion_Projection_.Create_Projection_(com_amazonaws_dynamodb_Projection_ProjectionType_ToDafny(input.ProjectionType), com_amazonaws_dynamodb_Projection_NonKeyAttributes_ToDafny(input.NonKeyAttributes)) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_ToDafny(input *types.ProvisionedThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughput_.Create_ProvisionedThroughput_(com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits), com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_ToDafny(input.WriteCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_ToDafny(input *types.DeleteGlobalSecondaryIndexAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteGlobalSecondaryIndexAction_.Create_DeleteGlobalSecondaryIndexAction_(com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_ToDafny(input.IndexName))) + }() +} + +func com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_ToDafny(input *types.StreamSpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_StreamSpecification_.Create_StreamSpecification_(com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_ToDafny(input.StreamEnabled), com_amazonaws_dynamodb_StreamSpecification_StreamViewType_ToDafny(input.StreamViewType))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_ToDafny(input *types.SSESpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_SSESpecification_.Create_SSESpecification_(com_amazonaws_dynamodb_SSESpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_SSESpecification_SSEType_ToDafny(input.SSEType), com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_ToDafny(input []types.ReplicationGroupUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_ToDafny(input types.ReplicationGroupUpdate) ComAmazonawsDynamodbTypes.ReplicationGroupUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicationGroupUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicationGroupUpdate_.Create_ReplicationGroupUpdate_(com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_ToDafny(input.Create), com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_ToDafny(input.Update), com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_ToDafny(input.Delete)) + }() +} + +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_ToDafny(input *types.CreateReplicationGroupMemberAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_CreateReplicationGroupMemberAction_.Create_CreateReplicationGroupMemberAction_(com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_ToDafny(input.TableClassOverride))) + }() +} + +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(input types.ReplicaGlobalSecondaryIndex) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndex_.Create_ReplicaGlobalSecondaryIndex_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_ToDafny(input types.TableClass) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + }() +} + +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_ToDafny(input *types.UpdateReplicationGroupMemberAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_UpdateReplicationGroupMemberAction_.Create_UpdateReplicationGroupMemberAction_(com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input.KMSMasterKeyId), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input.ProvisionedThroughputOverride), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input.OnDemandThroughputOverride), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_ToDafny(input.TableClassOverride))) + }() +} + +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_ToDafny(input *types.ProvisionedThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_ProvisionedThroughputOverride_.Create_ProvisionedThroughputOverride_(com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_ToDafny(input.ReadCapacityUnits))) + }() +} + +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_ToDafny(input *types.OnDemandThroughputOverride) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughputOverride_.Create_OnDemandThroughputOverride_(com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_ToDafny(input []types.ReplicaGlobalSecondaryIndex) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_ToDafny(input types.TableClass) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + }() +} + +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_ToDafny(input *types.DeleteReplicationGroupMemberAction) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_DeleteReplicationGroupMemberAction_.Create_DeleteReplicationGroupMemberAction_(com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_ToDafny(input.RegionName))) + }() +} + +func com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_TableClass_ToDafny(input types.TableClass) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsDynamodbTypes.TableClass)) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_ToDafny(input *types.OnDemandThroughput) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_OnDemandThroughput_.Create_OnDemandThroughput_(com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_ToDafny(input.MaxReadRequestUnits), com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_ToDafny(input.MaxWriteRequestUnits))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_ToDafny(input *types.TableDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableDescription_.Create_TableDescription_(com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_ToDafny(input.AttributeDefinitions), com_amazonaws_dynamodb_TableDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableDescription_KeySchema_ToDafny(input.KeySchema), com_amazonaws_dynamodb_TableDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableDescription_CreationDateTime_ToDafny(input.CreationDateTime), com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_ToDafny(input.ProvisionedThroughput), com_amazonaws_dynamodb_TableDescription_TableSizeBytes_ToDafny(input.TableSizeBytes), com_amazonaws_dynamodb_TableDescription_ItemCount_ToDafny(input.ItemCount), com_amazonaws_dynamodb_TableDescription_TableArn_ToDafny(input.TableArn), com_amazonaws_dynamodb_TableDescription_TableId_ToDafny(input.TableId), com_amazonaws_dynamodb_TableDescription_BillingModeSummary_ToDafny(input.BillingModeSummary), com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_ToDafny(input.LocalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_ToDafny(input.GlobalSecondaryIndexes), com_amazonaws_dynamodb_TableDescription_StreamSpecification_ToDafny(input.StreamSpecification), com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_ToDafny(input.LatestStreamLabel), com_amazonaws_dynamodb_TableDescription_LatestStreamArn_ToDafny(input.LatestStreamArn), com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_ToDafny(input.GlobalTableVersion), com_amazonaws_dynamodb_TableDescription_Replicas_ToDafny(input.Replicas), com_amazonaws_dynamodb_TableDescription_RestoreSummary_ToDafny(input.RestoreSummary), com_amazonaws_dynamodb_TableDescription_SSEDescription_ToDafny(input.SSEDescription), com_amazonaws_dynamodb_TableDescription_ArchivalSummary_ToDafny(input.ArchivalSummary), com_amazonaws_dynamodb_TableDescription_TableClassSummary_ToDafny(input.TableClassSummary), com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_ToDafny(input.DeletionProtectionEnabled), com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_ToDafny(input.OnDemandThroughput))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_ToDafny(input []types.GlobalSecondaryIndexAutoScalingUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(input types.GlobalSecondaryIndexAutoScalingUpdate) ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate { + return func() ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate { + + return ComAmazonawsDynamodbTypes.Companion_GlobalSecondaryIndexAutoScalingUpdate_.Create_GlobalSecondaryIndexAutoScalingUpdate_(com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input.ProvisionedWriteCapacityAutoScalingUpdate)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_ToDafny(input []types.ReplicaAutoScalingUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_ToDafny(input types.ReplicaAutoScalingUpdate) ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaAutoScalingUpdate_.Create_ReplicaAutoScalingUpdate_(com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_ToDafny(input.RegionName), com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_ToDafny(input.ReplicaGlobalSecondaryIndexUpdates), com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_ToDafny(input.ReplicaProvisionedReadCapacityAutoScalingUpdate)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_ToDafny(input []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_ToDafny(input types.ReplicaGlobalSecondaryIndexAutoScalingUpdate) ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + return func() ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + + return ComAmazonawsDynamodbTypes.Companion_ReplicaGlobalSecondaryIndexAutoScalingUpdate_.Create_ReplicaGlobalSecondaryIndexAutoScalingUpdate_(com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input.IndexName), com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_ToDafny(input.ProvisionedReadCapacityAutoScalingUpdate)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_ToDafny(input *types.AutoScalingSettingsUpdate) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_AutoScalingSettingsUpdate_.Create_AutoScalingSettingsUpdate_(com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_ToDafny(input.MinimumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_ToDafny(input.MaximumUnits), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_ToDafny(input.AutoScalingDisabled), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_ToDafny(input.AutoScalingRoleArn), com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_ToDafny(input.ScalingPolicyUpdate))) + }() +} + +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_ToDafny(input *types.TableAutoScalingDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TableAutoScalingDescription_.Create_TableAutoScalingDescription_(com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_ToDafny(input.TableName), com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_ToDafny(input.TableStatus), com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_ToDafny(input.Replicas))) + }() +} + +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_ToDafny(input *types.TimeToLiveSpecification) ComAmazonawsDynamodbTypes.TimeToLiveSpecification { + return func() ComAmazonawsDynamodbTypes.TimeToLiveSpecification { + if input == nil { + return ComAmazonawsDynamodbTypes.TimeToLiveSpecification{} + } + return ComAmazonawsDynamodbTypes.Companion_TimeToLiveSpecification_.Create_TimeToLiveSpecification_(com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input.AttributeName)) + }() +} + +func com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input *bool) bool { + return func() bool { + if input == nil { + return false + } + return *input + }() +} + +func com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_ToDafny(input *types.TimeToLiveSpecification) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsDynamodbTypes.Companion_TimeToLiveSpecification_.Create_TimeToLiveSpecification_(com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_ToDafny(input.Enabled), com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_ToDafny(input.AttributeName))) + }() +} + +func com_amazonaws_dynamodb_BackupInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_BackupNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_DuplicateItemException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportConflictException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ExportNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_GlobalTableNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportConflictException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ImportNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_IndexNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_InternalServerError_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_InvalidEndpointException_Message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_InvalidExportTimeException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_InvalidRestoreTimeException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_LimitExceededException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_PolicyNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ReplicaNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_RequestLimitExceeded_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ResourceInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_ResourceNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableAlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TableNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TransactionCanceledException_Message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_ToDafny(input []types.CancellationReason) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_dynamodb_CancellationReasonList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_dynamodb_CancellationReasonList_member_ToDafny(input types.CancellationReason) ComAmazonawsDynamodbTypes.CancellationReason { + return func() ComAmazonawsDynamodbTypes.CancellationReason { + + return ComAmazonawsDynamodbTypes.Companion_CancellationReason_.Create_CancellationReason_(com_amazonaws_dynamodb_CancellationReason_Item_ToDafny(input.Item), com_amazonaws_dynamodb_CancellationReason_Code_ToDafny(input.Code), com_amazonaws_dynamodb_CancellationReason_Message_ToDafny(input.Message)) + }() +} + +func com_amazonaws_dynamodb_CancellationReason_Item_ToDafny(input map[string]types.AttributeValue) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_dynamodb_AttributeMap_key_ToDafny(key), com_amazonaws_dynamodb_AttributeMap_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_dynamodb_CancellationReason_Code_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_CancellationReason_Message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TransactionConflictException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_dynamodb_TransactionInProgressException_Message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} diff --git a/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go b/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go new file mode 100644 index 000000000..82ca6b9f1 --- /dev/null +++ b/ComAmazonawsDynamodb/runtimes/go/TestsFromDafny-go/comamazonawsdynamodbsmithygenerated/to_native.go @@ -0,0 +1,16302 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comamazonawsdynamodbsmithygenerated + +import ( + "encoding/binary" + "math" + "time" + + "github.com/aws/aws-cryptographic-material-providers-library/dynamodb/ComAmazonawsDynamodbTypes" + "github.com/aws/aws-sdk-go-v2/service/dynamodb" + "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" + "github.com/aws/smithy-go" + "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" + "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" +) + +func BatchExecuteStatementInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.BatchExecuteStatementInput) dynamodb.BatchExecuteStatementInput { + + return func() dynamodb.BatchExecuteStatementInput { + + return dynamodb.BatchExecuteStatementInput{ + Statements: com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_FromDafny(dafnyInput.Dtor_Statements()), + ReturnConsumedCapacity: com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func BatchExecuteStatementOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.BatchExecuteStatementOutput) dynamodb.BatchExecuteStatementOutput { + + return func() dynamodb.BatchExecuteStatementOutput { + + return dynamodb.BatchExecuteStatementOutput{ + Responses: com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_FromDafny(dafnyOutput.Dtor_Responses().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func BatchGetItemInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.BatchGetItemInput) dynamodb.BatchGetItemInput { + + return func() dynamodb.BatchGetItemInput { + + return dynamodb.BatchGetItemInput{ + RequestItems: com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_FromDafny(dafnyInput.Dtor_RequestItems()), + ReturnConsumedCapacity: com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func BatchGetItemOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.BatchGetItemOutput) dynamodb.BatchGetItemOutput { + + return func() dynamodb.BatchGetItemOutput { + + return dynamodb.BatchGetItemOutput{ + Responses: com_amazonaws_dynamodb_BatchGetItemOutput_Responses_FromDafny(dafnyOutput.Dtor_Responses().UnwrapOr(nil)), + UnprocessedKeys: com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_FromDafny(dafnyOutput.Dtor_UnprocessedKeys().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func BatchWriteItemInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.BatchWriteItemInput) dynamodb.BatchWriteItemInput { + + return func() dynamodb.BatchWriteItemInput { + + return dynamodb.BatchWriteItemInput{ + RequestItems: com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_FromDafny(dafnyInput.Dtor_RequestItems()), + ReturnConsumedCapacity: com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + ReturnItemCollectionMetrics: com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_FromDafny(dafnyInput.Dtor_ReturnItemCollectionMetrics().UnwrapOr(nil)), + } + }() + +} + +func BatchWriteItemOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.BatchWriteItemOutput) dynamodb.BatchWriteItemOutput { + + return func() dynamodb.BatchWriteItemOutput { + + return dynamodb.BatchWriteItemOutput{ + UnprocessedItems: com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_FromDafny(dafnyOutput.Dtor_UnprocessedItems().UnwrapOr(nil)), + ItemCollectionMetrics: com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_FromDafny(dafnyOutput.Dtor_ItemCollectionMetrics().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func CreateBackupInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.CreateBackupInput) dynamodb.CreateBackupInput { + + return func() dynamodb.CreateBackupInput { + + return dynamodb.CreateBackupInput{ + TableName: com_amazonaws_dynamodb_CreateBackupInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + BackupName: com_amazonaws_dynamodb_CreateBackupInput_BackupName_FromDafny(dafnyInput.Dtor_BackupName()), + } + }() + +} + +func CreateBackupOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.CreateBackupOutput) dynamodb.CreateBackupOutput { + + return func() dynamodb.CreateBackupOutput { + + return dynamodb.CreateBackupOutput{ + BackupDetails: com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_FromDafny(dafnyOutput.Dtor_BackupDetails().UnwrapOr(nil)), + } + }() + +} + +func CreateGlobalTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.CreateGlobalTableInput) dynamodb.CreateGlobalTableInput { + + return func() dynamodb.CreateGlobalTableInput { + + return dynamodb.CreateGlobalTableInput{ + GlobalTableName: com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_FromDafny(dafnyInput.Dtor_GlobalTableName()), + ReplicationGroup: com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_FromDafny(dafnyInput.Dtor_ReplicationGroup()), + } + }() + +} + +func CreateGlobalTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.CreateGlobalTableOutput) dynamodb.CreateGlobalTableOutput { + + return func() dynamodb.CreateGlobalTableOutput { + + return dynamodb.CreateGlobalTableOutput{ + GlobalTableDescription: com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_FromDafny(dafnyOutput.Dtor_GlobalTableDescription().UnwrapOr(nil)), + } + }() + +} + +func CreateTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.CreateTableInput) dynamodb.CreateTableInput { + + return func() dynamodb.CreateTableInput { + + return dynamodb.CreateTableInput{ + AttributeDefinitions: com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_FromDafny(dafnyInput.Dtor_AttributeDefinitions()), + TableName: com_amazonaws_dynamodb_CreateTableInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + KeySchema: com_amazonaws_dynamodb_CreateTableInput_KeySchema_FromDafny(dafnyInput.Dtor_KeySchema()), + LocalSecondaryIndexes: com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_FromDafny(dafnyInput.Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_FromDafny(dafnyInput.Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + BillingMode: com_amazonaws_dynamodb_CreateTableInput_BillingMode_FromDafny(dafnyInput.Dtor_BillingMode().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_FromDafny(dafnyInput.Dtor_ProvisionedThroughput().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_FromDafny(dafnyInput.Dtor_StreamSpecification().UnwrapOr(nil)), + SSESpecification: com_amazonaws_dynamodb_CreateTableInput_SSESpecification_FromDafny(dafnyInput.Dtor_SSESpecification().UnwrapOr(nil)), + Tags: com_amazonaws_dynamodb_CreateTableInput_Tags_FromDafny(dafnyInput.Dtor_Tags().UnwrapOr(nil)), + TableClass: com_amazonaws_dynamodb_CreateTableInput_TableClass_FromDafny(dafnyInput.Dtor_TableClass().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_FromDafny(dafnyInput.Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + ResourcePolicy: com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_FromDafny(dafnyInput.Dtor_ResourcePolicy().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_FromDafny(dafnyInput.Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() + +} + +func CreateTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.CreateTableOutput) dynamodb.CreateTableOutput { + + return func() dynamodb.CreateTableOutput { + + return dynamodb.CreateTableOutput{ + TableDescription: com_amazonaws_dynamodb_CreateTableOutput_TableDescription_FromDafny(dafnyOutput.Dtor_TableDescription().UnwrapOr(nil)), + } + }() + +} + +func DeleteBackupInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DeleteBackupInput) dynamodb.DeleteBackupInput { + + return func() dynamodb.DeleteBackupInput { + + return dynamodb.DeleteBackupInput{ + BackupArn: com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_FromDafny(dafnyInput.Dtor_BackupArn()), + } + }() + +} + +func DeleteBackupOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DeleteBackupOutput) dynamodb.DeleteBackupOutput { + + return func() dynamodb.DeleteBackupOutput { + + return dynamodb.DeleteBackupOutput{ + BackupDescription: com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_FromDafny(dafnyOutput.Dtor_BackupDescription().UnwrapOr(nil)), + } + }() + +} + +func DeleteItemInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DeleteItemInput) dynamodb.DeleteItemInput { + + return func() dynamodb.DeleteItemInput { + + return dynamodb.DeleteItemInput{ + TableName: com_amazonaws_dynamodb_DeleteItemInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + Key: com_amazonaws_dynamodb_DeleteItemInput_Key_FromDafny(dafnyInput.Dtor_Key()), + Expected: com_amazonaws_dynamodb_DeleteItemInput_Expected_FromDafny(dafnyInput.Dtor_Expected().UnwrapOr(nil)), + ConditionalOperator: com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_FromDafny(dafnyInput.Dtor_ConditionalOperator().UnwrapOr(nil)), + ReturnValues: com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_FromDafny(dafnyInput.Dtor_ReturnValues().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + ReturnItemCollectionMetrics: com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_FromDafny(dafnyInput.Dtor_ReturnItemCollectionMetrics().UnwrapOr(nil)), + ConditionExpression: com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_FromDafny(dafnyInput.Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_FromDafny(dafnyInput.Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_FromDafny(dafnyInput.Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + } + }() + +} + +func DeleteItemOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DeleteItemOutput) dynamodb.DeleteItemOutput { + + return func() dynamodb.DeleteItemOutput { + + return dynamodb.DeleteItemOutput{ + Attributes: com_amazonaws_dynamodb_DeleteItemOutput_Attributes_FromDafny(dafnyOutput.Dtor_Attributes().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + ItemCollectionMetrics: com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_FromDafny(dafnyOutput.Dtor_ItemCollectionMetrics().UnwrapOr(nil)), + } + }() + +} + +func DeleteResourcePolicyInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DeleteResourcePolicyInput) dynamodb.DeleteResourcePolicyInput { + + return func() dynamodb.DeleteResourcePolicyInput { + + return dynamodb.DeleteResourcePolicyInput{ + ResourceArn: com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_FromDafny(dafnyInput.Dtor_ResourceArn()), + ExpectedRevisionId: com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_FromDafny(dafnyInput.Dtor_ExpectedRevisionId().UnwrapOr(nil)), + } + }() + +} + +func DeleteResourcePolicyOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DeleteResourcePolicyOutput) dynamodb.DeleteResourcePolicyOutput { + + return func() dynamodb.DeleteResourcePolicyOutput { + + return dynamodb.DeleteResourcePolicyOutput{ + RevisionId: com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_FromDafny(dafnyOutput.Dtor_RevisionId().UnwrapOr(nil)), + } + }() + +} + +func DeleteTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DeleteTableInput) dynamodb.DeleteTableInput { + + return func() dynamodb.DeleteTableInput { + + return dynamodb.DeleteTableInput{ + TableName: com_amazonaws_dynamodb_DeleteTableInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + } + }() + +} + +func DeleteTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DeleteTableOutput) dynamodb.DeleteTableOutput { + + return func() dynamodb.DeleteTableOutput { + + return dynamodb.DeleteTableOutput{ + TableDescription: com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_FromDafny(dafnyOutput.Dtor_TableDescription().UnwrapOr(nil)), + } + }() + +} + +func DescribeBackupInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeBackupInput) dynamodb.DescribeBackupInput { + + return func() dynamodb.DescribeBackupInput { + + return dynamodb.DescribeBackupInput{ + BackupArn: com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_FromDafny(dafnyInput.Dtor_BackupArn()), + } + }() + +} + +func DescribeBackupOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeBackupOutput) dynamodb.DescribeBackupOutput { + + return func() dynamodb.DescribeBackupOutput { + + return dynamodb.DescribeBackupOutput{ + BackupDescription: com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_FromDafny(dafnyOutput.Dtor_BackupDescription().UnwrapOr(nil)), + } + }() + +} + +func DescribeContinuousBackupsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeContinuousBackupsInput) dynamodb.DescribeContinuousBackupsInput { + + return func() dynamodb.DescribeContinuousBackupsInput { + + return dynamodb.DescribeContinuousBackupsInput{ + TableName: com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + } + }() + +} + +func DescribeContinuousBackupsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeContinuousBackupsOutput) dynamodb.DescribeContinuousBackupsOutput { + + return func() dynamodb.DescribeContinuousBackupsOutput { + + return dynamodb.DescribeContinuousBackupsOutput{ + ContinuousBackupsDescription: com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(dafnyOutput.Dtor_ContinuousBackupsDescription().UnwrapOr(nil)), + } + }() + +} + +func DescribeContributorInsightsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeContributorInsightsInput) dynamodb.DescribeContributorInsightsInput { + + return func() dynamodb.DescribeContributorInsightsInput { + + return dynamodb.DescribeContributorInsightsInput{ + TableName: com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + IndexName: com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_FromDafny(dafnyInput.Dtor_IndexName().UnwrapOr(nil)), + } + }() + +} + +func DescribeContributorInsightsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeContributorInsightsOutput) dynamodb.DescribeContributorInsightsOutput { + + return func() dynamodb.DescribeContributorInsightsOutput { + + return dynamodb.DescribeContributorInsightsOutput{ + TableName: com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_FromDafny(dafnyOutput.Dtor_TableName().UnwrapOr(nil)), + IndexName: com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_FromDafny(dafnyOutput.Dtor_IndexName().UnwrapOr(nil)), + ContributorInsightsRuleList: com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_FromDafny(dafnyOutput.Dtor_ContributorInsightsRuleList().UnwrapOr(nil)), + ContributorInsightsStatus: com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_FromDafny(dafnyOutput.Dtor_ContributorInsightsStatus().UnwrapOr(nil)), + LastUpdateDateTime: com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_FromDafny(dafnyOutput.Dtor_LastUpdateDateTime().UnwrapOr(nil)), + FailureException: com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_FromDafny(dafnyOutput.Dtor_FailureException().UnwrapOr(nil)), + } + }() + +} + +func DescribeEndpointsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeEndpointsRequest) dynamodb.DescribeEndpointsInput { + + return func() dynamodb.DescribeEndpointsInput { + + return dynamodb.DescribeEndpointsInput{} + }() + +} + +func DescribeEndpointsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeEndpointsResponse) dynamodb.DescribeEndpointsOutput { + + return func() dynamodb.DescribeEndpointsOutput { + + return dynamodb.DescribeEndpointsOutput{ + Endpoints: com_amazonaws_dynamodb_DescribeEndpointsOutput_Endpoints_FromDafny(dafnyOutput.Dtor_Endpoints()), + } + }() + +} + +func DescribeExportInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeExportInput) dynamodb.DescribeExportInput { + + return func() dynamodb.DescribeExportInput { + + return dynamodb.DescribeExportInput{ + ExportArn: com_amazonaws_dynamodb_DescribeExportInput_ExportArn_FromDafny(dafnyInput.Dtor_ExportArn()), + } + }() + +} + +func DescribeExportOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeExportOutput) dynamodb.DescribeExportOutput { + + return func() dynamodb.DescribeExportOutput { + + return dynamodb.DescribeExportOutput{ + ExportDescription: com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_FromDafny(dafnyOutput.Dtor_ExportDescription().UnwrapOr(nil)), + } + }() + +} + +func DescribeGlobalTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeGlobalTableInput) dynamodb.DescribeGlobalTableInput { + + return func() dynamodb.DescribeGlobalTableInput { + + return dynamodb.DescribeGlobalTableInput{ + GlobalTableName: com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_FromDafny(dafnyInput.Dtor_GlobalTableName()), + } + }() + +} + +func DescribeGlobalTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeGlobalTableOutput) dynamodb.DescribeGlobalTableOutput { + + return func() dynamodb.DescribeGlobalTableOutput { + + return dynamodb.DescribeGlobalTableOutput{ + GlobalTableDescription: com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_FromDafny(dafnyOutput.Dtor_GlobalTableDescription().UnwrapOr(nil)), + } + }() + +} + +func DescribeGlobalTableSettingsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeGlobalTableSettingsInput) dynamodb.DescribeGlobalTableSettingsInput { + + return func() dynamodb.DescribeGlobalTableSettingsInput { + + return dynamodb.DescribeGlobalTableSettingsInput{ + GlobalTableName: com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_FromDafny(dafnyInput.Dtor_GlobalTableName()), + } + }() + +} + +func DescribeGlobalTableSettingsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeGlobalTableSettingsOutput) dynamodb.DescribeGlobalTableSettingsOutput { + + return func() dynamodb.DescribeGlobalTableSettingsOutput { + + return dynamodb.DescribeGlobalTableSettingsOutput{ + GlobalTableName: com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_FromDafny(dafnyOutput.Dtor_GlobalTableName().UnwrapOr(nil)), + ReplicaSettings: com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_FromDafny(dafnyOutput.Dtor_ReplicaSettings().UnwrapOr(nil)), + } + }() + +} + +func DescribeImportInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeImportInput) dynamodb.DescribeImportInput { + + return func() dynamodb.DescribeImportInput { + + return dynamodb.DescribeImportInput{ + ImportArn: com_amazonaws_dynamodb_DescribeImportInput_ImportArn_FromDafny(dafnyInput.Dtor_ImportArn()), + } + }() + +} + +func DescribeImportOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeImportOutput) dynamodb.DescribeImportOutput { + + return func() dynamodb.DescribeImportOutput { + + return dynamodb.DescribeImportOutput{ + ImportTableDescription: com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_FromDafny(dafnyOutput.Dtor_ImportTableDescription()), + } + }() + +} + +func DescribeKinesisStreamingDestinationInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeKinesisStreamingDestinationInput) dynamodb.DescribeKinesisStreamingDestinationInput { + + return func() dynamodb.DescribeKinesisStreamingDestinationInput { + + return dynamodb.DescribeKinesisStreamingDestinationInput{ + TableName: com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + } + }() + +} + +func DescribeKinesisStreamingDestinationOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeKinesisStreamingDestinationOutput) dynamodb.DescribeKinesisStreamingDestinationOutput { + + return func() dynamodb.DescribeKinesisStreamingDestinationOutput { + + return dynamodb.DescribeKinesisStreamingDestinationOutput{ + TableName: com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_FromDafny(dafnyOutput.Dtor_TableName().UnwrapOr(nil)), + KinesisDataStreamDestinations: com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_FromDafny(dafnyOutput.Dtor_KinesisDataStreamDestinations().UnwrapOr(nil)), + } + }() + +} + +func DescribeLimitsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeLimitsInput) dynamodb.DescribeLimitsInput { + + return func() dynamodb.DescribeLimitsInput { + + return dynamodb.DescribeLimitsInput{} + }() + +} + +func DescribeLimitsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeLimitsOutput) dynamodb.DescribeLimitsOutput { + + return func() dynamodb.DescribeLimitsOutput { + + return dynamodb.DescribeLimitsOutput{ + AccountMaxReadCapacityUnits: com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxReadCapacityUnits_FromDafny(dafnyOutput.Dtor_AccountMaxReadCapacityUnits().UnwrapOr(nil)), + AccountMaxWriteCapacityUnits: com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_FromDafny(dafnyOutput.Dtor_AccountMaxWriteCapacityUnits().UnwrapOr(nil)), + TableMaxReadCapacityUnits: com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_FromDafny(dafnyOutput.Dtor_TableMaxReadCapacityUnits().UnwrapOr(nil)), + TableMaxWriteCapacityUnits: com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_FromDafny(dafnyOutput.Dtor_TableMaxWriteCapacityUnits().UnwrapOr(nil)), + } + }() + +} + +func DescribeTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeTableInput) dynamodb.DescribeTableInput { + + return func() dynamodb.DescribeTableInput { + + return dynamodb.DescribeTableInput{ + TableName: com_amazonaws_dynamodb_DescribeTableInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + } + }() + +} + +func DescribeTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeTableOutput) dynamodb.DescribeTableOutput { + + return func() dynamodb.DescribeTableOutput { + + return dynamodb.DescribeTableOutput{ + Table: com_amazonaws_dynamodb_DescribeTableOutput_Table_FromDafny(dafnyOutput.Dtor_Table().UnwrapOr(nil)), + } + }() + +} + +func DescribeTableReplicaAutoScalingInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeTableReplicaAutoScalingInput) dynamodb.DescribeTableReplicaAutoScalingInput { + + return func() dynamodb.DescribeTableReplicaAutoScalingInput { + + return dynamodb.DescribeTableReplicaAutoScalingInput{ + TableName: com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + } + }() + +} + +func DescribeTableReplicaAutoScalingOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeTableReplicaAutoScalingOutput) dynamodb.DescribeTableReplicaAutoScalingOutput { + + return func() dynamodb.DescribeTableReplicaAutoScalingOutput { + + return dynamodb.DescribeTableReplicaAutoScalingOutput{ + TableAutoScalingDescription: com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(dafnyOutput.Dtor_TableAutoScalingDescription().UnwrapOr(nil)), + } + }() + +} + +func DescribeTimeToLiveInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DescribeTimeToLiveInput) dynamodb.DescribeTimeToLiveInput { + + return func() dynamodb.DescribeTimeToLiveInput { + + return dynamodb.DescribeTimeToLiveInput{ + TableName: com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + } + }() + +} + +func DescribeTimeToLiveOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DescribeTimeToLiveOutput) dynamodb.DescribeTimeToLiveOutput { + + return func() dynamodb.DescribeTimeToLiveOutput { + + return dynamodb.DescribeTimeToLiveOutput{ + TimeToLiveDescription: com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_FromDafny(dafnyOutput.Dtor_TimeToLiveDescription().UnwrapOr(nil)), + } + }() + +} + +func DisableKinesisStreamingDestinationInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.DisableKinesisStreamingDestinationInput) dynamodb.DisableKinesisStreamingDestinationInput { + + return func() dynamodb.DisableKinesisStreamingDestinationInput { + + return dynamodb.DisableKinesisStreamingDestinationInput{ + TableName: com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + StreamArn: com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_FromDafny(dafnyInput.Dtor_StreamArn()), + EnableKinesisStreamingConfiguration: com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(dafnyInput.Dtor_EnableKinesisStreamingConfiguration().UnwrapOr(nil)), + } + }() + +} + +func DisableKinesisStreamingDestinationOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.DisableKinesisStreamingDestinationOutput) dynamodb.DisableKinesisStreamingDestinationOutput { + + return func() dynamodb.DisableKinesisStreamingDestinationOutput { + + return dynamodb.DisableKinesisStreamingDestinationOutput{ + TableName: com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_FromDafny(dafnyOutput.Dtor_TableName().UnwrapOr(nil)), + StreamArn: com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_FromDafny(dafnyOutput.Dtor_StreamArn().UnwrapOr(nil)), + DestinationStatus: com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(dafnyOutput.Dtor_DestinationStatus().UnwrapOr(nil)), + EnableKinesisStreamingConfiguration: com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(dafnyOutput.Dtor_EnableKinesisStreamingConfiguration().UnwrapOr(nil)), + } + }() + +} + +func EnableKinesisStreamingDestinationInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.EnableKinesisStreamingDestinationInput) dynamodb.EnableKinesisStreamingDestinationInput { + + return func() dynamodb.EnableKinesisStreamingDestinationInput { + + return dynamodb.EnableKinesisStreamingDestinationInput{ + TableName: com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + StreamArn: com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_FromDafny(dafnyInput.Dtor_StreamArn()), + EnableKinesisStreamingConfiguration: com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(dafnyInput.Dtor_EnableKinesisStreamingConfiguration().UnwrapOr(nil)), + } + }() + +} + +func EnableKinesisStreamingDestinationOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.EnableKinesisStreamingDestinationOutput) dynamodb.EnableKinesisStreamingDestinationOutput { + + return func() dynamodb.EnableKinesisStreamingDestinationOutput { + + return dynamodb.EnableKinesisStreamingDestinationOutput{ + TableName: com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_FromDafny(dafnyOutput.Dtor_TableName().UnwrapOr(nil)), + StreamArn: com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_FromDafny(dafnyOutput.Dtor_StreamArn().UnwrapOr(nil)), + DestinationStatus: com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(dafnyOutput.Dtor_DestinationStatus().UnwrapOr(nil)), + EnableKinesisStreamingConfiguration: com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(dafnyOutput.Dtor_EnableKinesisStreamingConfiguration().UnwrapOr(nil)), + } + }() + +} + +func ExecuteStatementInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ExecuteStatementInput) dynamodb.ExecuteStatementInput { + + return func() dynamodb.ExecuteStatementInput { + + return dynamodb.ExecuteStatementInput{ + Statement: com_amazonaws_dynamodb_ExecuteStatementInput_Statement_FromDafny(dafnyInput.Dtor_Statement()), + Parameters: com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_FromDafny(dafnyInput.Dtor_Parameters().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_FromDafny(dafnyInput.Dtor_ConsistentRead().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_FromDafny(dafnyInput.Dtor_NextToken().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + Limit: com_amazonaws_dynamodb_ExecuteStatementInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + } + }() + +} + +func ExecuteStatementOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ExecuteStatementOutput) dynamodb.ExecuteStatementOutput { + + return func() dynamodb.ExecuteStatementOutput { + + return dynamodb.ExecuteStatementOutput{ + Items: com_amazonaws_dynamodb_ExecuteStatementOutput_Items_FromDafny(dafnyOutput.Dtor_Items().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_FromDafny(dafnyOutput.Dtor_NextToken().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + LastEvaluatedKey: com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_FromDafny(dafnyOutput.Dtor_LastEvaluatedKey().UnwrapOr(nil)), + } + }() + +} + +func ExecuteTransactionInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ExecuteTransactionInput) dynamodb.ExecuteTransactionInput { + + return func() dynamodb.ExecuteTransactionInput { + + return dynamodb.ExecuteTransactionInput{ + TransactStatements: com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_FromDafny(dafnyInput.Dtor_TransactStatements()), + ClientRequestToken: com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_FromDafny(dafnyInput.Dtor_ClientRequestToken().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func ExecuteTransactionOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ExecuteTransactionOutput) dynamodb.ExecuteTransactionOutput { + + return func() dynamodb.ExecuteTransactionOutput { + + return dynamodb.ExecuteTransactionOutput{ + Responses: com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_FromDafny(dafnyOutput.Dtor_Responses().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func ExportTableToPointInTimeInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ExportTableToPointInTimeInput) dynamodb.ExportTableToPointInTimeInput { + + return func() dynamodb.ExportTableToPointInTimeInput { + + return dynamodb.ExportTableToPointInTimeInput{ + TableArn: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_FromDafny(dafnyInput.Dtor_TableArn()), + ExportTime: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_FromDafny(dafnyInput.Dtor_ExportTime().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_FromDafny(dafnyInput.Dtor_ClientToken().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_FromDafny(dafnyInput.Dtor_S3Bucket()), + S3BucketOwner: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_FromDafny(dafnyInput.Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Prefix: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_FromDafny(dafnyInput.Dtor_S3Prefix().UnwrapOr(nil)), + S3SseAlgorithm: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_FromDafny(dafnyInput.Dtor_S3SseAlgorithm().UnwrapOr(nil)), + S3SseKmsKeyId: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_FromDafny(dafnyInput.Dtor_S3SseKmsKeyId().UnwrapOr(nil)), + ExportFormat: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_FromDafny(dafnyInput.Dtor_ExportFormat().UnwrapOr(nil)), + ExportType: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_FromDafny(dafnyInput.Dtor_ExportType().UnwrapOr(nil)), + IncrementalExportSpecification: com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_FromDafny(dafnyInput.Dtor_IncrementalExportSpecification().UnwrapOr(nil)), + } + }() + +} + +func ExportTableToPointInTimeOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ExportTableToPointInTimeOutput) dynamodb.ExportTableToPointInTimeOutput { + + return func() dynamodb.ExportTableToPointInTimeOutput { + + return dynamodb.ExportTableToPointInTimeOutput{ + ExportDescription: com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_FromDafny(dafnyOutput.Dtor_ExportDescription().UnwrapOr(nil)), + } + }() + +} + +func GetItemInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.GetItemInput) dynamodb.GetItemInput { + + return func() dynamodb.GetItemInput { + + return dynamodb.GetItemInput{ + TableName: com_amazonaws_dynamodb_GetItemInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + Key: com_amazonaws_dynamodb_GetItemInput_Key_FromDafny(dafnyInput.Dtor_Key()), + AttributesToGet: com_amazonaws_dynamodb_GetItemInput_AttributesToGet_FromDafny(dafnyInput.Dtor_AttributesToGet().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_GetItemInput_ConsistentRead_FromDafny(dafnyInput.Dtor_ConsistentRead().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + ProjectionExpression: com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_FromDafny(dafnyInput.Dtor_ProjectionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_FromDafny(dafnyInput.Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + } + }() + +} + +func GetItemOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.GetItemOutput) dynamodb.GetItemOutput { + + return func() dynamodb.GetItemOutput { + + return dynamodb.GetItemOutput{ + Item: com_amazonaws_dynamodb_GetItemOutput_Item_FromDafny(dafnyOutput.Dtor_Item().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func GetResourcePolicyInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.GetResourcePolicyInput) dynamodb.GetResourcePolicyInput { + + return func() dynamodb.GetResourcePolicyInput { + + return dynamodb.GetResourcePolicyInput{ + ResourceArn: com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_FromDafny(dafnyInput.Dtor_ResourceArn()), + } + }() + +} + +func GetResourcePolicyOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.GetResourcePolicyOutput) dynamodb.GetResourcePolicyOutput { + + return func() dynamodb.GetResourcePolicyOutput { + + return dynamodb.GetResourcePolicyOutput{ + Policy: com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_FromDafny(dafnyOutput.Dtor_Policy().UnwrapOr(nil)), + RevisionId: com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_FromDafny(dafnyOutput.Dtor_RevisionId().UnwrapOr(nil)), + } + }() + +} + +func ImportTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ImportTableInput) dynamodb.ImportTableInput { + + return func() dynamodb.ImportTableInput { + + return dynamodb.ImportTableInput{ + ClientToken: com_amazonaws_dynamodb_ImportTableInput_ClientToken_FromDafny(dafnyInput.Dtor_ClientToken().UnwrapOr(nil)), + S3BucketSource: com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_FromDafny(dafnyInput.Dtor_S3BucketSource()), + InputFormat: com_amazonaws_dynamodb_ImportTableInput_InputFormat_FromDafny(dafnyInput.Dtor_InputFormat()), + InputFormatOptions: com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_FromDafny(dafnyInput.Dtor_InputFormatOptions().UnwrapOr(nil)), + InputCompressionType: com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_FromDafny(dafnyInput.Dtor_InputCompressionType().UnwrapOr(nil)), + TableCreationParameters: com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_FromDafny(dafnyInput.Dtor_TableCreationParameters()), + } + }() + +} + +func ImportTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ImportTableOutput) dynamodb.ImportTableOutput { + + return func() dynamodb.ImportTableOutput { + + return dynamodb.ImportTableOutput{ + ImportTableDescription: com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_FromDafny(dafnyOutput.Dtor_ImportTableDescription()), + } + }() + +} + +func ListBackupsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ListBackupsInput) dynamodb.ListBackupsInput { + + return func() dynamodb.ListBackupsInput { + + return dynamodb.ListBackupsInput{ + TableName: com_amazonaws_dynamodb_ListBackupsInput_TableName_FromDafny(dafnyInput.Dtor_TableName().UnwrapOr(nil)), + Limit: com_amazonaws_dynamodb_ListBackupsInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + TimeRangeLowerBound: com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_FromDafny(dafnyInput.Dtor_TimeRangeLowerBound().UnwrapOr(nil)), + TimeRangeUpperBound: com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_FromDafny(dafnyInput.Dtor_TimeRangeUpperBound().UnwrapOr(nil)), + ExclusiveStartBackupArn: com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_FromDafny(dafnyInput.Dtor_ExclusiveStartBackupArn().UnwrapOr(nil)), + BackupType: com_amazonaws_dynamodb_ListBackupsInput_BackupType_FromDafny(dafnyInput.Dtor_BackupType().UnwrapOr(nil)), + } + }() + +} + +func ListBackupsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ListBackupsOutput) dynamodb.ListBackupsOutput { + + return func() dynamodb.ListBackupsOutput { + + return dynamodb.ListBackupsOutput{ + BackupSummaries: com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_FromDafny(dafnyOutput.Dtor_BackupSummaries().UnwrapOr(nil)), + LastEvaluatedBackupArn: com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_FromDafny(dafnyOutput.Dtor_LastEvaluatedBackupArn().UnwrapOr(nil)), + } + }() + +} + +func ListContributorInsightsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ListContributorInsightsInput) dynamodb.ListContributorInsightsInput { + + return func() dynamodb.ListContributorInsightsInput { + + return dynamodb.ListContributorInsightsInput{ + TableName: com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_FromDafny(dafnyInput.Dtor_TableName().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_FromDafny(dafnyInput.Dtor_NextToken().UnwrapOr(nil)), + MaxResults: com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_FromDafny(dafnyInput.Dtor_MaxResults().UnwrapOr(nil)), + } + }() + +} + +func ListContributorInsightsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ListContributorInsightsOutput) dynamodb.ListContributorInsightsOutput { + + return func() dynamodb.ListContributorInsightsOutput { + + return dynamodb.ListContributorInsightsOutput{ + ContributorInsightsSummaries: com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_FromDafny(dafnyOutput.Dtor_ContributorInsightsSummaries().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_FromDafny(dafnyOutput.Dtor_NextToken().UnwrapOr(nil)), + } + }() + +} + +func ListExportsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ListExportsInput) dynamodb.ListExportsInput { + + return func() dynamodb.ListExportsInput { + + return dynamodb.ListExportsInput{ + TableArn: com_amazonaws_dynamodb_ListExportsInput_TableArn_FromDafny(dafnyInput.Dtor_TableArn().UnwrapOr(nil)), + MaxResults: com_amazonaws_dynamodb_ListExportsInput_MaxResults_FromDafny(dafnyInput.Dtor_MaxResults().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ListExportsInput_NextToken_FromDafny(dafnyInput.Dtor_NextToken().UnwrapOr(nil)), + } + }() + +} + +func ListExportsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ListExportsOutput) dynamodb.ListExportsOutput { + + return func() dynamodb.ListExportsOutput { + + return dynamodb.ListExportsOutput{ + ExportSummaries: com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_FromDafny(dafnyOutput.Dtor_ExportSummaries().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ListExportsOutput_NextToken_FromDafny(dafnyOutput.Dtor_NextToken().UnwrapOr(nil)), + } + }() + +} + +func ListGlobalTablesInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ListGlobalTablesInput) dynamodb.ListGlobalTablesInput { + + return func() dynamodb.ListGlobalTablesInput { + + return dynamodb.ListGlobalTablesInput{ + ExclusiveStartGlobalTableName: com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_FromDafny(dafnyInput.Dtor_ExclusiveStartGlobalTableName().UnwrapOr(nil)), + Limit: com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + RegionName: com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_FromDafny(dafnyInput.Dtor_RegionName().UnwrapOr(nil)), + } + }() + +} + +func ListGlobalTablesOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ListGlobalTablesOutput) dynamodb.ListGlobalTablesOutput { + + return func() dynamodb.ListGlobalTablesOutput { + + return dynamodb.ListGlobalTablesOutput{ + GlobalTables: com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_FromDafny(dafnyOutput.Dtor_GlobalTables().UnwrapOr(nil)), + LastEvaluatedGlobalTableName: com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_FromDafny(dafnyOutput.Dtor_LastEvaluatedGlobalTableName().UnwrapOr(nil)), + } + }() + +} + +func ListImportsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ListImportsInput) dynamodb.ListImportsInput { + + return func() dynamodb.ListImportsInput { + + return dynamodb.ListImportsInput{ + TableArn: com_amazonaws_dynamodb_ListImportsInput_TableArn_FromDafny(dafnyInput.Dtor_TableArn().UnwrapOr(nil)), + PageSize: com_amazonaws_dynamodb_ListImportsInput_PageSize_FromDafny(dafnyInput.Dtor_PageSize().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ListImportsInput_NextToken_FromDafny(dafnyInput.Dtor_NextToken().UnwrapOr(nil)), + } + }() + +} + +func ListImportsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ListImportsOutput) dynamodb.ListImportsOutput { + + return func() dynamodb.ListImportsOutput { + + return dynamodb.ListImportsOutput{ + ImportSummaryList: com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_FromDafny(dafnyOutput.Dtor_ImportSummaryList().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ListImportsOutput_NextToken_FromDafny(dafnyOutput.Dtor_NextToken().UnwrapOr(nil)), + } + }() + +} + +func ListTablesInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ListTablesInput) dynamodb.ListTablesInput { + + return func() dynamodb.ListTablesInput { + + return dynamodb.ListTablesInput{ + ExclusiveStartTableName: com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_FromDafny(dafnyInput.Dtor_ExclusiveStartTableName().UnwrapOr(nil)), + Limit: com_amazonaws_dynamodb_ListTablesInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + } + }() + +} + +func ListTablesOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ListTablesOutput) dynamodb.ListTablesOutput { + + return func() dynamodb.ListTablesOutput { + + return dynamodb.ListTablesOutput{ + TableNames: com_amazonaws_dynamodb_ListTablesOutput_TableNames_FromDafny(dafnyOutput.Dtor_TableNames().UnwrapOr(nil)), + LastEvaluatedTableName: com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_FromDafny(dafnyOutput.Dtor_LastEvaluatedTableName().UnwrapOr(nil)), + } + }() + +} + +func ListTagsOfResourceInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ListTagsOfResourceInput) dynamodb.ListTagsOfResourceInput { + + return func() dynamodb.ListTagsOfResourceInput { + + return dynamodb.ListTagsOfResourceInput{ + ResourceArn: com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_FromDafny(dafnyInput.Dtor_ResourceArn()), + NextToken: com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_FromDafny(dafnyInput.Dtor_NextToken().UnwrapOr(nil)), + } + }() + +} + +func ListTagsOfResourceOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ListTagsOfResourceOutput) dynamodb.ListTagsOfResourceOutput { + + return func() dynamodb.ListTagsOfResourceOutput { + + return dynamodb.ListTagsOfResourceOutput{ + Tags: com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_FromDafny(dafnyOutput.Dtor_Tags().UnwrapOr(nil)), + NextToken: com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_FromDafny(dafnyOutput.Dtor_NextToken().UnwrapOr(nil)), + } + }() + +} + +func PutItemInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.PutItemInput) dynamodb.PutItemInput { + + return func() dynamodb.PutItemInput { + + return dynamodb.PutItemInput{ + TableName: com_amazonaws_dynamodb_PutItemInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + Item: com_amazonaws_dynamodb_PutItemInput_Item_FromDafny(dafnyInput.Dtor_Item()), + Expected: com_amazonaws_dynamodb_PutItemInput_Expected_FromDafny(dafnyInput.Dtor_Expected().UnwrapOr(nil)), + ReturnValues: com_amazonaws_dynamodb_PutItemInput_ReturnValues_FromDafny(dafnyInput.Dtor_ReturnValues().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + ReturnItemCollectionMetrics: com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_FromDafny(dafnyInput.Dtor_ReturnItemCollectionMetrics().UnwrapOr(nil)), + ConditionalOperator: com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_FromDafny(dafnyInput.Dtor_ConditionalOperator().UnwrapOr(nil)), + ConditionExpression: com_amazonaws_dynamodb_PutItemInput_ConditionExpression_FromDafny(dafnyInput.Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_FromDafny(dafnyInput.Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_FromDafny(dafnyInput.Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + } + }() + +} + +func PutItemOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.PutItemOutput) dynamodb.PutItemOutput { + + return func() dynamodb.PutItemOutput { + + return dynamodb.PutItemOutput{ + Attributes: com_amazonaws_dynamodb_PutItemOutput_Attributes_FromDafny(dafnyOutput.Dtor_Attributes().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + ItemCollectionMetrics: com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_FromDafny(dafnyOutput.Dtor_ItemCollectionMetrics().UnwrapOr(nil)), + } + }() + +} + +func PutResourcePolicyInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.PutResourcePolicyInput) dynamodb.PutResourcePolicyInput { + + return func() dynamodb.PutResourcePolicyInput { + + return dynamodb.PutResourcePolicyInput{ + ResourceArn: com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_FromDafny(dafnyInput.Dtor_ResourceArn()), + Policy: com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_FromDafny(dafnyInput.Dtor_Policy()), + ExpectedRevisionId: com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_FromDafny(dafnyInput.Dtor_ExpectedRevisionId().UnwrapOr(nil)), + ConfirmRemoveSelfResourceAccess: com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_FromDafny(dafnyInput.Dtor_ConfirmRemoveSelfResourceAccess().UnwrapOr(nil)), + } + }() + +} + +func PutResourcePolicyOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.PutResourcePolicyOutput) dynamodb.PutResourcePolicyOutput { + + return func() dynamodb.PutResourcePolicyOutput { + + return dynamodb.PutResourcePolicyOutput{ + RevisionId: com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_FromDafny(dafnyOutput.Dtor_RevisionId().UnwrapOr(nil)), + } + }() + +} + +func QueryInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.QueryInput) dynamodb.QueryInput { + + return func() dynamodb.QueryInput { + + return dynamodb.QueryInput{ + TableName: com_amazonaws_dynamodb_QueryInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + IndexName: com_amazonaws_dynamodb_QueryInput_IndexName_FromDafny(dafnyInput.Dtor_IndexName().UnwrapOr(nil)), + Select: com_amazonaws_dynamodb_QueryInput_Select_FromDafny(dafnyInput.Dtor_Select().UnwrapOr(nil)), + AttributesToGet: com_amazonaws_dynamodb_QueryInput_AttributesToGet_FromDafny(dafnyInput.Dtor_AttributesToGet().UnwrapOr(nil)), + Limit: com_amazonaws_dynamodb_QueryInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_QueryInput_ConsistentRead_FromDafny(dafnyInput.Dtor_ConsistentRead().UnwrapOr(nil)), + KeyConditions: com_amazonaws_dynamodb_QueryInput_KeyConditions_FromDafny(dafnyInput.Dtor_KeyConditions().UnwrapOr(nil)), + QueryFilter: com_amazonaws_dynamodb_QueryInput_QueryFilter_FromDafny(dafnyInput.Dtor_QueryFilter().UnwrapOr(nil)), + ConditionalOperator: com_amazonaws_dynamodb_QueryInput_ConditionalOperator_FromDafny(dafnyInput.Dtor_ConditionalOperator().UnwrapOr(nil)), + ScanIndexForward: com_amazonaws_dynamodb_QueryInput_ScanIndexForward_FromDafny(dafnyInput.Dtor_ScanIndexForward().UnwrapOr(nil)), + ExclusiveStartKey: com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_FromDafny(dafnyInput.Dtor_ExclusiveStartKey().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + ProjectionExpression: com_amazonaws_dynamodb_QueryInput_ProjectionExpression_FromDafny(dafnyInput.Dtor_ProjectionExpression().UnwrapOr(nil)), + FilterExpression: com_amazonaws_dynamodb_QueryInput_FilterExpression_FromDafny(dafnyInput.Dtor_FilterExpression().UnwrapOr(nil)), + KeyConditionExpression: com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_FromDafny(dafnyInput.Dtor_KeyConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_FromDafny(dafnyInput.Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_FromDafny(dafnyInput.Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + } + }() + +} + +func QueryOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.QueryOutput) dynamodb.QueryOutput { + + return func() dynamodb.QueryOutput { + + return dynamodb.QueryOutput{ + Items: com_amazonaws_dynamodb_QueryOutput_Items_FromDafny(dafnyOutput.Dtor_Items().UnwrapOr(nil)), + Count: com_amazonaws_dynamodb_QueryOutput_Count_FromDafny(dafnyOutput.Dtor_Count().UnwrapOr(nil)), + ScannedCount: com_amazonaws_dynamodb_QueryOutput_ScannedCount_FromDafny(dafnyOutput.Dtor_ScannedCount().UnwrapOr(nil)), + LastEvaluatedKey: com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_FromDafny(dafnyOutput.Dtor_LastEvaluatedKey().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func RestoreTableFromBackupInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.RestoreTableFromBackupInput) dynamodb.RestoreTableFromBackupInput { + + return func() dynamodb.RestoreTableFromBackupInput { + + return dynamodb.RestoreTableFromBackupInput{ + TargetTableName: com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_FromDafny(dafnyInput.Dtor_TargetTableName()), + BackupArn: com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_FromDafny(dafnyInput.Dtor_BackupArn()), + BillingModeOverride: com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_FromDafny(dafnyInput.Dtor_BillingModeOverride().UnwrapOr(nil)), + GlobalSecondaryIndexOverride: com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_FromDafny(dafnyInput.Dtor_GlobalSecondaryIndexOverride().UnwrapOr(nil)), + LocalSecondaryIndexOverride: com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_FromDafny(dafnyInput.Dtor_LocalSecondaryIndexOverride().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_FromDafny(dafnyInput.Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_FromDafny(dafnyInput.Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + SSESpecificationOverride: com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_FromDafny(dafnyInput.Dtor_SSESpecificationOverride().UnwrapOr(nil)), + } + }() + +} + +func RestoreTableFromBackupOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.RestoreTableFromBackupOutput) dynamodb.RestoreTableFromBackupOutput { + + return func() dynamodb.RestoreTableFromBackupOutput { + + return dynamodb.RestoreTableFromBackupOutput{ + TableDescription: com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_FromDafny(dafnyOutput.Dtor_TableDescription().UnwrapOr(nil)), + } + }() + +} + +func RestoreTableToPointInTimeInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.RestoreTableToPointInTimeInput) dynamodb.RestoreTableToPointInTimeInput { + + return func() dynamodb.RestoreTableToPointInTimeInput { + + return dynamodb.RestoreTableToPointInTimeInput{ + SourceTableArn: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_FromDafny(dafnyInput.Dtor_SourceTableArn().UnwrapOr(nil)), + SourceTableName: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_FromDafny(dafnyInput.Dtor_SourceTableName().UnwrapOr(nil)), + TargetTableName: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_FromDafny(dafnyInput.Dtor_TargetTableName()), + UseLatestRestorableTime: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_FromDafny(dafnyInput.Dtor_UseLatestRestorableTime().UnwrapOr(nil)), + RestoreDateTime: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_FromDafny(dafnyInput.Dtor_RestoreDateTime().UnwrapOr(nil)), + BillingModeOverride: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_FromDafny(dafnyInput.Dtor_BillingModeOverride().UnwrapOr(nil)), + GlobalSecondaryIndexOverride: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_FromDafny(dafnyInput.Dtor_GlobalSecondaryIndexOverride().UnwrapOr(nil)), + LocalSecondaryIndexOverride: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_FromDafny(dafnyInput.Dtor_LocalSecondaryIndexOverride().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_FromDafny(dafnyInput.Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_FromDafny(dafnyInput.Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + SSESpecificationOverride: com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_FromDafny(dafnyInput.Dtor_SSESpecificationOverride().UnwrapOr(nil)), + } + }() + +} + +func RestoreTableToPointInTimeOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.RestoreTableToPointInTimeOutput) dynamodb.RestoreTableToPointInTimeOutput { + + return func() dynamodb.RestoreTableToPointInTimeOutput { + + return dynamodb.RestoreTableToPointInTimeOutput{ + TableDescription: com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_FromDafny(dafnyOutput.Dtor_TableDescription().UnwrapOr(nil)), + } + }() + +} + +func ScanInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.ScanInput) dynamodb.ScanInput { + + return func() dynamodb.ScanInput { + + return dynamodb.ScanInput{ + TableName: com_amazonaws_dynamodb_ScanInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + IndexName: com_amazonaws_dynamodb_ScanInput_IndexName_FromDafny(dafnyInput.Dtor_IndexName().UnwrapOr(nil)), + AttributesToGet: com_amazonaws_dynamodb_ScanInput_AttributesToGet_FromDafny(dafnyInput.Dtor_AttributesToGet().UnwrapOr(nil)), + Limit: com_amazonaws_dynamodb_ScanInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Select: com_amazonaws_dynamodb_ScanInput_Select_FromDafny(dafnyInput.Dtor_Select().UnwrapOr(nil)), + ScanFilter: com_amazonaws_dynamodb_ScanInput_ScanFilter_FromDafny(dafnyInput.Dtor_ScanFilter().UnwrapOr(nil)), + ConditionalOperator: com_amazonaws_dynamodb_ScanInput_ConditionalOperator_FromDafny(dafnyInput.Dtor_ConditionalOperator().UnwrapOr(nil)), + ExclusiveStartKey: com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_FromDafny(dafnyInput.Dtor_ExclusiveStartKey().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + TotalSegments: com_amazonaws_dynamodb_ScanInput_TotalSegments_FromDafny(dafnyInput.Dtor_TotalSegments().UnwrapOr(nil)), + Segment: com_amazonaws_dynamodb_ScanInput_Segment_FromDafny(dafnyInput.Dtor_Segment().UnwrapOr(nil)), + ProjectionExpression: com_amazonaws_dynamodb_ScanInput_ProjectionExpression_FromDafny(dafnyInput.Dtor_ProjectionExpression().UnwrapOr(nil)), + FilterExpression: com_amazonaws_dynamodb_ScanInput_FilterExpression_FromDafny(dafnyInput.Dtor_FilterExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_FromDafny(dafnyInput.Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_FromDafny(dafnyInput.Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_ScanInput_ConsistentRead_FromDafny(dafnyInput.Dtor_ConsistentRead().UnwrapOr(nil)), + } + }() + +} + +func ScanOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.ScanOutput) dynamodb.ScanOutput { + + return func() dynamodb.ScanOutput { + + return dynamodb.ScanOutput{ + Items: com_amazonaws_dynamodb_ScanOutput_Items_FromDafny(dafnyOutput.Dtor_Items().UnwrapOr(nil)), + Count: com_amazonaws_dynamodb_ScanOutput_Count_FromDafny(dafnyOutput.Dtor_Count().UnwrapOr(nil)), + ScannedCount: com_amazonaws_dynamodb_ScanOutput_ScannedCount_FromDafny(dafnyOutput.Dtor_ScannedCount().UnwrapOr(nil)), + LastEvaluatedKey: com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_FromDafny(dafnyOutput.Dtor_LastEvaluatedKey().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func TagResourceInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.TagResourceInput) dynamodb.TagResourceInput { + + return func() dynamodb.TagResourceInput { + + return dynamodb.TagResourceInput{ + ResourceArn: com_amazonaws_dynamodb_TagResourceInput_ResourceArn_FromDafny(dafnyInput.Dtor_ResourceArn()), + Tags: com_amazonaws_dynamodb_TagResourceInput_Tags_FromDafny(dafnyInput.Dtor_Tags()), + } + }() + +} + +func TransactGetItemsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.TransactGetItemsInput) dynamodb.TransactGetItemsInput { + + return func() dynamodb.TransactGetItemsInput { + + return dynamodb.TransactGetItemsInput{ + TransactItems: com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_FromDafny(dafnyInput.Dtor_TransactItems()), + ReturnConsumedCapacity: com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + } + }() + +} + +func TransactGetItemsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.TransactGetItemsOutput) dynamodb.TransactGetItemsOutput { + + return func() dynamodb.TransactGetItemsOutput { + + return dynamodb.TransactGetItemsOutput{ + ConsumedCapacity: com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + Responses: com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_FromDafny(dafnyOutput.Dtor_Responses().UnwrapOr(nil)), + } + }() + +} + +func TransactWriteItemsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.TransactWriteItemsInput) dynamodb.TransactWriteItemsInput { + + return func() dynamodb.TransactWriteItemsInput { + + return dynamodb.TransactWriteItemsInput{ + TransactItems: com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_FromDafny(dafnyInput.Dtor_TransactItems()), + ReturnConsumedCapacity: com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + ReturnItemCollectionMetrics: com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_FromDafny(dafnyInput.Dtor_ReturnItemCollectionMetrics().UnwrapOr(nil)), + ClientRequestToken: com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_FromDafny(dafnyInput.Dtor_ClientRequestToken().UnwrapOr(nil)), + } + }() + +} + +func TransactWriteItemsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.TransactWriteItemsOutput) dynamodb.TransactWriteItemsOutput { + + return func() dynamodb.TransactWriteItemsOutput { + + return dynamodb.TransactWriteItemsOutput{ + ConsumedCapacity: com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + ItemCollectionMetrics: com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_FromDafny(dafnyOutput.Dtor_ItemCollectionMetrics().UnwrapOr(nil)), + } + }() + +} + +func UntagResourceInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UntagResourceInput) dynamodb.UntagResourceInput { + + return func() dynamodb.UntagResourceInput { + + return dynamodb.UntagResourceInput{ + ResourceArn: com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_FromDafny(dafnyInput.Dtor_ResourceArn()), + TagKeys: com_amazonaws_dynamodb_UntagResourceInput_TagKeys_FromDafny(dafnyInput.Dtor_TagKeys()), + } + }() + +} + +func UpdateContinuousBackupsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateContinuousBackupsInput) dynamodb.UpdateContinuousBackupsInput { + + return func() dynamodb.UpdateContinuousBackupsInput { + + return dynamodb.UpdateContinuousBackupsInput{ + TableName: com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + PointInTimeRecoverySpecification: com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_FromDafny(dafnyInput.Dtor_PointInTimeRecoverySpecification()), + } + }() + +} + +func UpdateContinuousBackupsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateContinuousBackupsOutput) dynamodb.UpdateContinuousBackupsOutput { + + return func() dynamodb.UpdateContinuousBackupsOutput { + + return dynamodb.UpdateContinuousBackupsOutput{ + ContinuousBackupsDescription: com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(dafnyOutput.Dtor_ContinuousBackupsDescription().UnwrapOr(nil)), + } + }() + +} + +func UpdateContributorInsightsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateContributorInsightsInput) dynamodb.UpdateContributorInsightsInput { + + return func() dynamodb.UpdateContributorInsightsInput { + + return dynamodb.UpdateContributorInsightsInput{ + TableName: com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + IndexName: com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_FromDafny(dafnyInput.Dtor_IndexName().UnwrapOr(nil)), + ContributorInsightsAction: com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_FromDafny(dafnyInput.Dtor_ContributorInsightsAction()), + } + }() + +} + +func UpdateContributorInsightsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateContributorInsightsOutput) dynamodb.UpdateContributorInsightsOutput { + + return func() dynamodb.UpdateContributorInsightsOutput { + + return dynamodb.UpdateContributorInsightsOutput{ + TableName: com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_FromDafny(dafnyOutput.Dtor_TableName().UnwrapOr(nil)), + IndexName: com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_FromDafny(dafnyOutput.Dtor_IndexName().UnwrapOr(nil)), + ContributorInsightsStatus: com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_FromDafny(dafnyOutput.Dtor_ContributorInsightsStatus().UnwrapOr(nil)), + } + }() + +} + +func UpdateGlobalTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateGlobalTableInput) dynamodb.UpdateGlobalTableInput { + + return func() dynamodb.UpdateGlobalTableInput { + + return dynamodb.UpdateGlobalTableInput{ + GlobalTableName: com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_FromDafny(dafnyInput.Dtor_GlobalTableName()), + ReplicaUpdates: com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_FromDafny(dafnyInput.Dtor_ReplicaUpdates()), + } + }() + +} + +func UpdateGlobalTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateGlobalTableOutput) dynamodb.UpdateGlobalTableOutput { + + return func() dynamodb.UpdateGlobalTableOutput { + + return dynamodb.UpdateGlobalTableOutput{ + GlobalTableDescription: com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_FromDafny(dafnyOutput.Dtor_GlobalTableDescription().UnwrapOr(nil)), + } + }() + +} + +func UpdateGlobalTableSettingsInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateGlobalTableSettingsInput) dynamodb.UpdateGlobalTableSettingsInput { + + return func() dynamodb.UpdateGlobalTableSettingsInput { + + return dynamodb.UpdateGlobalTableSettingsInput{ + GlobalTableName: com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_FromDafny(dafnyInput.Dtor_GlobalTableName()), + GlobalTableBillingMode: com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_FromDafny(dafnyInput.Dtor_GlobalTableBillingMode().UnwrapOr(nil)), + GlobalTableProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_FromDafny(dafnyInput.Dtor_GlobalTableProvisionedWriteCapacityUnits().UnwrapOr(nil)), + GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(dafnyInput.Dtor_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), + GlobalTableGlobalSecondaryIndexSettingsUpdate: com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_FromDafny(dafnyInput.Dtor_GlobalTableGlobalSecondaryIndexSettingsUpdate().UnwrapOr(nil)), + ReplicaSettingsUpdate: com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_FromDafny(dafnyInput.Dtor_ReplicaSettingsUpdate().UnwrapOr(nil)), + } + }() + +} + +func UpdateGlobalTableSettingsOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateGlobalTableSettingsOutput) dynamodb.UpdateGlobalTableSettingsOutput { + + return func() dynamodb.UpdateGlobalTableSettingsOutput { + + return dynamodb.UpdateGlobalTableSettingsOutput{ + GlobalTableName: com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_FromDafny(dafnyOutput.Dtor_GlobalTableName().UnwrapOr(nil)), + ReplicaSettings: com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_FromDafny(dafnyOutput.Dtor_ReplicaSettings().UnwrapOr(nil)), + } + }() + +} + +func UpdateItemInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateItemInput) dynamodb.UpdateItemInput { + + return func() dynamodb.UpdateItemInput { + + return dynamodb.UpdateItemInput{ + TableName: com_amazonaws_dynamodb_UpdateItemInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + Key: com_amazonaws_dynamodb_UpdateItemInput_Key_FromDafny(dafnyInput.Dtor_Key()), + AttributeUpdates: com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_FromDafny(dafnyInput.Dtor_AttributeUpdates().UnwrapOr(nil)), + Expected: com_amazonaws_dynamodb_UpdateItemInput_Expected_FromDafny(dafnyInput.Dtor_Expected().UnwrapOr(nil)), + ConditionalOperator: com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_FromDafny(dafnyInput.Dtor_ConditionalOperator().UnwrapOr(nil)), + ReturnValues: com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_FromDafny(dafnyInput.Dtor_ReturnValues().UnwrapOr(nil)), + ReturnConsumedCapacity: com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_FromDafny(dafnyInput.Dtor_ReturnConsumedCapacity().UnwrapOr(nil)), + ReturnItemCollectionMetrics: com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_FromDafny(dafnyInput.Dtor_ReturnItemCollectionMetrics().UnwrapOr(nil)), + UpdateExpression: com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_FromDafny(dafnyInput.Dtor_UpdateExpression().UnwrapOr(nil)), + ConditionExpression: com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_FromDafny(dafnyInput.Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_FromDafny(dafnyInput.Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_FromDafny(dafnyInput.Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + } + }() + +} + +func UpdateItemOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateItemOutput) dynamodb.UpdateItemOutput { + + return func() dynamodb.UpdateItemOutput { + + return dynamodb.UpdateItemOutput{ + Attributes: com_amazonaws_dynamodb_UpdateItemOutput_Attributes_FromDafny(dafnyOutput.Dtor_Attributes().UnwrapOr(nil)), + ConsumedCapacity: com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_FromDafny(dafnyOutput.Dtor_ConsumedCapacity().UnwrapOr(nil)), + ItemCollectionMetrics: com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_FromDafny(dafnyOutput.Dtor_ItemCollectionMetrics().UnwrapOr(nil)), + } + }() + +} + +func UpdateKinesisStreamingDestinationInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateKinesisStreamingDestinationInput) dynamodb.UpdateKinesisStreamingDestinationInput { + + return func() dynamodb.UpdateKinesisStreamingDestinationInput { + + return dynamodb.UpdateKinesisStreamingDestinationInput{ + TableName: com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + StreamArn: com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_FromDafny(dafnyInput.Dtor_StreamArn()), + UpdateKinesisStreamingConfiguration: com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_FromDafny(dafnyInput.Dtor_UpdateKinesisStreamingConfiguration().UnwrapOr(nil)), + } + }() + +} + +func UpdateKinesisStreamingDestinationOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateKinesisStreamingDestinationOutput) dynamodb.UpdateKinesisStreamingDestinationOutput { + + return func() dynamodb.UpdateKinesisStreamingDestinationOutput { + + return dynamodb.UpdateKinesisStreamingDestinationOutput{ + TableName: com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_FromDafny(dafnyOutput.Dtor_TableName().UnwrapOr(nil)), + StreamArn: com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_FromDafny(dafnyOutput.Dtor_StreamArn().UnwrapOr(nil)), + DestinationStatus: com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(dafnyOutput.Dtor_DestinationStatus().UnwrapOr(nil)), + UpdateKinesisStreamingConfiguration: com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_FromDafny(dafnyOutput.Dtor_UpdateKinesisStreamingConfiguration().UnwrapOr(nil)), + } + }() + +} + +func UpdateTableInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateTableInput) dynamodb.UpdateTableInput { + + return func() dynamodb.UpdateTableInput { + + return dynamodb.UpdateTableInput{ + AttributeDefinitions: com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_FromDafny(dafnyInput.Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_UpdateTableInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + BillingMode: com_amazonaws_dynamodb_UpdateTableInput_BillingMode_FromDafny(dafnyInput.Dtor_BillingMode().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_FromDafny(dafnyInput.Dtor_ProvisionedThroughput().UnwrapOr(nil)), + GlobalSecondaryIndexUpdates: com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_FromDafny(dafnyInput.Dtor_GlobalSecondaryIndexUpdates().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_FromDafny(dafnyInput.Dtor_StreamSpecification().UnwrapOr(nil)), + SSESpecification: com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_FromDafny(dafnyInput.Dtor_SSESpecification().UnwrapOr(nil)), + ReplicaUpdates: com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_FromDafny(dafnyInput.Dtor_ReplicaUpdates().UnwrapOr(nil)), + TableClass: com_amazonaws_dynamodb_UpdateTableInput_TableClass_FromDafny(dafnyInput.Dtor_TableClass().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_FromDafny(dafnyInput.Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_FromDafny(dafnyInput.Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() + +} + +func UpdateTableOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateTableOutput) dynamodb.UpdateTableOutput { + + return func() dynamodb.UpdateTableOutput { + + return dynamodb.UpdateTableOutput{ + TableDescription: com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_FromDafny(dafnyOutput.Dtor_TableDescription().UnwrapOr(nil)), + } + }() + +} + +func UpdateTableReplicaAutoScalingInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateTableReplicaAutoScalingInput) dynamodb.UpdateTableReplicaAutoScalingInput { + + return func() dynamodb.UpdateTableReplicaAutoScalingInput { + + return dynamodb.UpdateTableReplicaAutoScalingInput{ + GlobalSecondaryIndexUpdates: com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_FromDafny(dafnyInput.Dtor_GlobalSecondaryIndexUpdates().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + ProvisionedWriteCapacityAutoScalingUpdate: com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(dafnyInput.Dtor_ProvisionedWriteCapacityAutoScalingUpdate().UnwrapOr(nil)), + ReplicaUpdates: com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_FromDafny(dafnyInput.Dtor_ReplicaUpdates().UnwrapOr(nil)), + } + }() + +} + +func UpdateTableReplicaAutoScalingOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateTableReplicaAutoScalingOutput) dynamodb.UpdateTableReplicaAutoScalingOutput { + + return func() dynamodb.UpdateTableReplicaAutoScalingOutput { + + return dynamodb.UpdateTableReplicaAutoScalingOutput{ + TableAutoScalingDescription: com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(dafnyOutput.Dtor_TableAutoScalingDescription().UnwrapOr(nil)), + } + }() + +} + +func UpdateTimeToLiveInput_FromDafny(dafnyInput ComAmazonawsDynamodbTypes.UpdateTimeToLiveInput) dynamodb.UpdateTimeToLiveInput { + + return func() dynamodb.UpdateTimeToLiveInput { + + return dynamodb.UpdateTimeToLiveInput{ + TableName: com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_FromDafny(dafnyInput.Dtor_TableName()), + TimeToLiveSpecification: com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_FromDafny(dafnyInput.Dtor_TimeToLiveSpecification()), + } + }() + +} + +func UpdateTimeToLiveOutput_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.UpdateTimeToLiveOutput) dynamodb.UpdateTimeToLiveOutput { + + return func() dynamodb.UpdateTimeToLiveOutput { + + return dynamodb.UpdateTimeToLiveOutput{ + TimeToLiveSpecification: com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_FromDafny(dafnyOutput.Dtor_TimeToLiveSpecification().UnwrapOr(nil)), + } + }() + +} + +func BackupInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.BackupInUseException { + return func() types.BackupInUseException { + + return types.BackupInUseException{ + Message: com_amazonaws_dynamodb_BackupInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func BackupNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.BackupNotFoundException { + return func() types.BackupNotFoundException { + + return types.BackupNotFoundException{ + Message: com_amazonaws_dynamodb_BackupNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ConditionalCheckFailedException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ConditionalCheckFailedException { + return func() types.ConditionalCheckFailedException { + + return types.ConditionalCheckFailedException{ + Message: com_amazonaws_dynamodb_ConditionalCheckFailedException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + Item: com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_FromDafny(dafnyOutput.Dtor_Item().UnwrapOr(nil)), + } + }() + +} + +func ContinuousBackupsUnavailableException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ContinuousBackupsUnavailableException { + return func() types.ContinuousBackupsUnavailableException { + + return types.ContinuousBackupsUnavailableException{ + Message: com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func DuplicateItemException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.DuplicateItemException { + return func() types.DuplicateItemException { + + return types.DuplicateItemException{ + Message: com_amazonaws_dynamodb_DuplicateItemException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ExportConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ExportConflictException { + return func() types.ExportConflictException { + + return types.ExportConflictException{ + Message: com_amazonaws_dynamodb_ExportConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ExportNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ExportNotFoundException { + return func() types.ExportNotFoundException { + + return types.ExportNotFoundException{ + Message: com_amazonaws_dynamodb_ExportNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func GlobalTableAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.GlobalTableAlreadyExistsException { + return func() types.GlobalTableAlreadyExistsException { + + return types.GlobalTableAlreadyExistsException{ + Message: com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func GlobalTableNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.GlobalTableNotFoundException { + return func() types.GlobalTableNotFoundException { + + return types.GlobalTableNotFoundException{ + Message: com_amazonaws_dynamodb_GlobalTableNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func IdempotentParameterMismatchException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.IdempotentParameterMismatchException { + return func() types.IdempotentParameterMismatchException { + + return types.IdempotentParameterMismatchException{ + Message: com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), + } + }() + +} + +func ImportConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ImportConflictException { + return func() types.ImportConflictException { + + return types.ImportConflictException{ + Message: com_amazonaws_dynamodb_ImportConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ImportNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ImportNotFoundException { + return func() types.ImportNotFoundException { + + return types.ImportNotFoundException{ + Message: com_amazonaws_dynamodb_ImportNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func IndexNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.IndexNotFoundException { + return func() types.IndexNotFoundException { + + return types.IndexNotFoundException{ + Message: com_amazonaws_dynamodb_IndexNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InternalServerError_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InternalServerError { + return func() types.InternalServerError { + + return types.InternalServerError{ + Message: com_amazonaws_dynamodb_InternalServerError_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidEndpointException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidEndpointException { + return func() types.InvalidEndpointException { + + return types.InvalidEndpointException{ + Message: com_amazonaws_dynamodb_InvalidEndpointException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), + } + }() + +} + +func InvalidExportTimeException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidExportTimeException { + return func() types.InvalidExportTimeException { + + return types.InvalidExportTimeException{ + Message: com_amazonaws_dynamodb_InvalidExportTimeException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidRestoreTimeException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.InvalidRestoreTimeException { + return func() types.InvalidRestoreTimeException { + + return types.InvalidRestoreTimeException{ + Message: com_amazonaws_dynamodb_InvalidRestoreTimeException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ItemCollectionSizeLimitExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ItemCollectionSizeLimitExceededException { + return func() types.ItemCollectionSizeLimitExceededException { + + return types.ItemCollectionSizeLimitExceededException{ + Message: com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func LimitExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.LimitExceededException { + return func() types.LimitExceededException { + + return types.LimitExceededException{ + Message: com_amazonaws_dynamodb_LimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func PointInTimeRecoveryUnavailableException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.PointInTimeRecoveryUnavailableException { + return func() types.PointInTimeRecoveryUnavailableException { + + return types.PointInTimeRecoveryUnavailableException{ + Message: com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func PolicyNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.PolicyNotFoundException { + return func() types.PolicyNotFoundException { + + return types.PolicyNotFoundException{ + Message: com_amazonaws_dynamodb_PolicyNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ProvisionedThroughputExceededException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ProvisionedThroughputExceededException { + return func() types.ProvisionedThroughputExceededException { + + return types.ProvisionedThroughputExceededException{ + Message: com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ReplicaAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ReplicaAlreadyExistsException { + return func() types.ReplicaAlreadyExistsException { + + return types.ReplicaAlreadyExistsException{ + Message: com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ReplicaNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ReplicaNotFoundException { + return func() types.ReplicaNotFoundException { + + return types.ReplicaNotFoundException{ + Message: com_amazonaws_dynamodb_ReplicaNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func RequestLimitExceeded_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.RequestLimitExceeded { + return func() types.RequestLimitExceeded { + + return types.RequestLimitExceeded{ + Message: com_amazonaws_dynamodb_RequestLimitExceeded_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ResourceInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ResourceInUseException { + return func() types.ResourceInUseException { + + return types.ResourceInUseException{ + Message: com_amazonaws_dynamodb_ResourceInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ResourceNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.ResourceNotFoundException { + return func() types.ResourceNotFoundException { + + return types.ResourceNotFoundException{ + Message: com_amazonaws_dynamodb_ResourceNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func TableAlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableAlreadyExistsException { + return func() types.TableAlreadyExistsException { + + return types.TableAlreadyExistsException{ + Message: com_amazonaws_dynamodb_TableAlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func TableInUseException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableInUseException { + return func() types.TableInUseException { + + return types.TableInUseException{ + Message: com_amazonaws_dynamodb_TableInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func TableNotFoundException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TableNotFoundException { + return func() types.TableNotFoundException { + + return types.TableNotFoundException{ + Message: com_amazonaws_dynamodb_TableNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func TransactionCanceledException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TransactionCanceledException { + return func() types.TransactionCanceledException { + + return types.TransactionCanceledException{ + Message: com_amazonaws_dynamodb_TransactionCanceledException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), + CancellationReasons: com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_FromDafny(dafnyOutput.Dtor_CancellationReasons().UnwrapOr(nil)), + } + }() + +} + +func TransactionConflictException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TransactionConflictException { + return func() types.TransactionConflictException { + + return types.TransactionConflictException{ + Message: com_amazonaws_dynamodb_TransactionConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func TransactionInProgressException_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) types.TransactionInProgressException { + return func() types.TransactionInProgressException { + + return types.TransactionInProgressException{ + Message: com_amazonaws_dynamodb_TransactionInProgressException_Message_FromDafny(dafnyOutput.Dtor_Message().UnwrapOr(nil)), + } + }() + +} + +func OpaqueError_Output_FromDafny(dafnyOutput ComAmazonawsDynamodbTypes.Error) error { + responseSmithyOp, ok := dafnyOutput.Dtor_obj().(*smithy.OperationError) + if ok { + return responseSmithyOp + } + responseGenericErr, ok := dafnyOutput.Dtor_obj().(error) + if ok { + return responseGenericErr + } + panic("Invalid Error") +} + +func Error_FromDafny(err ComAmazonawsDynamodbTypes.Error) error { + // Service Errors + if err.Is_BackupInUseException() { + e := BackupInUseException_FromDafny(err) + return &e + } + + if err.Is_BackupNotFoundException() { + e := BackupNotFoundException_FromDafny(err) + return &e + } + + if err.Is_ConditionalCheckFailedException() { + e := ConditionalCheckFailedException_FromDafny(err) + return &e + } + + if err.Is_ContinuousBackupsUnavailableException() { + e := ContinuousBackupsUnavailableException_FromDafny(err) + return &e + } + + if err.Is_DuplicateItemException() { + e := DuplicateItemException_FromDafny(err) + return &e + } + + if err.Is_ExportConflictException() { + e := ExportConflictException_FromDafny(err) + return &e + } + + if err.Is_ExportNotFoundException() { + e := ExportNotFoundException_FromDafny(err) + return &e + } + + if err.Is_GlobalTableAlreadyExistsException() { + e := GlobalTableAlreadyExistsException_FromDafny(err) + return &e + } + + if err.Is_GlobalTableNotFoundException() { + e := GlobalTableNotFoundException_FromDafny(err) + return &e + } + + if err.Is_IdempotentParameterMismatchException() { + e := IdempotentParameterMismatchException_FromDafny(err) + return &e + } + + if err.Is_ImportConflictException() { + e := ImportConflictException_FromDafny(err) + return &e + } + + if err.Is_ImportNotFoundException() { + e := ImportNotFoundException_FromDafny(err) + return &e + } + + if err.Is_IndexNotFoundException() { + e := IndexNotFoundException_FromDafny(err) + return &e + } + + if err.Is_InternalServerError() { + e := InternalServerError_FromDafny(err) + return &e + } + + if err.Is_InvalidEndpointException() { + e := InvalidEndpointException_FromDafny(err) + return &e + } + + if err.Is_InvalidExportTimeException() { + e := InvalidExportTimeException_FromDafny(err) + return &e + } + + if err.Is_InvalidRestoreTimeException() { + e := InvalidRestoreTimeException_FromDafny(err) + return &e + } + + if err.Is_ItemCollectionSizeLimitExceededException() { + e := ItemCollectionSizeLimitExceededException_FromDafny(err) + return &e + } + + if err.Is_LimitExceededException() { + e := LimitExceededException_FromDafny(err) + return &e + } + + if err.Is_PointInTimeRecoveryUnavailableException() { + e := PointInTimeRecoveryUnavailableException_FromDafny(err) + return &e + } + + if err.Is_PolicyNotFoundException() { + e := PolicyNotFoundException_FromDafny(err) + return &e + } + + if err.Is_ProvisionedThroughputExceededException() { + e := ProvisionedThroughputExceededException_FromDafny(err) + return &e + } + + if err.Is_ReplicaAlreadyExistsException() { + e := ReplicaAlreadyExistsException_FromDafny(err) + return &e + } + + if err.Is_ReplicaNotFoundException() { + e := ReplicaNotFoundException_FromDafny(err) + return &e + } + + if err.Is_RequestLimitExceeded() { + e := RequestLimitExceeded_FromDafny(err) + return &e + } + + if err.Is_ResourceInUseException() { + e := ResourceInUseException_FromDafny(err) + return &e + } + + if err.Is_ResourceNotFoundException() { + e := ResourceNotFoundException_FromDafny(err) + return &e + } + + if err.Is_TableAlreadyExistsException() { + e := TableAlreadyExistsException_FromDafny(err) + return &e + } + + if err.Is_TableInUseException() { + e := TableInUseException_FromDafny(err) + return &e + } + + if err.Is_TableNotFoundException() { + e := TableNotFoundException_FromDafny(err) + return &e + } + + if err.Is_TransactionCanceledException() { + e := TransactionCanceledException_FromDafny(err) + return &e + } + + if err.Is_TransactionConflictException() { + e := TransactionConflictException_FromDafny(err) + return &e + } + + if err.Is_TransactionInProgressException() { + e := TransactionInProgressException_FromDafny(err) + return &e + } + + return OpaqueError_Output_FromDafny(err) +} + +func com_amazonaws_dynamodb_BatchExecuteStatementInput_Statements_FromDafny(input interface{}) []types.BatchStatementRequest { + return func() []types.BatchStatementRequest { + var fieldValue []types.BatchStatementRequest + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PartiQLBatchRequest_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_PartiQLBatchRequest_member_FromDafny(input interface{}) types.BatchStatementRequest { + return func() types.BatchStatementRequest { + + return types.BatchStatementRequest{ + Statement: com_amazonaws_dynamodb_BatchStatementRequest_Statement_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_Statement()), + Parameters: com_amazonaws_dynamodb_BatchStatementRequest_Parameters_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_Parameters().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementRequest).Dtor_ConsistentRead().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BatchStatementRequest_Statement_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchStatementRequest_Parameters_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_AttributeValue_S_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeValue_N_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeValue_B_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_StringSetAttributeValue_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_StringSetAttributeValue_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_NumberSetAttributeValue_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_NumberSetAttributeValue_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(input interface{}) [][]byte { + return func() [][]byte { + var fieldValue [][]byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_BinarySetAttributeValue_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_BinarySetAttributeValue_member_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeValue_M_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_MapAttributeValue_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_MapAttributeValue_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_MapAttributeValue_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_MapAttributeValue_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_AttributeValue_L_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ListAttributeValue_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ListAttributeValue_member_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_dynamodb_BatchStatementRequest_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_BatchExecuteStatementInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_Responses_FromDafny(input interface{}) []types.BatchStatementResponse { + return func() []types.BatchStatementResponse { + var fieldValue []types.BatchStatementResponse + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PartiQLBatchResponse_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_PartiQLBatchResponse_member_FromDafny(input interface{}) types.BatchStatementResponse { + return func() types.BatchStatementResponse { + + return types.BatchStatementResponse{ + Error: com_amazonaws_dynamodb_BatchStatementResponse_Error_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_Error().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_BatchStatementResponse_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_TableName().UnwrapOr(nil)), + Item: com_amazonaws_dynamodb_BatchStatementResponse_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementResponse).Dtor_Item().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BatchStatementResponse_Error_FromDafny(input interface{}) *types.BatchStatementError { + return func() *types.BatchStatementError { + if input == nil { + return nil + } + return &types.BatchStatementError{ + Code: com_amazonaws_dynamodb_BatchStatementError_Code_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementError).Dtor_Code().UnwrapOr(nil)), + Message: com_amazonaws_dynamodb_BatchStatementError_Message_FromDafny(input.(ComAmazonawsDynamodbTypes.BatchStatementError).Dtor_Message().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BatchStatementError_Code_FromDafny(input interface{}) types.BatchStatementErrorCodeEnum { + return func() types.BatchStatementErrorCodeEnum { + var u types.BatchStatementErrorCodeEnum + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BatchStatementErrorCodeEnum_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BatchStatementErrorCodeEnum).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BatchStatementError_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchStatementResponse_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchStatementResponse_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_AttributeMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeMap_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_BatchExecuteStatementOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(input interface{}) types.ConsumedCapacity { + return func() types.ConsumedCapacity { + + return types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input interface{}) *types.Capacity { + return func() *types.Capacity { + if input == nil { + return nil + } + return &types.Capacity{ + ReadCapacityUnits: com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_CapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input interface{}) map[string]types.Capacity { + return func() map[string]types.Capacity { + var m map[string]types.Capacity = make(map[string]types.Capacity) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny(input interface{}) types.Capacity { + return func() types.Capacity { + + return types.Capacity{ + ReadCapacityUnits: com_amazonaws_dynamodb_Capacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_Capacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_Capacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.Capacity).Dtor_CapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input interface{}) map[string]types.Capacity { + return func() map[string]types.Capacity { + var m map[string]types.Capacity = make(map[string]types.Capacity) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_SecondaryIndexesCapacityMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchGetItemInput_RequestItems_FromDafny(input interface{}) map[string]types.KeysAndAttributes { + return func() map[string]types.KeysAndAttributes { + var m map[string]types.KeysAndAttributes = make(map[string]types.KeysAndAttributes) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny(input interface{}) types.KeysAndAttributes { + return func() types.KeysAndAttributes { + + return types.KeysAndAttributes{ + Keys: com_amazonaws_dynamodb_KeysAndAttributes_Keys_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_Keys()), + AttributesToGet: com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_AttributesToGet().UnwrapOr(nil)), + ConsistentRead: com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ConsistentRead().UnwrapOr(nil)), + ProjectionExpression: com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ProjectionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.KeysAndAttributes).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_KeysAndAttributes_Keys_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeyList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_KeyList_member_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Key_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Key_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_KeysAndAttributes_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_KeysAndAttributes_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_KeysAndAttributes_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_KeysAndAttributes_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchGetItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BatchGetItemOutput_Responses_FromDafny(input interface{}) map[string][]map[string]types.AttributeValue { + return func() map[string][]map[string]types.AttributeValue { + var m map[string][]map[string]types.AttributeValue = make(map[string][]map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_BatchGetResponseMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetResponseMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchGetResponseMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchGetResponseMap_value_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ItemList_member_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchGetItemOutput_UnprocessedKeys_FromDafny(input interface{}) map[string]types.KeysAndAttributes { + return func() map[string]types.KeysAndAttributes { + var m map[string]types.KeysAndAttributes = make(map[string]types.KeysAndAttributes) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_BatchGetRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchGetRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchGetItemOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_BatchWriteItemInput_RequestItems_FromDafny(input interface{}) map[string][]types.WriteRequest { + return func() map[string][]types.WriteRequest { + var m map[string][]types.WriteRequest = make(map[string][]types.WriteRequest) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny(input interface{}) []types.WriteRequest { + return func() []types.WriteRequest { + var fieldValue []types.WriteRequest + + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_WriteRequests_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_WriteRequests_member_FromDafny(input interface{}) types.WriteRequest { + return func() types.WriteRequest { + + return types.WriteRequest{ + PutRequest: com_amazonaws_dynamodb_WriteRequest_PutRequest_FromDafny(input.(ComAmazonawsDynamodbTypes.WriteRequest).Dtor_PutRequest().UnwrapOr(nil)), + DeleteRequest: com_amazonaws_dynamodb_WriteRequest_DeleteRequest_FromDafny(input.(ComAmazonawsDynamodbTypes.WriteRequest).Dtor_DeleteRequest().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_WriteRequest_PutRequest_FromDafny(input interface{}) *types.PutRequest { + return func() *types.PutRequest { + if input == nil { + return nil + } + return &types.PutRequest{ + Item: com_amazonaws_dynamodb_PutRequest_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.PutRequest).Dtor_Item()), + } + }() +} +func com_amazonaws_dynamodb_PutRequest_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_WriteRequest_DeleteRequest_FromDafny(input interface{}) *types.DeleteRequest { + return func() *types.DeleteRequest { + if input == nil { + return nil + } + return &types.DeleteRequest{ + Key: com_amazonaws_dynamodb_DeleteRequest_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteRequest).Dtor_Key()), + } + }() +} +func com_amazonaws_dynamodb_DeleteRequest_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BatchWriteItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BatchWriteItemOutput_UnprocessedItems_FromDafny(input interface{}) map[string][]types.WriteRequest { + return func() map[string][]types.WriteRequest { + var m map[string][]types.WriteRequest = make(map[string][]types.WriteRequest) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_BatchWriteItemRequestMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_BatchWriteItemRequestMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_BatchWriteItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) map[string][]types.ItemCollectionMetrics { + return func() map[string][]types.ItemCollectionMetrics { + var m map[string][]types.ItemCollectionMetrics = make(map[string][]types.ItemCollectionMetrics) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny(input interface{}) []types.ItemCollectionMetrics { + return func() []types.ItemCollectionMetrics { + var fieldValue []types.ItemCollectionMetrics + + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ItemCollectionMetricsMultiple_member_FromDafny(input interface{}) types.ItemCollectionMetrics { + return func() types.ItemCollectionMetrics { + + return types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ItemCollectionKeyAttributeMap_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input interface{}) []float64 { + return func() []float64 { + var fieldValue []float64 + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ItemCollectionSizeEstimateRange_member_FromDafny(input interface{}) float64 { + return func() float64 { + var b []byte + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_BatchWriteItemOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_CreateBackupInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateBackupInput_BackupName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateBackupOutput_BackupDetails_FromDafny(input interface{}) *types.BackupDetails { + return func() *types.BackupDetails { + if input == nil { + return nil + } + return &types.BackupDetails{ + BackupArn: com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupArn()), + BackupName: com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupName()), + BackupSizeBytes: com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupSizeBytes().UnwrapOr(nil)), + BackupStatus: com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupStatus()), + BackupType: com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupType()), + BackupCreationDateTime: com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupCreationDateTime()), + BackupExpiryDateTime: com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input interface{}) types.BackupStatus { + return func() types.BackupStatus { + var u types.BackupStatus + + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BackupStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input interface{}) types.BackupType { + return func() types.BackupType { + var u types.BackupType + + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BackupType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_CreateGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateGlobalTableInput_ReplicationGroup_FromDafny(input interface{}) []types.Replica { + return func() []types.Replica { + var fieldValue []types.Replica + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaList_member_FromDafny(input interface{}) types.Replica { + return func() types.Replica { + + return types.Replica{ + RegionName: com_amazonaws_dynamodb_Replica_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.Replica).Dtor_RegionName().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Replica_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { + return func() *types.GlobalTableDescription { + if input == nil { + return nil + } + return &types.GlobalTableDescription{ + ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), + GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), + GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input interface{}) []types.ReplicaDescription { + return func() []types.ReplicaDescription { + var fieldValue []types.ReplicaDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(input interface{}) types.ReplicaDescription { + return func() types.ReplicaDescription { + + return types.ReplicaDescription{ + RegionName: com_amazonaws_dynamodb_ReplicaDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_RegionName().UnwrapOr(nil)), + ReplicaStatus: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), + ReplicaStatusDescription: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatusDescription().UnwrapOr(nil)), + ReplicaStatusPercentProgress: com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaStatusPercentProgress().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + ReplicaInaccessibleDateTime: com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaInaccessibleDateTime().UnwrapOr(nil)), + ReplicaTableClassSummary: com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaDescription).Dtor_ReplicaTableClassSummary().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { + return func() types.ReplicaStatus { + var u types.ReplicaStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusDescription_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaStatusPercentProgress_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_KMSMasterKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil + } + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { + if input == nil { + return nil + } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexDescription { + return func() []types.ReplicaGlobalSecondaryIndexDescription { + var fieldValue []types.ReplicaGlobalSecondaryIndexDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexDescription { + return func() types.ReplicaGlobalSecondaryIndexDescription { + + return types.ReplicaGlobalSecondaryIndexDescription{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexDescription).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil + } + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { + if input == nil { + return nil + } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaInaccessibleDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ReplicaDescription_ReplicaTableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { + return func() *types.TableClassSummary { + if input == nil { + return nil + } + return &types.TableClassSummary{ + TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), + LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input interface{}) types.GlobalTableStatus { + return func() types.GlobalTableStatus { + var u types.GlobalTableStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.GlobalTableStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_GlobalTableStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.GlobalTableStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateTableInput_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(input interface{}) types.AttributeDefinition { + return func() types.AttributeDefinition { + + return types.AttributeDefinition{ + AttributeName: com_amazonaws_dynamodb_AttributeDefinition_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeDefinition).Dtor_AttributeName()), + AttributeType: com_amazonaws_dynamodb_AttributeDefinition_AttributeType_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeDefinition).Dtor_AttributeType()), + } + }() +} +func com_amazonaws_dynamodb_AttributeDefinition_AttributeName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeDefinition_AttributeType_FromDafny(input interface{}) types.ScalarAttributeType { + return func() types.ScalarAttributeType { + var u types.ScalarAttributeType + + inputEnum := input.(ComAmazonawsDynamodbTypes.ScalarAttributeType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ScalarAttributeType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ScalarAttributeType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_CreateTableInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateTableInput_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_KeySchema_member_FromDafny(input interface{}) types.KeySchemaElement { + return func() types.KeySchemaElement { + + return types.KeySchemaElement{ + AttributeName: com_amazonaws_dynamodb_KeySchemaElement_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.KeySchemaElement).Dtor_AttributeName()), + KeyType: com_amazonaws_dynamodb_KeySchemaElement_KeyType_FromDafny(input.(ComAmazonawsDynamodbTypes.KeySchemaElement).Dtor_KeyType()), + } + }() +} +func com_amazonaws_dynamodb_KeySchemaElement_AttributeName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_KeySchemaElement_KeyType_FromDafny(input interface{}) types.KeyType { + return func() types.KeyType { + var u types.KeyType + + inputEnum := input.(ComAmazonawsDynamodbTypes.KeyType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_KeyType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.KeyType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_CreateTableInput_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndex { + return func() []types.LocalSecondaryIndex { + var fieldValue []types.LocalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(input interface{}) types.LocalSecondaryIndex { + return func() types.LocalSecondaryIndex { + + return types.LocalSecondaryIndex{ + IndexName: com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_IndexName()), + KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_KeySchema()), + Projection: com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndex).Dtor_Projection()), + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndex_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndex_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input interface{}) types.ProjectionType { + return func() types.ProjectionType { + var u types.ProjectionType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ProjectionType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ProjectionType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ProjectionType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_NonKeyAttributeNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_NonKeyAttributeNameList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateTableInput_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndex { + return func() []types.GlobalSecondaryIndex { + var fieldValue []types.GlobalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(input interface{}) types.GlobalSecondaryIndex { + return func() types.GlobalSecondaryIndex { + + return types.GlobalSecondaryIndex{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_IndexName()), + KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_KeySchema()), + Projection: com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_Projection()), + ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndex).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndex_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_CreateTableInput_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_CreateTableInput_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_CreateTableInput_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { + if input == nil { + return nil + } + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input interface{}) types.StreamViewType { + return func() types.StreamViewType { + var u types.StreamViewType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.StreamViewType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_StreamViewType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.StreamViewType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_CreateTableInput_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { + if input == nil { + return nil + } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input interface{}) types.SSEType { + return func() types.SSEType { + var u types.SSEType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.SSEType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.SSEType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateTableInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TagList_member_FromDafny(input interface{}) types.Tag { + return func() types.Tag { + + return types.Tag{ + Key: com_amazonaws_dynamodb_Tag_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Tag).Dtor_Key()), + Value: com_amazonaws_dynamodb_Tag_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.Tag).Dtor_Value()), + } + }() +} +func com_amazonaws_dynamodb_Tag_Key_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Tag_Value_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateTableInput_TableClass_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_CreateTableInput_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_CreateTableInput_ResourcePolicy_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateTableInput_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input interface{}) types.TableStatus { + return func() types.TableStatus { + var u types.TableStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughputDescription { + return func() *types.ProvisionedThroughputDescription { + if input == nil { + return nil + } + return &types.ProvisionedThroughputDescription{ + LastIncreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastIncreaseDateTime().UnwrapOr(nil)), + LastDecreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastDecreaseDateTime().UnwrapOr(nil)), + NumberOfDecreasesToday: com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_NumberOfDecreasesToday().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input interface{}) *types.BillingModeSummary { + return func() *types.BillingModeSummary { + if input == nil { + return nil + } + return &types.BillingModeSummary{ + BillingMode: com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_BillingMode().UnwrapOr(nil)), + LastUpdateToPayPerRequestDateTime: com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_LastUpdateToPayPerRequestDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndexDescription { + return func() []types.LocalSecondaryIndexDescription { + var fieldValue []types.LocalSecondaryIndexDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.LocalSecondaryIndexDescription { + return func() types.LocalSecondaryIndexDescription { + + return types.LocalSecondaryIndexDescription{ + IndexName: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_Projection().UnwrapOr(nil)), + IndexSizeBytes: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_ItemCount().UnwrapOr(nil)), + IndexArn: com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexDescription).Dtor_IndexArn().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil + } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexDescription_IndexArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndexDescription { + return func() []types.GlobalSecondaryIndexDescription { + var fieldValue []types.GlobalSecondaryIndexDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescriptionList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexDescription { + return func() types.GlobalSecondaryIndexDescription { + + return types.GlobalSecondaryIndexDescription{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_Projection().UnwrapOr(nil)), + IndexStatus: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexStatus().UnwrapOr(nil)), + Backfilling: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_Backfilling().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + IndexSizeBytes: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_ItemCount().UnwrapOr(nil)), + IndexArn: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_IndexArn().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil + } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { + return func() types.IndexStatus { + var u types.IndexStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_Backfilling_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughputDescription { + return func() *types.ProvisionedThroughputDescription { + if input == nil { + return nil + } + return &types.ProvisionedThroughputDescription{ + LastIncreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastIncreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastIncreaseDateTime().UnwrapOr(nil)), + LastDecreaseDateTime: com_amazonaws_dynamodb_ProvisionedThroughputDescription_LastDecreaseDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_LastDecreaseDateTime().UnwrapOr(nil)), + NumberOfDecreasesToday: com_amazonaws_dynamodb_ProvisionedThroughputDescription_NumberOfDecreasesToday_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_NumberOfDecreasesToday().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputDescription_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputDescription).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_IndexArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexDescription_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { + if input == nil { + return nil + } + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input interface{}) []types.ReplicaDescription { + return func() []types.ReplicaDescription { + var fieldValue []types.ReplicaDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input interface{}) *types.RestoreSummary { + return func() *types.RestoreSummary { + if input == nil { + return nil + } + return &types.RestoreSummary{ + SourceBackupArn: com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_SourceBackupArn().UnwrapOr(nil)), + SourceTableArn: com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_SourceTableArn().UnwrapOr(nil)), + RestoreDateTime: com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_RestoreDateTime()), + RestoreInProgress: com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_FromDafny(input.(ComAmazonawsDynamodbTypes.RestoreSummary).Dtor_RestoreInProgress()), + } + }() +} +func com_amazonaws_dynamodb_RestoreSummary_SourceBackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RestoreSummary_SourceTableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RestoreSummary_RestoreDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_RestoreSummary_RestoreInProgress_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input interface{}) *types.SSEDescription { + return func() *types.SSEDescription { + if input == nil { + return nil + } + return &types.SSEDescription{ + Status: com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_Status().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyArn: com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_KMSMasterKeyArn().UnwrapOr(nil)), + InaccessibleEncryptionDateTime: com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_InaccessibleEncryptionDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input interface{}) types.SSEStatus { + return func() types.SSEStatus { + var u types.SSEStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.SSEStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.SSEStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input interface{}) types.SSEType { + return func() types.SSEType { + var u types.SSEType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.SSEType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_SSEType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.SSEType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input interface{}) *types.ArchivalSummary { + return func() *types.ArchivalSummary { + if input == nil { + return nil + } + return &types.ArchivalSummary{ + ArchivalDateTime: com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalDateTime().UnwrapOr(nil)), + ArchivalReason: com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalReason().UnwrapOr(nil)), + ArchivalBackupArn: com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ArchivalSummary).Dtor_ArchivalBackupArn().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalReason_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ArchivalSummary_ArchivalBackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { + return func() *types.TableClassSummary { + if input == nil { + return nil + } + return &types.TableClassSummary{ + TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), + LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DeleteBackupInput_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteBackupOutput_BackupDescription_FromDafny(input interface{}) *types.BackupDescription { + return func() *types.BackupDescription { + if input == nil { + return nil + } + return &types.BackupDescription{ + BackupDetails: com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_BackupDetails().UnwrapOr(nil)), + SourceTableDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableDetails().UnwrapOr(nil)), + SourceTableFeatureDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableFeatureDetails().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input interface{}) *types.BackupDetails { + return func() *types.BackupDetails { + if input == nil { + return nil + } + return &types.BackupDetails{ + BackupArn: com_amazonaws_dynamodb_BackupDetails_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupArn()), + BackupName: com_amazonaws_dynamodb_BackupDetails_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupName()), + BackupSizeBytes: com_amazonaws_dynamodb_BackupDetails_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupSizeBytes().UnwrapOr(nil)), + BackupStatus: com_amazonaws_dynamodb_BackupDetails_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupStatus()), + BackupType: com_amazonaws_dynamodb_BackupDetails_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupType()), + BackupCreationDateTime: com_amazonaws_dynamodb_BackupDetails_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupCreationDateTime()), + BackupExpiryDateTime: com_amazonaws_dynamodb_BackupDetails_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDetails).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input interface{}) *types.SourceTableDetails { + return func() *types.SourceTableDetails { + if input == nil { + return nil + } + return &types.SourceTableDetails{ + TableName: com_amazonaws_dynamodb_SourceTableDetails_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableName()), + TableId: com_amazonaws_dynamodb_SourceTableDetails_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableId()), + TableArn: com_amazonaws_dynamodb_SourceTableDetails_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableArn().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableSizeBytes().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_SourceTableDetails_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_KeySchema()), + TableCreationDateTime: com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_TableCreationDateTime()), + ProvisionedThroughput: com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_ProvisionedThroughput()), + OnDemandThroughput: com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_OnDemandThroughput().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_SourceTableDetails_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_ItemCount().UnwrapOr(nil)), + BillingMode: com_amazonaws_dynamodb_SourceTableDetails_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableDetails).Dtor_BillingMode().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_TableId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_TableSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_TableCreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_SourceTableDetails_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input interface{}) *types.SourceTableFeatureDetails { + return func() *types.SourceTableFeatureDetails { + if input == nil { + return nil + } + return &types.SourceTableFeatureDetails{ + LocalSecondaryIndexes: com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_StreamDescription().UnwrapOr(nil)), + TimeToLiveDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_TimeToLiveDescription().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.SourceTableFeatureDetails).Dtor_SSEDescription().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableFeatureDetails_LocalSecondaryIndexes_FromDafny(input interface{}) []types.LocalSecondaryIndexInfo { + return func() []types.LocalSecondaryIndexInfo { + var fieldValue []types.LocalSecondaryIndexInfo + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexes_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexes_member_FromDafny(input interface{}) types.LocalSecondaryIndexInfo { + return func() types.LocalSecondaryIndexInfo { + + return types.LocalSecondaryIndexInfo{ + IndexName: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.LocalSecondaryIndexInfo).Dtor_Projection().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_LocalSecondaryIndexInfo_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil + } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableFeatureDetails_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndexInfo { + return func() []types.GlobalSecondaryIndexInfo { + var fieldValue []types.GlobalSecondaryIndexInfo + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexes_member_FromDafny(input interface{}) types.GlobalSecondaryIndexInfo { + return func() types.GlobalSecondaryIndexInfo { + + return types.GlobalSecondaryIndexInfo{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_IndexName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_KeySchema().UnwrapOr(nil)), + Projection: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_Projection().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexInfo).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + if input == nil { + return nil + } + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexInfo_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableFeatureDetails_StreamDescription_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { + if input == nil { + return nil + } + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_SourceTableFeatureDetails_TimeToLiveDescription_FromDafny(input interface{}) *types.TimeToLiveDescription { + return func() *types.TimeToLiveDescription { + if input == nil { + return nil + } + return &types.TimeToLiveDescription{ + TimeToLiveStatus: com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_TimeToLiveStatus().UnwrapOr(nil)), + AttributeName: com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_AttributeName().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input interface{}) types.TimeToLiveStatus { + return func() types.TimeToLiveStatus { + var u types.TimeToLiveStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TimeToLiveStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TimeToLiveStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TimeToLiveStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_SourceTableFeatureDetails_SSEDescription_FromDafny(input interface{}) *types.SSEDescription { + return func() *types.SSEDescription { + if input == nil { + return nil + } + return &types.SSEDescription{ + Status: com_amazonaws_dynamodb_SSEDescription_Status_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_Status().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSEDescription_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyArn: com_amazonaws_dynamodb_SSEDescription_KMSMasterKeyArn_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_KMSMasterKeyArn().UnwrapOr(nil)), + InaccessibleEncryptionDateTime: com_amazonaws_dynamodb_SSEDescription_InaccessibleEncryptionDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.SSEDescription).Dtor_InaccessibleEncryptionDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { + return func() map[string]types.ExpectedAttributeValue { + var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny(input interface{}) types.ExpectedAttributeValue { + return func() types.ExpectedAttributeValue { + + return types.ExpectedAttributeValue{ + Value: com_amazonaws_dynamodb_ExpectedAttributeValue_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_Value().UnwrapOr(nil)), + Exists: com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_Exists().UnwrapOr(nil)), + ComparisonOperator: com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_ComparisonOperator().UnwrapOr(nil)), + AttributeValueList: com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.ExpectedAttributeValue).Dtor_AttributeValueList().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeValue_Value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + if input == nil { + return union + } + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeValue_Exists_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeValue_ComparisonOperator_FromDafny(input interface{}) types.ComparisonOperator { + return func() types.ComparisonOperator { + var u types.ComparisonOperator + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ComparisonOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ComparisonOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExpectedAttributeValue_AttributeValueList_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { + return func() types.ReturnValue { + var u types.ReturnValue + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_DeleteItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_DeleteItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_DeleteItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DeleteItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { + return func() *types.ItemCollectionMetrics { + if input == nil { + return nil + } + return &types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteResourcePolicyInput_ExpectedRevisionId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteTableInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DeleteTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DescribeBackupInput_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeBackupOutput_BackupDescription_FromDafny(input interface{}) *types.BackupDescription { + return func() *types.BackupDescription { + if input == nil { + return nil + } + return &types.BackupDescription{ + BackupDetails: com_amazonaws_dynamodb_BackupDescription_BackupDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_BackupDetails().UnwrapOr(nil)), + SourceTableDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableDetails().UnwrapOr(nil)), + SourceTableFeatureDetails: com_amazonaws_dynamodb_BackupDescription_SourceTableFeatureDetails_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupDescription).Dtor_SourceTableFeatureDetails().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DescribeContinuousBackupsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(input interface{}) *types.ContinuousBackupsDescription { + return func() *types.ContinuousBackupsDescription { + if input == nil { + return nil + } + return &types.ContinuousBackupsDescription{ + ContinuousBackupsStatus: com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_ContinuousBackupsStatus()), + PointInTimeRecoveryDescription: com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_PointInTimeRecoveryDescription().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input interface{}) types.ContinuousBackupsStatus { + return func() types.ContinuousBackupsStatus { + var u types.ContinuousBackupsStatus + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContinuousBackupsStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContinuousBackupsStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input interface{}) *types.PointInTimeRecoveryDescription { + return func() *types.PointInTimeRecoveryDescription { + if input == nil { + return nil + } + return &types.PointInTimeRecoveryDescription{ + PointInTimeRecoveryStatus: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_PointInTimeRecoveryStatus().UnwrapOr(nil)), + EarliestRestorableDateTime: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_EarliestRestorableDateTime().UnwrapOr(nil)), + LatestRestorableDateTime: com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryDescription).Dtor_LatestRestorableDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_PointInTimeRecoveryStatus_FromDafny(input interface{}) types.PointInTimeRecoveryStatus { + return func() types.PointInTimeRecoveryStatus { + var u types.PointInTimeRecoveryStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_PointInTimeRecoveryStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.PointInTimeRecoveryStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_EarliestRestorableDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_PointInTimeRecoveryDescription_LatestRestorableDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsInput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsRuleList_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ContributorInsightsRuleList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ContributorInsightsRuleList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { + return func() types.ContributorInsightsStatus { + var u types.ContributorInsightsStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_LastUpdateDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_DescribeContributorInsightsOutput_FailureException_FromDafny(input interface{}) *types.FailureException { + return func() *types.FailureException { + if input == nil { + return nil + } + return &types.FailureException{ + ExceptionName: com_amazonaws_dynamodb_FailureException_ExceptionName_FromDafny(input.(ComAmazonawsDynamodbTypes.FailureException).Dtor_ExceptionName().UnwrapOr(nil)), + ExceptionDescription: com_amazonaws_dynamodb_FailureException_ExceptionDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.FailureException).Dtor_ExceptionDescription().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_FailureException_ExceptionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_FailureException_ExceptionDescription_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeEndpointsOutput_Endpoints_FromDafny(input interface{}) []types.Endpoint { + return func() []types.Endpoint { + var fieldValue []types.Endpoint + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_Endpoints_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_Endpoints_member_FromDafny(input interface{}) types.Endpoint { + return func() types.Endpoint { + + return types.Endpoint{ + Address: com_amazonaws_dynamodb_Endpoint_Address_FromDafny(input.(ComAmazonawsDynamodbTypes.Endpoint).Dtor_Address()), + CachePeriodInMinutes: com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_FromDafny(input.(ComAmazonawsDynamodbTypes.Endpoint).Dtor_CachePeriodInMinutes()), + } + }() +} +func com_amazonaws_dynamodb_Endpoint_Address_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Endpoint_CachePeriodInMinutes_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 + + i = input.(int64) + return i + }() +} +func com_amazonaws_dynamodb_DescribeExportInput_ExportArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeExportOutput_ExportDescription_FromDafny(input interface{}) *types.ExportDescription { + return func() *types.ExportDescription { + if input == nil { + return nil + } + return &types.ExportDescription{ + ExportArn: com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportArn().UnwrapOr(nil)), + ExportStatus: com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportStatus().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_EndTime().UnwrapOr(nil)), + ExportManifest: com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportManifest().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableId().UnwrapOr(nil)), + ExportTime: com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportTime().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Bucket().UnwrapOr(nil)), + S3BucketOwner: com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Prefix: com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Prefix().UnwrapOr(nil)), + S3SseAlgorithm: com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseAlgorithm().UnwrapOr(nil)), + S3SseKmsKeyId: com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseKmsKeyId().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureMessage().UnwrapOr(nil)), + ExportFormat: com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportFormat().UnwrapOr(nil)), + BilledSizeBytes: com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_BilledSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ItemCount().UnwrapOr(nil)), + ExportType: com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportType().UnwrapOr(nil)), + IncrementalExportSpecification: com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_IncrementalExportSpecification().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input interface{}) types.ExportStatus { + return func() types.ExportStatus { + var u types.ExportStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input interface{}) types.S3SseAlgorithm { + return func() types.S3SseAlgorithm { + var u types.S3SseAlgorithm + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.S3SseAlgorithm) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input interface{}) types.ExportFormat { + return func() types.ExportFormat { + var u types.ExportFormat + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportFormat).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input interface{}) types.ExportType { + return func() types.ExportType { + var u types.ExportType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input interface{}) *types.IncrementalExportSpecification { + return func() *types.IncrementalExportSpecification { + if input == nil { + return nil + } + return &types.IncrementalExportSpecification{ + ExportFromTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportFromTime().UnwrapOr(nil)), + ExportToTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportToTime().UnwrapOr(nil)), + ExportViewType: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportViewType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input interface{}) types.ExportViewType { + return func() types.ExportViewType { + var u types.ExportViewType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportViewType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportViewType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportViewType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DescribeGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { + return func() *types.GlobalTableDescription { + if input == nil { + return nil + } + return &types.GlobalTableDescription{ + ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), + GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), + GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput_ReplicaSettings_FromDafny(input interface{}) []types.ReplicaSettingsDescription { + return func() []types.ReplicaSettingsDescription { + var fieldValue []types.ReplicaSettingsDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(input interface{}) types.ReplicaSettingsDescription { + return func() types.ReplicaSettingsDescription { + + return types.ReplicaSettingsDescription{ + RegionName: com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_RegionName()), + ReplicaStatus: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), + ReplicaBillingModeSummary: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaBillingModeSummary().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedReadCapacityUnits().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedWriteCapacityUnits().UnwrapOr(nil)), + ReplicaProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaGlobalSecondaryIndexSettings: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaGlobalSecondaryIndexSettings().UnwrapOr(nil)), + ReplicaTableClassSummary: com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsDescription).Dtor_ReplicaTableClassSummary().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { + return func() types.ReplicaStatus { + var u types.ReplicaStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaBillingModeSummary_FromDafny(input interface{}) *types.BillingModeSummary { + return func() *types.BillingModeSummary { + if input == nil { + return nil + } + return &types.BillingModeSummary{ + BillingMode: com_amazonaws_dynamodb_BillingModeSummary_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_BillingMode().UnwrapOr(nil)), + LastUpdateToPayPerRequestDateTime: com_amazonaws_dynamodb_BillingModeSummary_LastUpdateToPayPerRequestDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BillingModeSummary).Dtor_LastUpdateToPayPerRequestDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input interface{}) []types.AutoScalingPolicyDescription { + return func() []types.AutoScalingPolicyDescription { + var fieldValue []types.AutoScalingPolicyDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyDescriptionList_member_FromDafny(input interface{}) types.AutoScalingPolicyDescription { + return func() types.AutoScalingPolicyDescription { + + return types.AutoScalingPolicyDescription{ + PolicyName: com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription).Dtor_PolicyName().UnwrapOr(nil)), + TargetTrackingScalingPolicyConfiguration: com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyDescription).Dtor_TargetTrackingScalingPolicyConfiguration().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_PolicyName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyDescription_TargetTrackingScalingPolicyConfiguration_FromDafny(input interface{}) *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription { + return func() *types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription { + if input == nil { + return nil + } + return &types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription{ + DisableScaleIn: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_DisableScaleIn().UnwrapOr(nil)), + ScaleInCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_ScaleInCooldown().UnwrapOr(nil)), + ScaleOutCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_ScaleOutCooldown().UnwrapOr(nil)), + TargetValue: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationDescription).Dtor_TargetValue()), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_DisableScaleIn_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleInCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_ScaleOutCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription_TargetValue_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaGlobalSecondaryIndexSettings_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexSettingsDescription { + return func() []types.ReplicaGlobalSecondaryIndexSettingsDescription { + var fieldValue []types.ReplicaGlobalSecondaryIndexSettingsDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexSettingsDescription { + return func() types.ReplicaGlobalSecondaryIndexSettingsDescription { + + return types.ReplicaGlobalSecondaryIndexSettingsDescription{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_IndexName()), + IndexStatus: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_IndexStatus().UnwrapOr(nil)), + ProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedReadCapacityUnits().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedWriteCapacityUnits().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsDescription).Dtor_ProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { + return func() types.IndexStatus { + var u types.IndexStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsDescription_ReplicaTableClassSummary_FromDafny(input interface{}) *types.TableClassSummary { + return func() *types.TableClassSummary { + if input == nil { + return nil + } + return &types.TableClassSummary{ + TableClass: com_amazonaws_dynamodb_TableClassSummary_TableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_TableClass().UnwrapOr(nil)), + LastUpdateDateTime: com_amazonaws_dynamodb_TableClassSummary_LastUpdateDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableClassSummary).Dtor_LastUpdateDateTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DescribeImportInput_ImportArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeImportOutput_ImportTableDescription_FromDafny(input interface{}) *types.ImportTableDescription { + return func() *types.ImportTableDescription { + + return &types.ImportTableDescription{ + ImportArn: com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportArn().UnwrapOr(nil)), + ImportStatus: com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportStatus().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableId().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3BucketSource: com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_S3BucketSource().UnwrapOr(nil)), + ErrorCount: com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ErrorCount().UnwrapOr(nil)), + CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), + InputFormat: com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormat().UnwrapOr(nil)), + InputFormatOptions: com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormatOptions().UnwrapOr(nil)), + InputCompressionType: com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputCompressionType().UnwrapOr(nil)), + TableCreationParameters: com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableCreationParameters().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_EndTime().UnwrapOr(nil)), + ProcessedSizeBytes: com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedSizeBytes().UnwrapOr(nil)), + ProcessedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedItemCount().UnwrapOr(nil)), + ImportedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportedItemCount().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureMessage().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input interface{}) types.ImportStatus { + return func() types.ImportStatus { + var u types.ImportStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ImportStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ImportStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { + return func() *types.S3BucketSource { + if input == nil { + return nil + } + return &types.S3BucketSource{ + S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), + S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 + if input == nil { + return i + } + i = input.(int64) + return i + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input interface{}) types.InputFormat { + return func() types.InputFormat { + var u types.InputFormat + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input interface{}) *types.InputFormatOptions { + return func() *types.InputFormatOptions { + if input == nil { + return nil + } + return &types.InputFormatOptions{ + Csv: com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input.(ComAmazonawsDynamodbTypes.InputFormatOptions).Dtor_Csv().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input interface{}) *types.CsvOptions { + return func() *types.CsvOptions { + if input == nil { + return nil + } + return &types.CsvOptions{ + Delimiter: com_amazonaws_dynamodb_CsvOptions_Delimiter_FromDafny(input.(ComAmazonawsDynamodbTypes.CsvOptions).Dtor_Delimiter().UnwrapOr(nil)), + HeaderList: com_amazonaws_dynamodb_CsvOptions_HeaderList_FromDafny(input.(ComAmazonawsDynamodbTypes.CsvOptions).Dtor_HeaderList().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CsvOptions_Delimiter_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CsvOptions_HeaderList_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_CsvHeaderList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_CsvHeaderList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input interface{}) types.InputCompressionType { + return func() types.InputCompressionType { + var u types.InputCompressionType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputCompressionType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputCompressionType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input interface{}) *types.TableCreationParameters { + return func() *types.TableCreationParameters { + if input == nil { + return nil + } + return &types.TableCreationParameters{ + TableName: com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_TableName()), + AttributeDefinitions: com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_AttributeDefinitions()), + KeySchema: com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_KeySchema()), + BillingMode: com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_BillingMode().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_OnDemandThroughput().UnwrapOr(nil)), + SSESpecification: com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_SSESpecification().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { + if input == nil { + return nil + } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.GlobalSecondaryIndex { + return func() []types.GlobalSecondaryIndex { + var fieldValue []types.GlobalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 + if input == nil { + return i + } + i = input.(int64) + return i + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input interface{}) int64 { + return func() int64 { + var i int64 + if input == nil { + return i + } + i = input.(int64) + return i + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput_KinesisDataStreamDestinations_FromDafny(input interface{}) []types.KinesisDataStreamDestination { + return func() []types.KinesisDataStreamDestination { + var fieldValue []types.KinesisDataStreamDestination + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_KinesisDataStreamDestinations_member_FromDafny(input interface{}) types.KinesisDataStreamDestination { + return func() types.KinesisDataStreamDestination { + + return types.KinesisDataStreamDestination{ + StreamArn: com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_StreamArn().UnwrapOr(nil)), + DestinationStatus: com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_DestinationStatus().UnwrapOr(nil)), + DestinationStatusDescription: com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_DestinationStatusDescription().UnwrapOr(nil)), + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.KinesisDataStreamDestination).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_KinesisDataStreamDestination_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_KinesisDataStreamDestination_DestinationStatusDescription_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_KinesisDataStreamDestination_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { + return func() types.ApproximateCreationDateTimePrecision { + var u types.ApproximateCreationDateTimePrecision + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_DescribeLimitsOutput_AccountMaxWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_DescribeLimitsOutput_TableMaxWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_DescribeTableInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeTableOutput_Table_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(input interface{}) *types.TableAutoScalingDescription { + return func() *types.TableAutoScalingDescription { + if input == nil { + return nil + } + return &types.TableAutoScalingDescription{ + TableName: com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableName().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableStatus().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_Replicas().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input interface{}) types.TableStatus { + return func() types.TableStatus { + var u types.TableStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input interface{}) []types.ReplicaAutoScalingDescription { + return func() []types.ReplicaAutoScalingDescription { + var fieldValue []types.ReplicaAutoScalingDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescriptionList_member_FromDafny(input interface{}) types.ReplicaAutoScalingDescription { + return func() types.ReplicaAutoScalingDescription { + + return types.ReplicaAutoScalingDescription{ + RegionName: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_RegionName().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), + ReplicaStatus: com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingDescription).Dtor_ReplicaStatus().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + return func() []types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + var fieldValue []types.ReplicaGlobalSecondaryIndexAutoScalingDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescriptionList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + return func() types.ReplicaGlobalSecondaryIndexAutoScalingDescription { + + return types.ReplicaGlobalSecondaryIndexAutoScalingDescription{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_IndexName().UnwrapOr(nil)), + IndexStatus: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_IndexStatus().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_ProvisionedReadCapacityAutoScalingSettings().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingSettings: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingDescription).Dtor_ProvisionedWriteCapacityAutoScalingSettings().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_IndexStatus_FromDafny(input interface{}) types.IndexStatus { + return func() types.IndexStatus { + var u types.IndexStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.IndexStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_IndexStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.IndexStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription_ProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedReadCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaProvisionedWriteCapacityAutoScalingSettings_FromDafny(input interface{}) *types.AutoScalingSettingsDescription { + return func() *types.AutoScalingSettingsDescription { + if input == nil { + return nil + } + return &types.AutoScalingSettingsDescription{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsDescription_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsDescription_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicies: com_amazonaws_dynamodb_AutoScalingSettingsDescription_ScalingPolicies_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsDescription).Dtor_ScalingPolicies().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingDescription_ReplicaStatus_FromDafny(input interface{}) types.ReplicaStatus { + return func() types.ReplicaStatus { + var u types.ReplicaStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReplicaStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReplicaStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReplicaStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DescribeTimeToLiveInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DescribeTimeToLiveOutput_TimeToLiveDescription_FromDafny(input interface{}) *types.TimeToLiveDescription { + return func() *types.TimeToLiveDescription { + if input == nil { + return nil + } + return &types.TimeToLiveDescription{ + TimeToLiveStatus: com_amazonaws_dynamodb_TimeToLiveDescription_TimeToLiveStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_TimeToLiveStatus().UnwrapOr(nil)), + AttributeName: com_amazonaws_dynamodb_TimeToLiveDescription_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveDescription).Dtor_AttributeName().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { + return func() *types.EnableKinesisStreamingConfiguration { + if input == nil { + return nil + } + return &types.EnableKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { + return func() types.ApproximateCreationDateTimePrecision { + var u types.ApproximateCreationDateTimePrecision + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { + return func() *types.EnableKinesisStreamingConfiguration { + if input == nil { + return nil + } + return &types.EnableKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { + return func() *types.EnableKinesisStreamingConfiguration { + if input == nil { + return nil + } + return &types.EnableKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingConfiguration_FromDafny(input interface{}) *types.EnableKinesisStreamingConfiguration { + return func() *types.EnableKinesisStreamingConfiguration { + if input == nil { + return nil + } + return &types.EnableKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_EnableKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.EnableKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ExecuteStatementInput_Statement_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExecuteStatementInput_Parameters_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ExecuteStatementInput_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_ExecuteStatementInput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExecuteStatementInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExecuteStatementInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ExecuteStatementOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ExecuteStatementOutput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExecuteStatementOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ExecuteStatementOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ExecuteTransactionInput_TransactStatements_FromDafny(input interface{}) []types.ParameterizedStatement { + return func() []types.ParameterizedStatement { + var fieldValue []types.ParameterizedStatement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ParameterizedStatements_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ParameterizedStatements_member_FromDafny(input interface{}) types.ParameterizedStatement { + return func() types.ParameterizedStatement { + + return types.ParameterizedStatement{ + Statement: com_amazonaws_dynamodb_ParameterizedStatement_Statement_FromDafny(input.(ComAmazonawsDynamodbTypes.ParameterizedStatement).Dtor_Statement()), + Parameters: com_amazonaws_dynamodb_ParameterizedStatement_Parameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ParameterizedStatement).Dtor_Parameters().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ParameterizedStatement_Statement_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ParameterizedStatement_Parameters_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_PreparedStatementParameters_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ExecuteTransactionInput_ClientRequestToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExecuteTransactionInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExecuteTransactionOutput_Responses_FromDafny(input interface{}) []types.ItemResponse { + return func() []types.ItemResponse { + var fieldValue []types.ItemResponse + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(input interface{}) types.ItemResponse { + return func() types.ItemResponse { + + return types.ItemResponse{ + Item: com_amazonaws_dynamodb_ItemResponse_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemResponse).Dtor_Item().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ItemResponse_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ExecuteTransactionOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ClientToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Bucket_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3BucketOwner_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3Prefix_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseAlgorithm_FromDafny(input interface{}) types.S3SseAlgorithm { + return func() types.S3SseAlgorithm { + var u types.S3SseAlgorithm + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.S3SseAlgorithm) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_S3SseAlgorithm_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.S3SseAlgorithm).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_S3SseKmsKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportFormat_FromDafny(input interface{}) types.ExportFormat { + return func() types.ExportFormat { + var u types.ExportFormat + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportFormat).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_ExportType_FromDafny(input interface{}) types.ExportType { + return func() types.ExportType { + var u types.ExportType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeInput_IncrementalExportSpecification_FromDafny(input interface{}) *types.IncrementalExportSpecification { + return func() *types.IncrementalExportSpecification { + if input == nil { + return nil + } + return &types.IncrementalExportSpecification{ + ExportFromTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportFromTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportFromTime().UnwrapOr(nil)), + ExportToTime: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportToTime_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportToTime().UnwrapOr(nil)), + ExportViewType: com_amazonaws_dynamodb_IncrementalExportSpecification_ExportViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.IncrementalExportSpecification).Dtor_ExportViewType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ExportTableToPointInTimeOutput_ExportDescription_FromDafny(input interface{}) *types.ExportDescription { + return func() *types.ExportDescription { + if input == nil { + return nil + } + return &types.ExportDescription{ + ExportArn: com_amazonaws_dynamodb_ExportDescription_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportArn().UnwrapOr(nil)), + ExportStatus: com_amazonaws_dynamodb_ExportDescription_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportStatus().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ExportDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ExportDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_EndTime().UnwrapOr(nil)), + ExportManifest: com_amazonaws_dynamodb_ExportDescription_ExportManifest_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportManifest().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ExportDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ExportDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_TableId().UnwrapOr(nil)), + ExportTime: com_amazonaws_dynamodb_ExportDescription_ExportTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportTime().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ExportDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_ExportDescription_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Bucket().UnwrapOr(nil)), + S3BucketOwner: com_amazonaws_dynamodb_ExportDescription_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Prefix: com_amazonaws_dynamodb_ExportDescription_S3Prefix_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3Prefix().UnwrapOr(nil)), + S3SseAlgorithm: com_amazonaws_dynamodb_ExportDescription_S3SseAlgorithm_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseAlgorithm().UnwrapOr(nil)), + S3SseKmsKeyId: com_amazonaws_dynamodb_ExportDescription_S3SseKmsKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_S3SseKmsKeyId().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ExportDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ExportDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_FailureMessage().UnwrapOr(nil)), + ExportFormat: com_amazonaws_dynamodb_ExportDescription_ExportFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportFormat().UnwrapOr(nil)), + BilledSizeBytes: com_amazonaws_dynamodb_ExportDescription_BilledSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_BilledSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_ExportDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ItemCount().UnwrapOr(nil)), + ExportType: com_amazonaws_dynamodb_ExportDescription_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_ExportType().UnwrapOr(nil)), + IncrementalExportSpecification: com_amazonaws_dynamodb_ExportDescription_IncrementalExportSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportDescription).Dtor_IncrementalExportSpecification().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GetItemInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GetItemInput_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_GetItemInput_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GetItemInput_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_GetItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_GetItemInput_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GetItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_GetItemOutput_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_GetItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GetResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GetResourcePolicyOutput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GetResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableInput_ClientToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportTableInput_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { + return func() *types.S3BucketSource { + + return &types.S3BucketSource{ + S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), + S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportTableInput_InputFormat_FromDafny(input interface{}) types.InputFormat { + return func() types.InputFormat { + var u types.InputFormat + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportTableInput_InputFormatOptions_FromDafny(input interface{}) *types.InputFormatOptions { + return func() *types.InputFormatOptions { + if input == nil { + return nil + } + return &types.InputFormatOptions{ + Csv: com_amazonaws_dynamodb_InputFormatOptions_Csv_FromDafny(input.(ComAmazonawsDynamodbTypes.InputFormatOptions).Dtor_Csv().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportTableInput_InputCompressionType_FromDafny(input interface{}) types.InputCompressionType { + return func() types.InputCompressionType { + var u types.InputCompressionType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputCompressionType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputCompressionType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputCompressionType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportTableInput_TableCreationParameters_FromDafny(input interface{}) *types.TableCreationParameters { + return func() *types.TableCreationParameters { + + return &types.TableCreationParameters{ + TableName: com_amazonaws_dynamodb_TableCreationParameters_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_TableName()), + AttributeDefinitions: com_amazonaws_dynamodb_TableCreationParameters_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_AttributeDefinitions()), + KeySchema: com_amazonaws_dynamodb_TableCreationParameters_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_KeySchema()), + BillingMode: com_amazonaws_dynamodb_TableCreationParameters_BillingMode_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_BillingMode().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableCreationParameters_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableCreationParameters_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_OnDemandThroughput().UnwrapOr(nil)), + SSESpecification: com_amazonaws_dynamodb_TableCreationParameters_SSESpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_SSESpecification().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableCreationParameters_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableCreationParameters).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportTableOutput_ImportTableDescription_FromDafny(input interface{}) *types.ImportTableDescription { + return func() *types.ImportTableDescription { + + return &types.ImportTableDescription{ + ImportArn: com_amazonaws_dynamodb_ImportTableDescription_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportArn().UnwrapOr(nil)), + ImportStatus: com_amazonaws_dynamodb_ImportTableDescription_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportStatus().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ImportTableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_ImportTableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableId().UnwrapOr(nil)), + ClientToken: com_amazonaws_dynamodb_ImportTableDescription_ClientToken_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ClientToken().UnwrapOr(nil)), + S3BucketSource: com_amazonaws_dynamodb_ImportTableDescription_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_S3BucketSource().UnwrapOr(nil)), + ErrorCount: com_amazonaws_dynamodb_ImportTableDescription_ErrorCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ErrorCount().UnwrapOr(nil)), + CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportTableDescription_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), + InputFormat: com_amazonaws_dynamodb_ImportTableDescription_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormat().UnwrapOr(nil)), + InputFormatOptions: com_amazonaws_dynamodb_ImportTableDescription_InputFormatOptions_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputFormatOptions().UnwrapOr(nil)), + InputCompressionType: com_amazonaws_dynamodb_ImportTableDescription_InputCompressionType_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_InputCompressionType().UnwrapOr(nil)), + TableCreationParameters: com_amazonaws_dynamodb_ImportTableDescription_TableCreationParameters_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_TableCreationParameters().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ImportTableDescription_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ImportTableDescription_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_EndTime().UnwrapOr(nil)), + ProcessedSizeBytes: com_amazonaws_dynamodb_ImportTableDescription_ProcessedSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedSizeBytes().UnwrapOr(nil)), + ProcessedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ProcessedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ProcessedItemCount().UnwrapOr(nil)), + ImportedItemCount: com_amazonaws_dynamodb_ImportTableDescription_ImportedItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_ImportedItemCount().UnwrapOr(nil)), + FailureCode: com_amazonaws_dynamodb_ImportTableDescription_FailureCode_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureCode().UnwrapOr(nil)), + FailureMessage: com_amazonaws_dynamodb_ImportTableDescription_FailureMessage_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportTableDescription).Dtor_FailureMessage().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeLowerBound_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_TimeRangeUpperBound_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_ExclusiveStartBackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListBackupsInput_BackupType_FromDafny(input interface{}) types.BackupTypeFilter { + return func() types.BackupTypeFilter { + var u types.BackupTypeFilter + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupTypeFilter) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupTypeFilter_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BackupTypeFilter).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ListBackupsOutput_BackupSummaries_FromDafny(input interface{}) []types.BackupSummary { + return func() []types.BackupSummary { + var fieldValue []types.BackupSummary + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_BackupSummaries_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_BackupSummaries_member_FromDafny(input interface{}) types.BackupSummary { + return func() types.BackupSummary { + + return types.BackupSummary{ + TableName: com_amazonaws_dynamodb_BackupSummary_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableName().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_BackupSummary_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableId().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_BackupSummary_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_TableArn().UnwrapOr(nil)), + BackupArn: com_amazonaws_dynamodb_BackupSummary_BackupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupArn().UnwrapOr(nil)), + BackupName: com_amazonaws_dynamodb_BackupSummary_BackupName_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupName().UnwrapOr(nil)), + BackupCreationDateTime: com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupCreationDateTime().UnwrapOr(nil)), + BackupExpiryDateTime: com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupExpiryDateTime().UnwrapOr(nil)), + BackupStatus: com_amazonaws_dynamodb_BackupSummary_BackupStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupStatus().UnwrapOr(nil)), + BackupType: com_amazonaws_dynamodb_BackupSummary_BackupType_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupType().UnwrapOr(nil)), + BackupSizeBytes: com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.BackupSummary).Dtor_BackupSizeBytes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_TableId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupCreationDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupExpiryDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupStatus_FromDafny(input interface{}) types.BackupStatus { + return func() types.BackupStatus { + var u types.BackupStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BackupStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupType_FromDafny(input interface{}) types.BackupType { + return func() types.BackupType { + var u types.BackupType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BackupType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BackupType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BackupType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_BackupSummary_BackupSizeBytes_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ListBackupsOutput_LastEvaluatedBackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListContributorInsightsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListContributorInsightsInput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListContributorInsightsInput_MaxResults_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_ListContributorInsightsOutput_ContributorInsightsSummaries_FromDafny(input interface{}) []types.ContributorInsightsSummary { + return func() []types.ContributorInsightsSummary { + var fieldValue []types.ContributorInsightsSummary + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ContributorInsightsSummaries_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ContributorInsightsSummaries_member_FromDafny(input interface{}) types.ContributorInsightsSummary { + return func() types.ContributorInsightsSummary { + + return types.ContributorInsightsSummary{ + TableName: com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_TableName().UnwrapOr(nil)), + IndexName: com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_IndexName().UnwrapOr(nil)), + ContributorInsightsStatus: com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContributorInsightsSummary).Dtor_ContributorInsightsStatus().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ContributorInsightsSummary_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ContributorInsightsSummary_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ContributorInsightsSummary_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { + return func() types.ContributorInsightsStatus { + var u types.ContributorInsightsStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ListContributorInsightsOutput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListExportsInput_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListExportsInput_MaxResults_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ListExportsInput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListExportsOutput_ExportSummaries_FromDafny(input interface{}) []types.ExportSummary { + return func() []types.ExportSummary { + var fieldValue []types.ExportSummary + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ExportSummaries_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ExportSummaries_member_FromDafny(input interface{}) types.ExportSummary { + return func() types.ExportSummary { + + return types.ExportSummary{ + ExportArn: com_amazonaws_dynamodb_ExportSummary_ExportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportArn().UnwrapOr(nil)), + ExportStatus: com_amazonaws_dynamodb_ExportSummary_ExportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportStatus().UnwrapOr(nil)), + ExportType: com_amazonaws_dynamodb_ExportSummary_ExportType_FromDafny(input.(ComAmazonawsDynamodbTypes.ExportSummary).Dtor_ExportType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ExportSummary_ExportArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportSummary_ExportStatus_FromDafny(input interface{}) types.ExportStatus { + return func() types.ExportStatus { + var u types.ExportStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ExportSummary_ExportType_FromDafny(input interface{}) types.ExportType { + return func() types.ExportType { + var u types.ExportType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ExportType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ExportType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ExportType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ListExportsOutput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListGlobalTablesInput_ExclusiveStartGlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListGlobalTablesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ListGlobalTablesInput_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListGlobalTablesOutput_GlobalTables_FromDafny(input interface{}) []types.GlobalTable { + return func() []types.GlobalTable { + var fieldValue []types.GlobalTable + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalTableList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalTableList_member_FromDafny(input interface{}) types.GlobalTable { + return func() types.GlobalTable { + + return types.GlobalTable{ + GlobalTableName: com_amazonaws_dynamodb_GlobalTable_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTable).Dtor_GlobalTableName().UnwrapOr(nil)), + ReplicationGroup: com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTable).Dtor_ReplicationGroup().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalTable_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalTable_ReplicationGroup_FromDafny(input interface{}) []types.Replica { + return func() []types.Replica { + var fieldValue []types.Replica + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ListGlobalTablesOutput_LastEvaluatedGlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListImportsInput_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListImportsInput_PageSize_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ListImportsInput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListImportsOutput_ImportSummaryList_FromDafny(input interface{}) []types.ImportSummary { + return func() []types.ImportSummary { + var fieldValue []types.ImportSummary + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ImportSummaryList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ImportSummaryList_member_FromDafny(input interface{}) types.ImportSummary { + return func() types.ImportSummary { + + return types.ImportSummary{ + ImportArn: com_amazonaws_dynamodb_ImportSummary_ImportArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_ImportArn().UnwrapOr(nil)), + ImportStatus: com_amazonaws_dynamodb_ImportSummary_ImportStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_ImportStatus().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_ImportSummary_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_TableArn().UnwrapOr(nil)), + S3BucketSource: com_amazonaws_dynamodb_ImportSummary_S3BucketSource_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_S3BucketSource().UnwrapOr(nil)), + CloudWatchLogGroupArn: com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_CloudWatchLogGroupArn().UnwrapOr(nil)), + InputFormat: com_amazonaws_dynamodb_ImportSummary_InputFormat_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_InputFormat().UnwrapOr(nil)), + StartTime: com_amazonaws_dynamodb_ImportSummary_StartTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_StartTime().UnwrapOr(nil)), + EndTime: com_amazonaws_dynamodb_ImportSummary_EndTime_FromDafny(input.(ComAmazonawsDynamodbTypes.ImportSummary).Dtor_EndTime().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportSummary_ImportArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportSummary_ImportStatus_FromDafny(input interface{}) types.ImportStatus { + return func() types.ImportStatus { + var u types.ImportStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ImportStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ImportStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ImportStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportSummary_TableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportSummary_S3BucketSource_FromDafny(input interface{}) *types.S3BucketSource { + return func() *types.S3BucketSource { + if input == nil { + return nil + } + return &types.S3BucketSource{ + S3BucketOwner: com_amazonaws_dynamodb_S3BucketSource_S3BucketOwner_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3BucketOwner().UnwrapOr(nil)), + S3Bucket: com_amazonaws_dynamodb_S3BucketSource_S3Bucket_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3Bucket()), + S3KeyPrefix: com_amazonaws_dynamodb_S3BucketSource_S3KeyPrefix_FromDafny(input.(ComAmazonawsDynamodbTypes.S3BucketSource).Dtor_S3KeyPrefix().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ImportSummary_CloudWatchLogGroupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportSummary_InputFormat_FromDafny(input interface{}) types.InputFormat { + return func() types.InputFormat { + var u types.InputFormat + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.InputFormat) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_InputFormat_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.InputFormat).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ImportSummary_StartTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ImportSummary_EndTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_ListImportsOutput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListTablesInput_ExclusiveStartTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListTablesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ListTablesOutput_TableNames_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TableNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TableNameList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListTablesOutput_LastEvaluatedTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListTagsOfResourceInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListTagsOfResourceInput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ListTagsOfResourceOutput_NextToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutItemInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutItemInput_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { + return func() map[string]types.ExpectedAttributeValue { + var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { + return func() types.ReturnValue { + var u types.ReturnValue + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_PutItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_PutItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_PutItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_PutItemInput_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_PutItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_PutItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { + return func() *types.ItemCollectionMetrics { + if input == nil { + return nil + } + return &types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_PutResourcePolicyInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutResourcePolicyInput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutResourcePolicyInput_ExpectedRevisionId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PutResourcePolicyInput_ConfirmRemoveSelfResourceAccess_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_dynamodb_PutResourcePolicyOutput_RevisionId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_QueryInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_QueryInput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_QueryInput_Select_FromDafny(input interface{}) types.Select { + return func() types.Select { + var u types.Select + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.Select) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.Select).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_QueryInput_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_QueryInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_QueryInput_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_QueryInput_KeyConditions_FromDafny(input interface{}) map[string]types.Condition { + return func() map[string]types.Condition { + var m map[string]types.Condition = make(map[string]types.Condition) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_KeyConditions_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_KeyConditions_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_KeyConditions_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_KeyConditions_value_FromDafny(input interface{}) types.Condition { + return func() types.Condition { + + return types.Condition{ + AttributeValueList: com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_AttributeValueList().UnwrapOr(nil)), + ComparisonOperator: com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_ComparisonOperator()), + } + }() +} +func com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input interface{}) []types.AttributeValue { + return func() []types.AttributeValue { + var fieldValue []types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeValueList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input interface{}) types.ComparisonOperator { + return func() types.ComparisonOperator { + var u types.ComparisonOperator + + inputEnum := input.(ComAmazonawsDynamodbTypes.ComparisonOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ComparisonOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ComparisonOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_QueryInput_QueryFilter_FromDafny(input interface{}) map[string]types.Condition { + return func() map[string]types.Condition { + var m map[string]types.Condition = make(map[string]types.Condition) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_FilterConditionMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_FilterConditionMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_FilterConditionMap_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_FilterConditionMap_value_FromDafny(input interface{}) types.Condition { + return func() types.Condition { + + return types.Condition{ + AttributeValueList: com_amazonaws_dynamodb_Condition_AttributeValueList_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_AttributeValueList().UnwrapOr(nil)), + ComparisonOperator: com_amazonaws_dynamodb_Condition_ComparisonOperator_FromDafny(input.(ComAmazonawsDynamodbTypes.Condition).Dtor_ComparisonOperator()), + } + }() +} +func com_amazonaws_dynamodb_QueryInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_QueryInput_ScanIndexForward_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_QueryInput_ExclusiveStartKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_QueryInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_QueryInput_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_QueryInput_FilterExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_QueryInput_KeyConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_QueryInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_QueryOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_QueryOutput_Count_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_QueryOutput_ScannedCount_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_QueryOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_QueryOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_TargetTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BackupArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_BillingModeOverride_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_GlobalSecondaryIndexOverride_FromDafny(input interface{}) []types.GlobalSecondaryIndex { + return func() []types.GlobalSecondaryIndex { + var fieldValue []types.GlobalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_LocalSecondaryIndexOverride_FromDafny(input interface{}) []types.LocalSecondaryIndex { + return func() []types.LocalSecondaryIndex { + var fieldValue []types.LocalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupInput_SSESpecificationOverride_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { + if input == nil { + return nil + } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableFromBackupOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SourceTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_TargetTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_UseLatestRestorableTime_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_RestoreDateTime_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_BillingModeOverride_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_GlobalSecondaryIndexOverride_FromDafny(input interface{}) []types.GlobalSecondaryIndex { + return func() []types.GlobalSecondaryIndex { + var fieldValue []types.GlobalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_LocalSecondaryIndexOverride_FromDafny(input interface{}) []types.LocalSecondaryIndex { + return func() []types.LocalSecondaryIndex { + var fieldValue []types.LocalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_LocalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeInput_SSESpecificationOverride_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { + if input == nil { + return nil + } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ScanInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ScanInput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ScanInput_AttributesToGet_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ScanInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ScanInput_Select_FromDafny(input interface{}) types.Select { + return func() types.Select { + var u types.Select + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.Select) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_Select_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.Select).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ScanInput_ScanFilter_FromDafny(input interface{}) map[string]types.Condition { + return func() map[string]types.Condition { + var m map[string]types.Condition = make(map[string]types.Condition) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_FilterConditionMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_FilterConditionMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ScanInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ScanInput_ExclusiveStartKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ScanInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ScanInput_TotalSegments_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ScanInput_Segment_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_ScanInput_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ScanInput_FilterExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ScanInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ScanInput_ConsistentRead_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_ScanOutput_Items_FromDafny(input interface{}) []map[string]types.AttributeValue { + return func() []map[string]types.AttributeValue { + var fieldValue []map[string]types.AttributeValue + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ScanOutput_Count_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_ScanOutput_ScannedCount_FromDafny(input interface{}) int32 { + return input.(int32) +} +func com_amazonaws_dynamodb_ScanOutput_LastEvaluatedKey_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ScanOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TagResourceInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TagResourceInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TransactGetItemsInput_TransactItems_FromDafny(input interface{}) []types.TransactGetItem { + return func() []types.TransactGetItem { + var fieldValue []types.TransactGetItem + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TransactGetItemList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TransactGetItemList_member_FromDafny(input interface{}) types.TransactGetItem { + return func() types.TransactGetItem { + + return types.TransactGetItem{ + Get: com_amazonaws_dynamodb_TransactGetItem_Get_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactGetItem).Dtor_Get()), + } + }() +} +func com_amazonaws_dynamodb_TransactGetItem_Get_FromDafny(input interface{}) *types.Get { + return func() *types.Get { + + return &types.Get{ + Key: com_amazonaws_dynamodb_Get_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_Key()), + TableName: com_amazonaws_dynamodb_Get_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_TableName()), + ProjectionExpression: com_amazonaws_dynamodb_Get_ProjectionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_ProjectionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_Get_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Get).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Get_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Get_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Get_ProjectionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Get_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_TransactGetItemsInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TransactGetItemsOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TransactGetItemsOutput_Responses_FromDafny(input interface{}) []types.ItemResponse { + return func() []types.ItemResponse { + var fieldValue []types.ItemResponse + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ItemResponseList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TransactWriteItemsInput_TransactItems_FromDafny(input interface{}) []types.TransactWriteItem { + return func() []types.TransactWriteItem { + var fieldValue []types.TransactWriteItem + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TransactWriteItemList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TransactWriteItemList_member_FromDafny(input interface{}) types.TransactWriteItem { + return func() types.TransactWriteItem { + + return types.TransactWriteItem{ + ConditionCheck: com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_ConditionCheck().UnwrapOr(nil)), + Put: com_amazonaws_dynamodb_TransactWriteItem_Put_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Put().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_TransactWriteItem_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Delete().UnwrapOr(nil)), + Update: com_amazonaws_dynamodb_TransactWriteItem_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.TransactWriteItem).Dtor_Update().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_TransactWriteItem_ConditionCheck_FromDafny(input interface{}) *types.ConditionCheck { + return func() *types.ConditionCheck { + if input == nil { + return nil + } + return &types.ConditionCheck{ + Key: com_amazonaws_dynamodb_ConditionCheck_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_Key()), + TableName: com_amazonaws_dynamodb_ConditionCheck_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_TableName()), + ConditionExpression: com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ConditionExpression()), + ExpressionAttributeNames: com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.ConditionCheck).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ConditionCheck_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ConditionCheck_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ConditionCheck_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ConditionCheck_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ConditionCheck_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { + return func() types.ReturnValuesOnConditionCheckFailure { + var u types.ReturnValuesOnConditionCheckFailure + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TransactWriteItem_Put_FromDafny(input interface{}) *types.Put { + return func() *types.Put { + if input == nil { + return nil + } + return &types.Put{ + Item: com_amazonaws_dynamodb_Put_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_Item()), + TableName: com_amazonaws_dynamodb_Put_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_TableName()), + ConditionExpression: com_amazonaws_dynamodb_Put_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_Put_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_Put_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.Put).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Put_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_PutItemInputAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_PutItemInputAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Put_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Put_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Put_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Put_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Put_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { + return func() types.ReturnValuesOnConditionCheckFailure { + var u types.ReturnValuesOnConditionCheckFailure + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TransactWriteItem_Delete_FromDafny(input interface{}) *types.Delete { + return func() *types.Delete { + if input == nil { + return nil + } + return &types.Delete{ + Key: com_amazonaws_dynamodb_Delete_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_Key()), + TableName: com_amazonaws_dynamodb_Delete_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_TableName()), + ConditionExpression: com_amazonaws_dynamodb_Delete_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.Delete).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Delete_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Delete_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Delete_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Delete_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Delete_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Delete_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { + return func() types.ReturnValuesOnConditionCheckFailure { + var u types.ReturnValuesOnConditionCheckFailure + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TransactWriteItem_Update_FromDafny(input interface{}) *types.Update { + return func() *types.Update { + if input == nil { + return nil + } + return &types.Update{ + Key: com_amazonaws_dynamodb_Update_Key_FromDafny(input.(ComAmazonawsDynamodbTypes.Update).Dtor_Key()), + UpdateExpression: com_amazonaws_dynamodb_Update_UpdateExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Update).Dtor_UpdateExpression()), + TableName: com_amazonaws_dynamodb_Update_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.Update).Dtor_TableName()), + ConditionExpression: com_amazonaws_dynamodb_Update_ConditionExpression_FromDafny(input.(ComAmazonawsDynamodbTypes.Update).Dtor_ConditionExpression().UnwrapOr(nil)), + ExpressionAttributeNames: com_amazonaws_dynamodb_Update_ExpressionAttributeNames_FromDafny(input.(ComAmazonawsDynamodbTypes.Update).Dtor_ExpressionAttributeNames().UnwrapOr(nil)), + ExpressionAttributeValues: com_amazonaws_dynamodb_Update_ExpressionAttributeValues_FromDafny(input.(ComAmazonawsDynamodbTypes.Update).Dtor_ExpressionAttributeValues().UnwrapOr(nil)), + ReturnValuesOnConditionCheckFailure: com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_FromDafny(input.(ComAmazonawsDynamodbTypes.Update).Dtor_ReturnValuesOnConditionCheckFailure().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_Update_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Update_UpdateExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Update_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Update_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_Update_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Update_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_Update_ReturnValuesOnConditionCheckFailure_FromDafny(input interface{}) types.ReturnValuesOnConditionCheckFailure { + return func() types.ReturnValuesOnConditionCheckFailure { + var u types.ReturnValuesOnConditionCheckFailure + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValuesOnConditionCheckFailure_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValuesOnConditionCheckFailure).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TransactWriteItemsInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_TransactWriteItemsInput_ClientRequestToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ConsumedCapacity_FromDafny(input interface{}) []types.ConsumedCapacity { + return func() []types.ConsumedCapacity { + var fieldValue []types.ConsumedCapacity + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ConsumedCapacityMultiple_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TransactWriteItemsOutput_ItemCollectionMetrics_FromDafny(input interface{}) map[string][]types.ItemCollectionMetrics { + return func() map[string][]types.ItemCollectionMetrics { + var m map[string][]types.ItemCollectionMetrics = make(map[string][]types.ItemCollectionMetrics) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ItemCollectionMetricsPerTable_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_UntagResourceInput_ResourceArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UntagResourceInput_TagKeys_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_TagKeyList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_TagKeyList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateContinuousBackupsInput_PointInTimeRecoverySpecification_FromDafny(input interface{}) *types.PointInTimeRecoverySpecification { + return func() *types.PointInTimeRecoverySpecification { + + return &types.PointInTimeRecoverySpecification{ + PointInTimeRecoveryEnabled: com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.PointInTimeRecoverySpecification).Dtor_PointInTimeRecoveryEnabled()), + } + }() +} +func com_amazonaws_dynamodb_PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_UpdateContinuousBackupsOutput_ContinuousBackupsDescription_FromDafny(input interface{}) *types.ContinuousBackupsDescription { + return func() *types.ContinuousBackupsDescription { + if input == nil { + return nil + } + return &types.ContinuousBackupsDescription{ + ContinuousBackupsStatus: com_amazonaws_dynamodb_ContinuousBackupsDescription_ContinuousBackupsStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_ContinuousBackupsStatus()), + PointInTimeRecoveryDescription: com_amazonaws_dynamodb_ContinuousBackupsDescription_PointInTimeRecoveryDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.ContinuousBackupsDescription).Dtor_PointInTimeRecoveryDescription().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateContributorInsightsInput_ContributorInsightsAction_FromDafny(input interface{}) types.ContributorInsightsAction { + return func() types.ContributorInsightsAction { + var u types.ContributorInsightsAction + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsAction) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsAction_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsAction).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateContributorInsightsOutput_ContributorInsightsStatus_FromDafny(input interface{}) types.ContributorInsightsStatus { + return func() types.ContributorInsightsStatus { + var u types.ContributorInsightsStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ContributorInsightsStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ContributorInsightsStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableInput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicaUpdate { + return func() []types.ReplicaUpdate { + var fieldValue []types.ReplicaUpdate + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaUpdateList_member_FromDafny(input interface{}) types.ReplicaUpdate { + return func() types.ReplicaUpdate { + + return types.ReplicaUpdate{ + Create: com_amazonaws_dynamodb_ReplicaUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaUpdate).Dtor_Create().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_ReplicaUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaUpdate).Dtor_Delete().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaUpdate_Create_FromDafny(input interface{}) *types.CreateReplicaAction { + return func() *types.CreateReplicaAction { + if input == nil { + return nil + } + return &types.CreateReplicaAction{ + RegionName: com_amazonaws_dynamodb_CreateReplicaAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicaAction).Dtor_RegionName()), + } + }() +} +func com_amazonaws_dynamodb_CreateReplicaAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaUpdate_Delete_FromDafny(input interface{}) *types.DeleteReplicaAction { + return func() *types.DeleteReplicaAction { + if input == nil { + return nil + } + return &types.DeleteReplicaAction{ + RegionName: com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteReplicaAction).Dtor_RegionName()), + } + }() +} +func com_amazonaws_dynamodb_DeleteReplicaAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableOutput_GlobalTableDescription_FromDafny(input interface{}) *types.GlobalTableDescription { + return func() *types.GlobalTableDescription { + if input == nil { + return nil + } + return &types.GlobalTableDescription{ + ReplicationGroup: com_amazonaws_dynamodb_GlobalTableDescription_ReplicationGroup_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_ReplicationGroup().UnwrapOr(nil)), + GlobalTableArn: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableArn().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_GlobalTableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + GlobalTableStatus: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableStatus().UnwrapOr(nil)), + GlobalTableName: com_amazonaws_dynamodb_GlobalTableDescription_GlobalTableName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableDescription).Dtor_GlobalTableName().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableBillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input interface{}) *types.AutoScalingPolicyUpdate { + return func() *types.AutoScalingPolicyUpdate { + if input == nil { + return nil + } + return &types.AutoScalingPolicyUpdate{ + PolicyName: com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyUpdate).Dtor_PolicyName().UnwrapOr(nil)), + TargetTrackingScalingPolicyConfiguration: com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingPolicyUpdate).Dtor_TargetTrackingScalingPolicyConfiguration()), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_PolicyName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AutoScalingPolicyUpdate_TargetTrackingScalingPolicyConfiguration_FromDafny(input interface{}) *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + return func() *types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { + + return &types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{ + DisableScaleIn: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_DisableScaleIn().UnwrapOr(nil)), + ScaleInCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_ScaleInCooldown().UnwrapOr(nil)), + ScaleOutCooldown: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_ScaleOutCooldown().UnwrapOr(nil)), + TargetValue: com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate).Dtor_TargetValue()), + } + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_DisableScaleIn_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleInCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_ScaleOutCooldown_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_TargetValue_FromDafny(input interface{}) *float64 { + return func() *float64 { + var b []byte + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]float64{math.Float64frombits(binary.LittleEndian.Uint64(b))}[0] + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_GlobalTableGlobalSecondaryIndexSettingsUpdate_FromDafny(input interface{}) []types.GlobalTableGlobalSecondaryIndexSettingsUpdate { + return func() []types.GlobalTableGlobalSecondaryIndexSettingsUpdate { + var fieldValue []types.GlobalTableGlobalSecondaryIndexSettingsUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(input interface{}) types.GlobalTableGlobalSecondaryIndexSettingsUpdate { + return func() types.GlobalTableGlobalSecondaryIndexSettingsUpdate { + + return types.GlobalTableGlobalSecondaryIndexSettingsUpdate{ + IndexName: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_IndexName()), + ProvisionedWriteCapacityUnits: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedWriteCapacityUnits().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalTableGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedWriteCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate_ProvisionedWriteCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput_ReplicaSettingsUpdate_FromDafny(input interface{}) []types.ReplicaSettingsUpdate { + return func() []types.ReplicaSettingsUpdate { + var fieldValue []types.ReplicaSettingsUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdateList_member_FromDafny(input interface{}) types.ReplicaSettingsUpdate { + return func() types.ReplicaSettingsUpdate { + + return types.ReplicaSettingsUpdate{ + RegionName: com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_RegionName()), + ReplicaProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaProvisionedReadCapacityUnits().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), + ReplicaGlobalSecondaryIndexSettingsUpdate: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaGlobalSecondaryIndexSettingsUpdate().UnwrapOr(nil)), + ReplicaTableClass: com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaSettingsUpdate).Dtor_ReplicaTableClass().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexSettingsUpdate { + return func() []types.ReplicaGlobalSecondaryIndexSettingsUpdate { + var fieldValue []types.ReplicaGlobalSecondaryIndexSettingsUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdateList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexSettingsUpdate { + return func() types.ReplicaGlobalSecondaryIndexSettingsUpdate { + + return types.ReplicaGlobalSecondaryIndexSettingsUpdate{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_IndexName()), + ProvisionedReadCapacityUnits: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedReadCapacityUnits().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingSettingsUpdate: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexSettingsUpdate).Dtor_ProvisionedReadCapacityAutoScalingSettingsUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityUnits_FromDafny(input interface{}) *int64 { + return func() *int64 { + var i int64 + if input == nil { + return nil + } + i = input.(int64) + return &i + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate_ProvisionedReadCapacityAutoScalingSettingsUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaSettingsUpdate_ReplicaTableClass_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_GlobalTableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput_ReplicaSettings_FromDafny(input interface{}) []types.ReplicaSettingsDescription { + return func() []types.ReplicaSettingsDescription { + var fieldValue []types.ReplicaSettingsDescription + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaSettingsDescriptionList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_Key_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_Key_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_Key_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_AttributeUpdates_FromDafny(input interface{}) map[string]types.AttributeValueUpdate { + return func() map[string]types.AttributeValueUpdate { + var m map[string]types.AttributeValueUpdate = make(map[string]types.AttributeValueUpdate) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeUpdates_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeUpdates_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_AttributeUpdates_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_AttributeUpdates_value_FromDafny(input interface{}) types.AttributeValueUpdate { + return func() types.AttributeValueUpdate { + + return types.AttributeValueUpdate{ + Value: com_amazonaws_dynamodb_AttributeValueUpdate_Value_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeValueUpdate).Dtor_Value().UnwrapOr(nil)), + Action: com_amazonaws_dynamodb_AttributeValueUpdate_Action_FromDafny(input.(ComAmazonawsDynamodbTypes.AttributeValueUpdate).Dtor_Action().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_AttributeValueUpdate_Value_FromDafny(input interface{}) types.AttributeValue { + return func() types.AttributeValue { + var union types.AttributeValue + if input == nil { + return union + } + + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_S() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_S()) + union = &types.AttributeValueMemberS{ + Value: (com_amazonaws_dynamodb_AttributeValue_S_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_N() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_N()) + union = &types.AttributeValueMemberN{ + Value: (com_amazonaws_dynamodb_AttributeValue_N_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_B() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_B()) + union = &types.AttributeValueMemberB{ + Value: (com_amazonaws_dynamodb_AttributeValue_B_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_SS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_SS()) + union = &types.AttributeValueMemberSS{ + Value: (com_amazonaws_dynamodb_AttributeValue_SS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NS()) + union = &types.AttributeValueMemberNS{ + Value: (com_amazonaws_dynamodb_AttributeValue_NS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BS() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BS()) + union = &types.AttributeValueMemberBS{ + Value: (com_amazonaws_dynamodb_AttributeValue_BS_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_M() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_M()) + union = &types.AttributeValueMemberM{ + Value: (com_amazonaws_dynamodb_AttributeValue_M_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_L() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_L()) + union = &types.AttributeValueMemberL{ + Value: (com_amazonaws_dynamodb_AttributeValue_L_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_NULL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_NULL()) + union = &types.AttributeValueMemberNULL{ + Value: (com_amazonaws_dynamodb_AttributeValue_NULL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + if (input.(ComAmazonawsDynamodbTypes.AttributeValue)).Is_BOOL() { + var dataSource = Wrappers.Companion_Option_.Create_Some_(input.(ComAmazonawsDynamodbTypes.AttributeValue).Dtor_BOOL()) + union = &types.AttributeValueMemberBOOL{ + Value: (com_amazonaws_dynamodb_AttributeValue_BOOL_FromDafny(dataSource.UnwrapOr(nil))), + } + } + + return union + }() +} +func com_amazonaws_dynamodb_AttributeValueUpdate_Action_FromDafny(input interface{}) types.AttributeAction { + return func() types.AttributeAction { + var u types.AttributeAction + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.AttributeAction) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_AttributeAction_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.AttributeAction).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_Expected_FromDafny(input interface{}) map[string]types.ExpectedAttributeValue { + return func() map[string]types.ExpectedAttributeValue { + var m map[string]types.ExpectedAttributeValue = make(map[string]types.ExpectedAttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpectedAttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpectedAttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ConditionalOperator_FromDafny(input interface{}) types.ConditionalOperator { + return func() types.ConditionalOperator { + var u types.ConditionalOperator + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ConditionalOperator) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ConditionalOperator_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ConditionalOperator).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ReturnValues_FromDafny(input interface{}) types.ReturnValue { + return func() types.ReturnValue { + var u types.ReturnValue + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnValue) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnValue_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnValue).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ReturnConsumedCapacity_FromDafny(input interface{}) types.ReturnConsumedCapacity { + return func() types.ReturnConsumedCapacity { + var u types.ReturnConsumedCapacity + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnConsumedCapacity_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnConsumedCapacity).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ReturnItemCollectionMetrics_FromDafny(input interface{}) types.ReturnItemCollectionMetrics { + return func() types.ReturnItemCollectionMetrics { + var u types.ReturnItemCollectionMetrics + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ReturnItemCollectionMetrics_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ReturnItemCollectionMetrics).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_UpdateExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ConditionExpression_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeNames_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeNameMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeNameMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_UpdateItemInput_ExpressionAttributeValues_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_ExpressionAttributeValueMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_ExpressionAttributeValueMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_UpdateItemOutput_Attributes_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_UpdateItemOutput_ConsumedCapacity_FromDafny(input interface{}) *types.ConsumedCapacity { + return func() *types.ConsumedCapacity { + if input == nil { + return nil + } + return &types.ConsumedCapacity{ + TableName: com_amazonaws_dynamodb_ConsumedCapacity_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_TableName().UnwrapOr(nil)), + CapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_CapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_CapacityUnits().UnwrapOr(nil)), + ReadCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + WriteCapacityUnits: com_amazonaws_dynamodb_ConsumedCapacity_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_WriteCapacityUnits().UnwrapOr(nil)), + Table: com_amazonaws_dynamodb_ConsumedCapacity_Table_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_Table().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_ConsumedCapacity_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.ConsumedCapacity).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateItemOutput_ItemCollectionMetrics_FromDafny(input interface{}) *types.ItemCollectionMetrics { + return func() *types.ItemCollectionMetrics { + if input == nil { + return nil + } + return &types.ItemCollectionMetrics{ + ItemCollectionKey: com_amazonaws_dynamodb_ItemCollectionMetrics_ItemCollectionKey_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_ItemCollectionKey().UnwrapOr(nil)), + SizeEstimateRangeGB: com_amazonaws_dynamodb_ItemCollectionMetrics_SizeEstimateRangeGB_FromDafny(input.(ComAmazonawsDynamodbTypes.ItemCollectionMetrics).Dtor_SizeEstimateRangeGB().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationInput_UpdateKinesisStreamingConfiguration_FromDafny(input interface{}) *types.UpdateKinesisStreamingConfiguration { + return func() *types.UpdateKinesisStreamingConfiguration { + if input == nil { + return nil + } + return &types.UpdateKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input interface{}) types.ApproximateCreationDateTimePrecision { + return func() types.ApproximateCreationDateTimePrecision { + var u types.ApproximateCreationDateTimePrecision + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_ApproximateCreationDateTimePrecision_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.ApproximateCreationDateTimePrecision).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_StreamArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_DestinationStatus_FromDafny(input interface{}) types.DestinationStatus { + return func() types.DestinationStatus { + var u types.DestinationStatus + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.DestinationStatus) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_DestinationStatus_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.DestinationStatus).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateKinesisStreamingDestinationOutput_UpdateKinesisStreamingConfiguration_FromDafny(input interface{}) *types.UpdateKinesisStreamingConfiguration { + return func() *types.UpdateKinesisStreamingConfiguration { + if input == nil { + return nil + } + return &types.UpdateKinesisStreamingConfiguration{ + ApproximateCreationDateTimePrecision: com_amazonaws_dynamodb_UpdateKinesisStreamingConfiguration_ApproximateCreationDateTimePrecision_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateKinesisStreamingConfiguration).Dtor_ApproximateCreationDateTimePrecision().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_AttributeDefinitions_FromDafny(input interface{}) []types.AttributeDefinition { + return func() []types.AttributeDefinition { + var fieldValue []types.AttributeDefinition + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_AttributeDefinitions_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_BillingMode_FromDafny(input interface{}) types.BillingMode { + return func() types.BillingMode { + var u types.BillingMode + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.BillingMode) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_BillingMode_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.BillingMode).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_GlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.GlobalSecondaryIndexUpdate { + return func() []types.GlobalSecondaryIndexUpdate { + var fieldValue []types.GlobalSecondaryIndexUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdateList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexUpdate { + return func() types.GlobalSecondaryIndexUpdate { + + return types.GlobalSecondaryIndexUpdate{ + Update: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Update().UnwrapOr(nil)), + Create: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Create().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexUpdate).Dtor_Delete().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Update_FromDafny(input interface{}) *types.UpdateGlobalSecondaryIndexAction { + return func() *types.UpdateGlobalSecondaryIndexAction { + if input == nil { + return nil + } + return &types.UpdateGlobalSecondaryIndexAction{ + IndexName: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_IndexName()), + ProvisionedThroughput: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateGlobalSecondaryIndexAction).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Create_FromDafny(input interface{}) *types.CreateGlobalSecondaryIndexAction { + return func() *types.CreateGlobalSecondaryIndexAction { + if input == nil { + return nil + } + return &types.CreateGlobalSecondaryIndexAction{ + IndexName: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_IndexName()), + KeySchema: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_KeySchema()), + Projection: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_Projection()), + ProvisionedThroughput: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateGlobalSecondaryIndexAction).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_KeySchema_FromDafny(input interface{}) []types.KeySchemaElement { + return func() []types.KeySchemaElement { + var fieldValue []types.KeySchemaElement + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_KeySchema_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_Projection_FromDafny(input interface{}) *types.Projection { + return func() *types.Projection { + + return &types.Projection{ + ProjectionType: com_amazonaws_dynamodb_Projection_ProjectionType_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_ProjectionType().UnwrapOr(nil)), + NonKeyAttributes: com_amazonaws_dynamodb_Projection_NonKeyAttributes_FromDafny(input.(ComAmazonawsDynamodbTypes.Projection).Dtor_NonKeyAttributes().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_ProvisionedThroughput_FromDafny(input interface{}) *types.ProvisionedThroughput { + return func() *types.ProvisionedThroughput { + if input == nil { + return nil + } + return &types.ProvisionedThroughput{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_ReadCapacityUnits()), + WriteCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughput_WriteCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughput).Dtor_WriteCapacityUnits()), + } + }() +} +func com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate_Delete_FromDafny(input interface{}) *types.DeleteGlobalSecondaryIndexAction { + return func() *types.DeleteGlobalSecondaryIndexAction { + if input == nil { + return nil + } + return &types.DeleteGlobalSecondaryIndexAction{ + IndexName: com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteGlobalSecondaryIndexAction).Dtor_IndexName()), + } + }() +} +func com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_StreamSpecification_FromDafny(input interface{}) *types.StreamSpecification { + return func() *types.StreamSpecification { + if input == nil { + return nil + } + return &types.StreamSpecification{ + StreamEnabled: com_amazonaws_dynamodb_StreamSpecification_StreamEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamEnabled()), + StreamViewType: com_amazonaws_dynamodb_StreamSpecification_StreamViewType_FromDafny(input.(ComAmazonawsDynamodbTypes.StreamSpecification).Dtor_StreamViewType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_SSESpecification_FromDafny(input interface{}) *types.SSESpecification { + return func() *types.SSESpecification { + if input == nil { + return nil + } + return &types.SSESpecification{ + Enabled: com_amazonaws_dynamodb_SSESpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_Enabled().UnwrapOr(nil)), + SSEType: com_amazonaws_dynamodb_SSESpecification_SSEType_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_SSEType().UnwrapOr(nil)), + KMSMasterKeyId: com_amazonaws_dynamodb_SSESpecification_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.SSESpecification).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicationGroupUpdate { + return func() []types.ReplicationGroupUpdate { + var fieldValue []types.ReplicationGroupUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicationGroupUpdateList_member_FromDafny(input interface{}) types.ReplicationGroupUpdate { + return func() types.ReplicationGroupUpdate { + + return types.ReplicationGroupUpdate{ + Create: com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Create().UnwrapOr(nil)), + Update: com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Update().UnwrapOr(nil)), + Delete: com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicationGroupUpdate).Dtor_Delete().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Create_FromDafny(input interface{}) *types.CreateReplicationGroupMemberAction { + return func() *types.CreateReplicationGroupMemberAction { + if input == nil { + return nil + } + return &types.CreateReplicationGroupMemberAction{ + RegionName: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_RegionName()), + KMSMasterKeyId: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + TableClassOverride: com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.CreateReplicationGroupMemberAction).Dtor_TableClassOverride().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil + } + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { + if input == nil { + return nil + } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndex { + return func() []types.ReplicaGlobalSecondaryIndex { + var fieldValue []types.ReplicaGlobalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndex { + return func() types.ReplicaGlobalSecondaryIndex { + + return types.ReplicaGlobalSecondaryIndex{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_IndexName()), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndex).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil + } + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { + if input == nil { + return nil + } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CreateReplicationGroupMemberAction_TableClassOverride_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Update_FromDafny(input interface{}) *types.UpdateReplicationGroupMemberAction { + return func() *types.UpdateReplicationGroupMemberAction { + if input == nil { + return nil + } + return &types.UpdateReplicationGroupMemberAction{ + RegionName: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_RegionName()), + KMSMasterKeyId: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_KMSMasterKeyId().UnwrapOr(nil)), + ProvisionedThroughputOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_ProvisionedThroughputOverride().UnwrapOr(nil)), + OnDemandThroughputOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_OnDemandThroughputOverride().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + TableClassOverride: com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_FromDafny(input.(ComAmazonawsDynamodbTypes.UpdateReplicationGroupMemberAction).Dtor_TableClassOverride().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_KMSMasterKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_ProvisionedThroughputOverride_FromDafny(input interface{}) *types.ProvisionedThroughputOverride { + return func() *types.ProvisionedThroughputOverride { + if input == nil { + return nil + } + return &types.ProvisionedThroughputOverride{ + ReadCapacityUnits: com_amazonaws_dynamodb_ProvisionedThroughputOverride_ReadCapacityUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.ProvisionedThroughputOverride).Dtor_ReadCapacityUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_OnDemandThroughputOverride_FromDafny(input interface{}) *types.OnDemandThroughputOverride { + return func() *types.OnDemandThroughputOverride { + if input == nil { + return nil + } + return &types.OnDemandThroughputOverride{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughputOverride_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughputOverride).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_GlobalSecondaryIndexes_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndex { + return func() []types.ReplicaGlobalSecondaryIndex { + var fieldValue []types.ReplicaGlobalSecondaryIndex + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction_TableClassOverride_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_ReplicationGroupUpdate_Delete_FromDafny(input interface{}) *types.DeleteReplicationGroupMemberAction { + return func() *types.DeleteReplicationGroupMemberAction { + if input == nil { + return nil + } + return &types.DeleteReplicationGroupMemberAction{ + RegionName: com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.DeleteReplicationGroupMemberAction).Dtor_RegionName()), + } + }() +} +func com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_TableClass_FromDafny(input interface{}) types.TableClass { + return func() types.TableClass { + var u types.TableClass + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsDynamodbTypes.TableClass) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsDynamodbTypes.CompanionStruct_TableClass_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsDynamodbTypes.TableClass).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_DeletionProtectionEnabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_UpdateTableInput_OnDemandThroughput_FromDafny(input interface{}) *types.OnDemandThroughput { + return func() *types.OnDemandThroughput { + if input == nil { + return nil + } + return &types.OnDemandThroughput{ + MaxReadRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxReadRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxReadRequestUnits().UnwrapOr(nil)), + MaxWriteRequestUnits: com_amazonaws_dynamodb_OnDemandThroughput_MaxWriteRequestUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.OnDemandThroughput).Dtor_MaxWriteRequestUnits().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableOutput_TableDescription_FromDafny(input interface{}) *types.TableDescription { + return func() *types.TableDescription { + if input == nil { + return nil + } + return &types.TableDescription{ + AttributeDefinitions: com_amazonaws_dynamodb_TableDescription_AttributeDefinitions_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_AttributeDefinitions().UnwrapOr(nil)), + TableName: com_amazonaws_dynamodb_TableDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableName().UnwrapOr(nil)), + KeySchema: com_amazonaws_dynamodb_TableDescription_KeySchema_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_KeySchema().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableStatus().UnwrapOr(nil)), + CreationDateTime: com_amazonaws_dynamodb_TableDescription_CreationDateTime_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_CreationDateTime().UnwrapOr(nil)), + ProvisionedThroughput: com_amazonaws_dynamodb_TableDescription_ProvisionedThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ProvisionedThroughput().UnwrapOr(nil)), + TableSizeBytes: com_amazonaws_dynamodb_TableDescription_TableSizeBytes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableSizeBytes().UnwrapOr(nil)), + ItemCount: com_amazonaws_dynamodb_TableDescription_ItemCount_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ItemCount().UnwrapOr(nil)), + TableArn: com_amazonaws_dynamodb_TableDescription_TableArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableArn().UnwrapOr(nil)), + TableId: com_amazonaws_dynamodb_TableDescription_TableId_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableId().UnwrapOr(nil)), + BillingModeSummary: com_amazonaws_dynamodb_TableDescription_BillingModeSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_BillingModeSummary().UnwrapOr(nil)), + LocalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_LocalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LocalSecondaryIndexes().UnwrapOr(nil)), + GlobalSecondaryIndexes: com_amazonaws_dynamodb_TableDescription_GlobalSecondaryIndexes_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalSecondaryIndexes().UnwrapOr(nil)), + StreamSpecification: com_amazonaws_dynamodb_TableDescription_StreamSpecification_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_StreamSpecification().UnwrapOr(nil)), + LatestStreamLabel: com_amazonaws_dynamodb_TableDescription_LatestStreamLabel_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamLabel().UnwrapOr(nil)), + LatestStreamArn: com_amazonaws_dynamodb_TableDescription_LatestStreamArn_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_LatestStreamArn().UnwrapOr(nil)), + GlobalTableVersion: com_amazonaws_dynamodb_TableDescription_GlobalTableVersion_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_GlobalTableVersion().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_Replicas().UnwrapOr(nil)), + RestoreSummary: com_amazonaws_dynamodb_TableDescription_RestoreSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_RestoreSummary().UnwrapOr(nil)), + SSEDescription: com_amazonaws_dynamodb_TableDescription_SSEDescription_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_SSEDescription().UnwrapOr(nil)), + ArchivalSummary: com_amazonaws_dynamodb_TableDescription_ArchivalSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_ArchivalSummary().UnwrapOr(nil)), + TableClassSummary: com_amazonaws_dynamodb_TableDescription_TableClassSummary_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_TableClassSummary().UnwrapOr(nil)), + DeletionProtectionEnabled: com_amazonaws_dynamodb_TableDescription_DeletionProtectionEnabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_DeletionProtectionEnabled().UnwrapOr(nil)), + OnDemandThroughput: com_amazonaws_dynamodb_TableDescription_OnDemandThroughput_FromDafny(input.(ComAmazonawsDynamodbTypes.TableDescription).Dtor_OnDemandThroughput().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_GlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.GlobalSecondaryIndexAutoScalingUpdate { + return func() []types.GlobalSecondaryIndexAutoScalingUpdate { + var fieldValue []types.GlobalSecondaryIndexAutoScalingUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(input interface{}) types.GlobalSecondaryIndexAutoScalingUpdate { + return func() types.GlobalSecondaryIndexAutoScalingUpdate { + + return types.GlobalSecondaryIndexAutoScalingUpdate{ + IndexName: com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate).Dtor_IndexName().UnwrapOr(nil)), + ProvisionedWriteCapacityAutoScalingUpdate: com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.GlobalSecondaryIndexAutoScalingUpdate).Dtor_ProvisionedWriteCapacityAutoScalingUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ProvisionedWriteCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput_ReplicaUpdates_FromDafny(input interface{}) []types.ReplicaAutoScalingUpdate { + return func() []types.ReplicaAutoScalingUpdate { + var fieldValue []types.ReplicaAutoScalingUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdateList_member_FromDafny(input interface{}) types.ReplicaAutoScalingUpdate { + return func() types.ReplicaAutoScalingUpdate { + + return types.ReplicaAutoScalingUpdate{ + RegionName: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_RegionName()), + ReplicaGlobalSecondaryIndexUpdates: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_ReplicaGlobalSecondaryIndexUpdates().UnwrapOr(nil)), + ReplicaProvisionedReadCapacityAutoScalingUpdate: com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaAutoScalingUpdate).Dtor_ReplicaProvisionedReadCapacityAutoScalingUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_RegionName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaGlobalSecondaryIndexUpdates_FromDafny(input interface{}) []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + return func() []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + var fieldValue []types.ReplicaGlobalSecondaryIndexAutoScalingUpdate + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdateList_member_FromDafny(input interface{}) types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + return func() types.ReplicaGlobalSecondaryIndexAutoScalingUpdate { + + return types.ReplicaGlobalSecondaryIndexAutoScalingUpdate{ + IndexName: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate).Dtor_IndexName().UnwrapOr(nil)), + ProvisionedReadCapacityAutoScalingUpdate: com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.ReplicaGlobalSecondaryIndexAutoScalingUpdate).Dtor_ProvisionedReadCapacityAutoScalingUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_IndexName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate_ProvisionedReadCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_ReplicaAutoScalingUpdate_ReplicaProvisionedReadCapacityAutoScalingUpdate_FromDafny(input interface{}) *types.AutoScalingSettingsUpdate { + return func() *types.AutoScalingSettingsUpdate { + if input == nil { + return nil + } + return &types.AutoScalingSettingsUpdate{ + MinimumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MinimumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MinimumUnits().UnwrapOr(nil)), + MaximumUnits: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_MaximumUnits_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_MaximumUnits().UnwrapOr(nil)), + AutoScalingDisabled: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingDisabled_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingDisabled().UnwrapOr(nil)), + AutoScalingRoleArn: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_AutoScalingRoleArn_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_AutoScalingRoleArn().UnwrapOr(nil)), + ScalingPolicyUpdate: com_amazonaws_dynamodb_AutoScalingSettingsUpdate_ScalingPolicyUpdate_FromDafny(input.(ComAmazonawsDynamodbTypes.AutoScalingSettingsUpdate).Dtor_ScalingPolicyUpdate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput_TableAutoScalingDescription_FromDafny(input interface{}) *types.TableAutoScalingDescription { + return func() *types.TableAutoScalingDescription { + if input == nil { + return nil + } + return &types.TableAutoScalingDescription{ + TableName: com_amazonaws_dynamodb_TableAutoScalingDescription_TableName_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableName().UnwrapOr(nil)), + TableStatus: com_amazonaws_dynamodb_TableAutoScalingDescription_TableStatus_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_TableStatus().UnwrapOr(nil)), + Replicas: com_amazonaws_dynamodb_TableAutoScalingDescription_Replicas_FromDafny(input.(ComAmazonawsDynamodbTypes.TableAutoScalingDescription).Dtor_Replicas().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TableName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateTimeToLiveInput_TimeToLiveSpecification_FromDafny(input interface{}) *types.TimeToLiveSpecification { + return func() *types.TimeToLiveSpecification { + + return &types.TimeToLiveSpecification{ + Enabled: com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_Enabled()), + AttributeName: com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_AttributeName()), + } + }() +} +func com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + + b = input.(bool) + return &b + }() +} +func com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_UpdateTimeToLiveOutput_TimeToLiveSpecification_FromDafny(input interface{}) *types.TimeToLiveSpecification { + return func() *types.TimeToLiveSpecification { + if input == nil { + return nil + } + return &types.TimeToLiveSpecification{ + Enabled: com_amazonaws_dynamodb_TimeToLiveSpecification_Enabled_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_Enabled()), + AttributeName: com_amazonaws_dynamodb_TimeToLiveSpecification_AttributeName_FromDafny(input.(ComAmazonawsDynamodbTypes.TimeToLiveSpecification).Dtor_AttributeName()), + } + }() +} +func com_amazonaws_dynamodb_BackupInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_BackupNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ConditionalCheckFailedException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ConditionalCheckFailedException_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_ContinuousBackupsUnavailableException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_DuplicateItemException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportConflictException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ExportNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalTableAlreadyExistsException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_GlobalTableNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_IdempotentParameterMismatchException_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportConflictException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ImportNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_IndexNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_InternalServerError_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_InvalidEndpointException_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_InvalidExportTimeException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_InvalidRestoreTimeException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_LimitExceededException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_PolicyNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ProvisionedThroughputExceededException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaAlreadyExistsException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ReplicaNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_RequestLimitExceeded_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ResourceInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_ResourceNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableAlreadyExistsException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TableNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TransactionCanceledException_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TransactionCanceledException_CancellationReasons_FromDafny(input interface{}) []types.CancellationReason { + return func() []types.CancellationReason { + var fieldValue []types.CancellationReason + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_dynamodb_CancellationReasonList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_dynamodb_CancellationReasonList_member_FromDafny(input interface{}) types.CancellationReason { + return func() types.CancellationReason { + + return types.CancellationReason{ + Item: com_amazonaws_dynamodb_CancellationReason_Item_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Item().UnwrapOr(nil)), + Code: com_amazonaws_dynamodb_CancellationReason_Code_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Code().UnwrapOr(nil)), + Message: com_amazonaws_dynamodb_CancellationReason_Message_FromDafny(input.(ComAmazonawsDynamodbTypes.CancellationReason).Dtor_Message().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_dynamodb_CancellationReason_Item_FromDafny(input interface{}) map[string]types.AttributeValue { + return func() map[string]types.AttributeValue { + var m map[string]types.AttributeValue = make(map[string]types.AttributeValue) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_dynamodb_AttributeMap_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_dynamodb_AttributeMap_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_dynamodb_CancellationReason_Code_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_CancellationReason_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TransactionConflictException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_dynamodb_TransactionInProgressException_Message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} diff --git a/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go b/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go index 7b9971a92..cf01c187b 100644 --- a/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go +++ b/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go @@ -814,386 +814,386 @@ func VerifyMacOutput_ToDafny(nativeOutput kms.VerifyMacOutput) ComAmazonawsKmsTy } -func XksProxyVpcEndpointServiceInvalidConfigurationException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceInvalidConfigurationException) ComAmazonawsKmsTypes.Error { +func AlreadyExistsException_ToDafny(nativeInput types.AlreadyExistsException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceInvalidConfigurationException_(com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_AlreadyExistsException_(com_amazonaws_kms_AlreadyExistsException_message_ToDafny(nativeInput.Message)) }() } -func KMSInvalidMacException_ToDafny(nativeInput types.KMSInvalidMacException) ComAmazonawsKmsTypes.Error { +func CloudHsmClusterInUseException_ToDafny(nativeInput types.CloudHsmClusterInUseException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidMacException_(com_amazonaws_kms_KMSInvalidMacException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterInUseException_(com_amazonaws_kms_CloudHsmClusterInUseException_message_ToDafny(nativeInput.Message)) }() } -func UnsupportedOperationException_ToDafny(nativeInput types.UnsupportedOperationException) ComAmazonawsKmsTypes.Error { +func CloudHsmClusterInvalidConfigurationException_ToDafny(nativeInput types.CloudHsmClusterInvalidConfigurationException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_UnsupportedOperationException_(com_amazonaws_kms_UnsupportedOperationException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterInvalidConfigurationException_(com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_ToDafny(nativeInput.Message)) }() } -func MalformedPolicyDocumentException_ToDafny(nativeInput types.MalformedPolicyDocumentException) ComAmazonawsKmsTypes.Error { +func CloudHsmClusterNotActiveException_ToDafny(nativeInput types.CloudHsmClusterNotActiveException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_MalformedPolicyDocumentException_(com_amazonaws_kms_MalformedPolicyDocumentException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotActiveException_(com_amazonaws_kms_CloudHsmClusterNotActiveException_message_ToDafny(nativeInput.Message)) }() } -func XksKeyInvalidConfigurationException_ToDafny(nativeInput types.XksKeyInvalidConfigurationException) ComAmazonawsKmsTypes.Error { +func CloudHsmClusterNotFoundException_ToDafny(nativeInput types.CloudHsmClusterNotFoundException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyInvalidConfigurationException_(com_amazonaws_kms_XksKeyInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotFoundException_(com_amazonaws_kms_CloudHsmClusterNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyVpcEndpointServiceNotFoundException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceNotFoundException) ComAmazonawsKmsTypes.Error { +func CloudHsmClusterNotRelatedException_ToDafny(nativeInput types.CloudHsmClusterNotRelatedException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceNotFoundException_(com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotRelatedException_(com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_ToDafny(nativeInput.Message)) }() } -func InvalidCiphertextException_ToDafny(nativeInput types.InvalidCiphertextException) ComAmazonawsKmsTypes.Error { +func ConflictException_ToDafny(nativeInput types.ConflictException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidCiphertextException_(com_amazonaws_kms_InvalidCiphertextException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_ConflictException_(com_amazonaws_kms_ConflictException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyUriUnreachableException_ToDafny(nativeInput types.XksProxyUriUnreachableException) ComAmazonawsKmsTypes.Error { +func CustomKeyStoreHasCMKsException_ToDafny(nativeInput types.CustomKeyStoreHasCMKsException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriUnreachableException_(com_amazonaws_kms_XksProxyUriUnreachableException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreHasCMKsException_(com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_ToDafny(nativeInput.Message)) }() } -func InvalidImportTokenException_ToDafny(nativeInput types.InvalidImportTokenException) ComAmazonawsKmsTypes.Error { +func CustomKeyStoreInvalidStateException_ToDafny(nativeInput types.CustomKeyStoreInvalidStateException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidImportTokenException_(com_amazonaws_kms_InvalidImportTokenException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreInvalidStateException_(com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_ToDafny(nativeInput.Message)) }() } -func CloudHsmClusterNotActiveException_ToDafny(nativeInput types.CloudHsmClusterNotActiveException) ComAmazonawsKmsTypes.Error { +func CustomKeyStoreNameInUseException_ToDafny(nativeInput types.CustomKeyStoreNameInUseException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotActiveException_(com_amazonaws_kms_CloudHsmClusterNotActiveException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreNameInUseException_(com_amazonaws_kms_CustomKeyStoreNameInUseException_message_ToDafny(nativeInput.Message)) }() } -func InvalidMarkerException_ToDafny(nativeInput types.InvalidMarkerException) ComAmazonawsKmsTypes.Error { +func CustomKeyStoreNotFoundException_ToDafny(nativeInput types.CustomKeyStoreNotFoundException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidMarkerException_(com_amazonaws_kms_InvalidMarkerException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreNotFoundException_(com_amazonaws_kms_CustomKeyStoreNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func DryRunOperationException_ToDafny(nativeInput types.DryRunOperationException) ComAmazonawsKmsTypes.Error { +func DependencyTimeoutException_ToDafny(nativeInput types.DependencyTimeoutException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_DryRunOperationException_(com_amazonaws_kms_DryRunOperationException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_DependencyTimeoutException_(com_amazonaws_kms_DependencyTimeoutException_message_ToDafny(nativeInput.Message)) }() } -func IncorrectTrustAnchorException_ToDafny(nativeInput types.IncorrectTrustAnchorException) ComAmazonawsKmsTypes.Error { +func DisabledException_ToDafny(nativeInput types.DisabledException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectTrustAnchorException_(com_amazonaws_kms_IncorrectTrustAnchorException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_DisabledException_(com_amazonaws_kms_DisabledException_message_ToDafny(nativeInput.Message)) }() } -func KMSInvalidSignatureException_ToDafny(nativeInput types.KMSInvalidSignatureException) ComAmazonawsKmsTypes.Error { +func DryRunOperationException_ToDafny(nativeInput types.DryRunOperationException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidSignatureException_(com_amazonaws_kms_KMSInvalidSignatureException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_DryRunOperationException_(com_amazonaws_kms_DryRunOperationException_message_ToDafny(nativeInput.Message)) }() } -func XksKeyNotFoundException_ToDafny(nativeInput types.XksKeyNotFoundException) ComAmazonawsKmsTypes.Error { +func ExpiredImportTokenException_ToDafny(nativeInput types.ExpiredImportTokenException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyNotFoundException_(com_amazonaws_kms_XksKeyNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_ExpiredImportTokenException_(com_amazonaws_kms_ExpiredImportTokenException_message_ToDafny(nativeInput.Message)) }() } -func CustomKeyStoreHasCMKsException_ToDafny(nativeInput types.CustomKeyStoreHasCMKsException) ComAmazonawsKmsTypes.Error { +func IncorrectKeyException_ToDafny(nativeInput types.IncorrectKeyException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreHasCMKsException_(com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectKeyException_(com_amazonaws_kms_IncorrectKeyException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyInvalidConfigurationException_ToDafny(nativeInput types.XksProxyInvalidConfigurationException) ComAmazonawsKmsTypes.Error { +func IncorrectKeyMaterialException_ToDafny(nativeInput types.IncorrectKeyMaterialException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyInvalidConfigurationException_(com_amazonaws_kms_XksProxyInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectKeyMaterialException_(com_amazonaws_kms_IncorrectKeyMaterialException_message_ToDafny(nativeInput.Message)) }() } -func CustomKeyStoreInvalidStateException_ToDafny(nativeInput types.CustomKeyStoreInvalidStateException) ComAmazonawsKmsTypes.Error { +func IncorrectTrustAnchorException_ToDafny(nativeInput types.IncorrectTrustAnchorException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreInvalidStateException_(com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectTrustAnchorException_(com_amazonaws_kms_IncorrectTrustAnchorException_message_ToDafny(nativeInput.Message)) }() } -func KMSInternalException_ToDafny(nativeInput types.KMSInternalException) ComAmazonawsKmsTypes.Error { +func InvalidAliasNameException_ToDafny(nativeInput types.InvalidAliasNameException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInternalException_(com_amazonaws_kms_KMSInternalException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidAliasNameException_(com_amazonaws_kms_InvalidAliasNameException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyUriEndpointInUseException_ToDafny(nativeInput types.XksProxyUriEndpointInUseException) ComAmazonawsKmsTypes.Error { +func InvalidArnException_ToDafny(nativeInput types.InvalidArnException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriEndpointInUseException_(com_amazonaws_kms_XksProxyUriEndpointInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidArnException_(com_amazonaws_kms_InvalidArnException_message_ToDafny(nativeInput.Message)) }() } -func InvalidAliasNameException_ToDafny(nativeInput types.InvalidAliasNameException) ComAmazonawsKmsTypes.Error { +func InvalidCiphertextException_ToDafny(nativeInput types.InvalidCiphertextException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidAliasNameException_(com_amazonaws_kms_InvalidAliasNameException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidCiphertextException_(com_amazonaws_kms_InvalidCiphertextException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyUriInUseException_ToDafny(nativeInput types.XksProxyUriInUseException) ComAmazonawsKmsTypes.Error { +func InvalidGrantIdException_ToDafny(nativeInput types.InvalidGrantIdException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriInUseException_(com_amazonaws_kms_XksProxyUriInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidGrantIdException_(com_amazonaws_kms_InvalidGrantIdException_message_ToDafny(nativeInput.Message)) }() } -func AlreadyExistsException_ToDafny(nativeInput types.AlreadyExistsException) ComAmazonawsKmsTypes.Error { +func InvalidGrantTokenException_ToDafny(nativeInput types.InvalidGrantTokenException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_AlreadyExistsException_(com_amazonaws_kms_AlreadyExistsException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidGrantTokenException_(com_amazonaws_kms_InvalidGrantTokenException_message_ToDafny(nativeInput.Message)) }() } -func CustomKeyStoreNotFoundException_ToDafny(nativeInput types.CustomKeyStoreNotFoundException) ComAmazonawsKmsTypes.Error { +func InvalidImportTokenException_ToDafny(nativeInput types.InvalidImportTokenException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreNotFoundException_(com_amazonaws_kms_CustomKeyStoreNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidImportTokenException_(com_amazonaws_kms_InvalidImportTokenException_message_ToDafny(nativeInput.Message)) }() } -func IncorrectKeyException_ToDafny(nativeInput types.IncorrectKeyException) ComAmazonawsKmsTypes.Error { +func InvalidKeyUsageException_ToDafny(nativeInput types.InvalidKeyUsageException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectKeyException_(com_amazonaws_kms_IncorrectKeyException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidKeyUsageException_(com_amazonaws_kms_InvalidKeyUsageException_message_ToDafny(nativeInput.Message)) }() } -func KMSInvalidStateException_ToDafny(nativeInput types.KMSInvalidStateException) ComAmazonawsKmsTypes.Error { +func InvalidMarkerException_ToDafny(nativeInput types.InvalidMarkerException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidStateException_(com_amazonaws_kms_KMSInvalidStateException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidMarkerException_(com_amazonaws_kms_InvalidMarkerException_message_ToDafny(nativeInput.Message)) }() } -func XksKeyAlreadyInUseException_ToDafny(nativeInput types.XksKeyAlreadyInUseException) ComAmazonawsKmsTypes.Error { +func KeyUnavailableException_ToDafny(nativeInput types.KeyUnavailableException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyAlreadyInUseException_(com_amazonaws_kms_XksKeyAlreadyInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_KeyUnavailableException_(com_amazonaws_kms_KeyUnavailableException_message_ToDafny(nativeInput.Message)) }() } -func LimitExceededException_ToDafny(nativeInput types.LimitExceededException) ComAmazonawsKmsTypes.Error { +func KMSInternalException_ToDafny(nativeInput types.KMSInternalException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_LimitExceededException_(com_amazonaws_kms_LimitExceededException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInternalException_(com_amazonaws_kms_KMSInternalException_message_ToDafny(nativeInput.Message)) }() } -func NotFoundException_ToDafny(nativeInput types.NotFoundException) ComAmazonawsKmsTypes.Error { +func KMSInvalidMacException_ToDafny(nativeInput types.KMSInvalidMacException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_NotFoundException_(com_amazonaws_kms_NotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidMacException_(com_amazonaws_kms_KMSInvalidMacException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyVpcEndpointServiceInUseException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceInUseException) ComAmazonawsKmsTypes.Error { +func KMSInvalidSignatureException_ToDafny(nativeInput types.KMSInvalidSignatureException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceInUseException_(com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidSignatureException_(com_amazonaws_kms_KMSInvalidSignatureException_message_ToDafny(nativeInput.Message)) }() } -func IncorrectKeyMaterialException_ToDafny(nativeInput types.IncorrectKeyMaterialException) ComAmazonawsKmsTypes.Error { +func KMSInvalidStateException_ToDafny(nativeInput types.KMSInvalidStateException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectKeyMaterialException_(com_amazonaws_kms_IncorrectKeyMaterialException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidStateException_(com_amazonaws_kms_KMSInvalidStateException_message_ToDafny(nativeInput.Message)) }() } -func CloudHsmClusterNotRelatedException_ToDafny(nativeInput types.CloudHsmClusterNotRelatedException) ComAmazonawsKmsTypes.Error { +func LimitExceededException_ToDafny(nativeInput types.LimitExceededException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotRelatedException_(com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_LimitExceededException_(com_amazonaws_kms_LimitExceededException_message_ToDafny(nativeInput.Message)) }() } -func DisabledException_ToDafny(nativeInput types.DisabledException) ComAmazonawsKmsTypes.Error { +func MalformedPolicyDocumentException_ToDafny(nativeInput types.MalformedPolicyDocumentException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_DisabledException_(com_amazonaws_kms_DisabledException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_MalformedPolicyDocumentException_(com_amazonaws_kms_MalformedPolicyDocumentException_message_ToDafny(nativeInput.Message)) }() } -func DependencyTimeoutException_ToDafny(nativeInput types.DependencyTimeoutException) ComAmazonawsKmsTypes.Error { +func NotFoundException_ToDafny(nativeInput types.NotFoundException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_DependencyTimeoutException_(com_amazonaws_kms_DependencyTimeoutException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_NotFoundException_(com_amazonaws_kms_NotFoundException_message_ToDafny(nativeInput.Message)) }() } -func InvalidGrantIdException_ToDafny(nativeInput types.InvalidGrantIdException) ComAmazonawsKmsTypes.Error { +func TagException_ToDafny(nativeInput types.TagException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidGrantIdException_(com_amazonaws_kms_InvalidGrantIdException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_TagException_(com_amazonaws_kms_TagException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyInvalidResponseException_ToDafny(nativeInput types.XksProxyInvalidResponseException) ComAmazonawsKmsTypes.Error { +func UnsupportedOperationException_ToDafny(nativeInput types.UnsupportedOperationException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyInvalidResponseException_(com_amazonaws_kms_XksProxyInvalidResponseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_UnsupportedOperationException_(com_amazonaws_kms_UnsupportedOperationException_message_ToDafny(nativeInput.Message)) }() } -func ConflictException_ToDafny(nativeInput types.ConflictException) ComAmazonawsKmsTypes.Error { +func XksKeyAlreadyInUseException_ToDafny(nativeInput types.XksKeyAlreadyInUseException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_ConflictException_(com_amazonaws_kms_ConflictException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyAlreadyInUseException_(com_amazonaws_kms_XksKeyAlreadyInUseException_message_ToDafny(nativeInput.Message)) }() } -func InvalidKeyUsageException_ToDafny(nativeInput types.InvalidKeyUsageException) ComAmazonawsKmsTypes.Error { +func XksKeyInvalidConfigurationException_ToDafny(nativeInput types.XksKeyInvalidConfigurationException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidKeyUsageException_(com_amazonaws_kms_InvalidKeyUsageException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyInvalidConfigurationException_(com_amazonaws_kms_XksKeyInvalidConfigurationException_message_ToDafny(nativeInput.Message)) }() } -func KeyUnavailableException_ToDafny(nativeInput types.KeyUnavailableException) ComAmazonawsKmsTypes.Error { +func XksKeyNotFoundException_ToDafny(nativeInput types.XksKeyNotFoundException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_KeyUnavailableException_(com_amazonaws_kms_KeyUnavailableException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyNotFoundException_(com_amazonaws_kms_XksKeyNotFoundException_message_ToDafny(nativeInput.Message)) }() } -func CloudHsmClusterNotFoundException_ToDafny(nativeInput types.CloudHsmClusterNotFoundException) ComAmazonawsKmsTypes.Error { +func XksProxyIncorrectAuthenticationCredentialException_ToDafny(nativeInput types.XksProxyIncorrectAuthenticationCredentialException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotFoundException_(com_amazonaws_kms_CloudHsmClusterNotFoundException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyIncorrectAuthenticationCredentialException_(com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_ToDafny(nativeInput.Message)) }() } -func InvalidArnException_ToDafny(nativeInput types.InvalidArnException) ComAmazonawsKmsTypes.Error { +func XksProxyInvalidConfigurationException_ToDafny(nativeInput types.XksProxyInvalidConfigurationException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidArnException_(com_amazonaws_kms_InvalidArnException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyInvalidConfigurationException_(com_amazonaws_kms_XksProxyInvalidConfigurationException_message_ToDafny(nativeInput.Message)) }() } -func CloudHsmClusterInUseException_ToDafny(nativeInput types.CloudHsmClusterInUseException) ComAmazonawsKmsTypes.Error { +func XksProxyInvalidResponseException_ToDafny(nativeInput types.XksProxyInvalidResponseException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterInUseException_(com_amazonaws_kms_CloudHsmClusterInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyInvalidResponseException_(com_amazonaws_kms_XksProxyInvalidResponseException_message_ToDafny(nativeInput.Message)) }() } -func TagException_ToDafny(nativeInput types.TagException) ComAmazonawsKmsTypes.Error { +func XksProxyUriEndpointInUseException_ToDafny(nativeInput types.XksProxyUriEndpointInUseException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_TagException_(com_amazonaws_kms_TagException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriEndpointInUseException_(com_amazonaws_kms_XksProxyUriEndpointInUseException_message_ToDafny(nativeInput.Message)) }() } -func InvalidGrantTokenException_ToDafny(nativeInput types.InvalidGrantTokenException) ComAmazonawsKmsTypes.Error { +func XksProxyUriInUseException_ToDafny(nativeInput types.XksProxyUriInUseException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidGrantTokenException_(com_amazonaws_kms_InvalidGrantTokenException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriInUseException_(com_amazonaws_kms_XksProxyUriInUseException_message_ToDafny(nativeInput.Message)) }() } -func ExpiredImportTokenException_ToDafny(nativeInput types.ExpiredImportTokenException) ComAmazonawsKmsTypes.Error { +func XksProxyUriUnreachableException_ToDafny(nativeInput types.XksProxyUriUnreachableException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_ExpiredImportTokenException_(com_amazonaws_kms_ExpiredImportTokenException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriUnreachableException_(com_amazonaws_kms_XksProxyUriUnreachableException_message_ToDafny(nativeInput.Message)) }() } -func CloudHsmClusterInvalidConfigurationException_ToDafny(nativeInput types.CloudHsmClusterInvalidConfigurationException) ComAmazonawsKmsTypes.Error { +func XksProxyVpcEndpointServiceInUseException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceInUseException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterInvalidConfigurationException_(com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceInUseException_(com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_ToDafny(nativeInput.Message)) }() } -func XksProxyIncorrectAuthenticationCredentialException_ToDafny(nativeInput types.XksProxyIncorrectAuthenticationCredentialException) ComAmazonawsKmsTypes.Error { +func XksProxyVpcEndpointServiceInvalidConfigurationException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceInvalidConfigurationException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyIncorrectAuthenticationCredentialException_(com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceInvalidConfigurationException_(com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_ToDafny(nativeInput.Message)) }() } -func CustomKeyStoreNameInUseException_ToDafny(nativeInput types.CustomKeyStoreNameInUseException) ComAmazonawsKmsTypes.Error { +func XksProxyVpcEndpointServiceNotFoundException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceNotFoundException) ComAmazonawsKmsTypes.Error { return func() ComAmazonawsKmsTypes.Error { - return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreNameInUseException_(com_amazonaws_kms_CustomKeyStoreNameInUseException_message_ToDafny(nativeInput.Message)) + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceNotFoundException_(com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_ToDafny(nativeInput.Message)) }() } @@ -1204,129 +1204,154 @@ func OpaqueError_Input_ToDafny(nativeInput error) ComAmazonawsKmsTypes.Error { func Error_ToDafny(err error) ComAmazonawsKmsTypes.Error { // Service Errors - var XksProxyVpcEndpointServiceInvalidConfigurationException *types.XksProxyVpcEndpointServiceInvalidConfigurationException - if errors.As(err, &XksProxyVpcEndpointServiceInvalidConfigurationException) { - return XksProxyVpcEndpointServiceInvalidConfigurationException_ToDafny(*XksProxyVpcEndpointServiceInvalidConfigurationException) + var AlreadyExistsException *types.AlreadyExistsException + if errors.As(err, &AlreadyExistsException) { + return AlreadyExistsException_ToDafny(*AlreadyExistsException) } - var KMSInvalidMacException *types.KMSInvalidMacException - if errors.As(err, &KMSInvalidMacException) { - return KMSInvalidMacException_ToDafny(*KMSInvalidMacException) + var CloudHsmClusterInUseException *types.CloudHsmClusterInUseException + if errors.As(err, &CloudHsmClusterInUseException) { + return CloudHsmClusterInUseException_ToDafny(*CloudHsmClusterInUseException) } - var UnsupportedOperationException *types.UnsupportedOperationException - if errors.As(err, &UnsupportedOperationException) { - return UnsupportedOperationException_ToDafny(*UnsupportedOperationException) + var CloudHsmClusterInvalidConfigurationException *types.CloudHsmClusterInvalidConfigurationException + if errors.As(err, &CloudHsmClusterInvalidConfigurationException) { + return CloudHsmClusterInvalidConfigurationException_ToDafny(*CloudHsmClusterInvalidConfigurationException) } - var MalformedPolicyDocumentException *types.MalformedPolicyDocumentException - if errors.As(err, &MalformedPolicyDocumentException) { - return MalformedPolicyDocumentException_ToDafny(*MalformedPolicyDocumentException) + var CloudHsmClusterNotActiveException *types.CloudHsmClusterNotActiveException + if errors.As(err, &CloudHsmClusterNotActiveException) { + return CloudHsmClusterNotActiveException_ToDafny(*CloudHsmClusterNotActiveException) } - var XksKeyInvalidConfigurationException *types.XksKeyInvalidConfigurationException - if errors.As(err, &XksKeyInvalidConfigurationException) { - return XksKeyInvalidConfigurationException_ToDafny(*XksKeyInvalidConfigurationException) + var CloudHsmClusterNotFoundException *types.CloudHsmClusterNotFoundException + if errors.As(err, &CloudHsmClusterNotFoundException) { + return CloudHsmClusterNotFoundException_ToDafny(*CloudHsmClusterNotFoundException) } - var XksProxyVpcEndpointServiceNotFoundException *types.XksProxyVpcEndpointServiceNotFoundException - if errors.As(err, &XksProxyVpcEndpointServiceNotFoundException) { - return XksProxyVpcEndpointServiceNotFoundException_ToDafny(*XksProxyVpcEndpointServiceNotFoundException) + var CloudHsmClusterNotRelatedException *types.CloudHsmClusterNotRelatedException + if errors.As(err, &CloudHsmClusterNotRelatedException) { + return CloudHsmClusterNotRelatedException_ToDafny(*CloudHsmClusterNotRelatedException) } - var InvalidCiphertextException *types.InvalidCiphertextException - if errors.As(err, &InvalidCiphertextException) { - return InvalidCiphertextException_ToDafny(*InvalidCiphertextException) + var ConflictException *types.ConflictException + if errors.As(err, &ConflictException) { + return ConflictException_ToDafny(*ConflictException) } - var XksProxyUriUnreachableException *types.XksProxyUriUnreachableException - if errors.As(err, &XksProxyUriUnreachableException) { - return XksProxyUriUnreachableException_ToDafny(*XksProxyUriUnreachableException) + var CustomKeyStoreHasCMKsException *types.CustomKeyStoreHasCMKsException + if errors.As(err, &CustomKeyStoreHasCMKsException) { + return CustomKeyStoreHasCMKsException_ToDafny(*CustomKeyStoreHasCMKsException) } - var InvalidImportTokenException *types.InvalidImportTokenException - if errors.As(err, &InvalidImportTokenException) { - return InvalidImportTokenException_ToDafny(*InvalidImportTokenException) + var CustomKeyStoreInvalidStateException *types.CustomKeyStoreInvalidStateException + if errors.As(err, &CustomKeyStoreInvalidStateException) { + return CustomKeyStoreInvalidStateException_ToDafny(*CustomKeyStoreInvalidStateException) } - var CloudHsmClusterNotActiveException *types.CloudHsmClusterNotActiveException - if errors.As(err, &CloudHsmClusterNotActiveException) { - return CloudHsmClusterNotActiveException_ToDafny(*CloudHsmClusterNotActiveException) + var CustomKeyStoreNameInUseException *types.CustomKeyStoreNameInUseException + if errors.As(err, &CustomKeyStoreNameInUseException) { + return CustomKeyStoreNameInUseException_ToDafny(*CustomKeyStoreNameInUseException) } - var InvalidMarkerException *types.InvalidMarkerException - if errors.As(err, &InvalidMarkerException) { - return InvalidMarkerException_ToDafny(*InvalidMarkerException) - } + var CustomKeyStoreNotFoundException *types.CustomKeyStoreNotFoundException + if errors.As(err, &CustomKeyStoreNotFoundException) { + return CustomKeyStoreNotFoundException_ToDafny(*CustomKeyStoreNotFoundException) + } + + var DependencyTimeoutException *types.DependencyTimeoutException + if errors.As(err, &DependencyTimeoutException) { + return DependencyTimeoutException_ToDafny(*DependencyTimeoutException) + } + + var DisabledException *types.DisabledException + if errors.As(err, &DisabledException) { + return DisabledException_ToDafny(*DisabledException) + } var DryRunOperationException *types.DryRunOperationException if errors.As(err, &DryRunOperationException) { return DryRunOperationException_ToDafny(*DryRunOperationException) } + var ExpiredImportTokenException *types.ExpiredImportTokenException + if errors.As(err, &ExpiredImportTokenException) { + return ExpiredImportTokenException_ToDafny(*ExpiredImportTokenException) + } + + var IncorrectKeyException *types.IncorrectKeyException + if errors.As(err, &IncorrectKeyException) { + return IncorrectKeyException_ToDafny(*IncorrectKeyException) + } + + var IncorrectKeyMaterialException *types.IncorrectKeyMaterialException + if errors.As(err, &IncorrectKeyMaterialException) { + return IncorrectKeyMaterialException_ToDafny(*IncorrectKeyMaterialException) + } + var IncorrectTrustAnchorException *types.IncorrectTrustAnchorException if errors.As(err, &IncorrectTrustAnchorException) { return IncorrectTrustAnchorException_ToDafny(*IncorrectTrustAnchorException) } - var KMSInvalidSignatureException *types.KMSInvalidSignatureException - if errors.As(err, &KMSInvalidSignatureException) { - return KMSInvalidSignatureException_ToDafny(*KMSInvalidSignatureException) + var InvalidAliasNameException *types.InvalidAliasNameException + if errors.As(err, &InvalidAliasNameException) { + return InvalidAliasNameException_ToDafny(*InvalidAliasNameException) } - var XksKeyNotFoundException *types.XksKeyNotFoundException - if errors.As(err, &XksKeyNotFoundException) { - return XksKeyNotFoundException_ToDafny(*XksKeyNotFoundException) + var InvalidArnException *types.InvalidArnException + if errors.As(err, &InvalidArnException) { + return InvalidArnException_ToDafny(*InvalidArnException) } - var CustomKeyStoreHasCMKsException *types.CustomKeyStoreHasCMKsException - if errors.As(err, &CustomKeyStoreHasCMKsException) { - return CustomKeyStoreHasCMKsException_ToDafny(*CustomKeyStoreHasCMKsException) + var InvalidCiphertextException *types.InvalidCiphertextException + if errors.As(err, &InvalidCiphertextException) { + return InvalidCiphertextException_ToDafny(*InvalidCiphertextException) } - var XksProxyInvalidConfigurationException *types.XksProxyInvalidConfigurationException - if errors.As(err, &XksProxyInvalidConfigurationException) { - return XksProxyInvalidConfigurationException_ToDafny(*XksProxyInvalidConfigurationException) + var InvalidGrantIdException *types.InvalidGrantIdException + if errors.As(err, &InvalidGrantIdException) { + return InvalidGrantIdException_ToDafny(*InvalidGrantIdException) } - var CustomKeyStoreInvalidStateException *types.CustomKeyStoreInvalidStateException - if errors.As(err, &CustomKeyStoreInvalidStateException) { - return CustomKeyStoreInvalidStateException_ToDafny(*CustomKeyStoreInvalidStateException) + var InvalidGrantTokenException *types.InvalidGrantTokenException + if errors.As(err, &InvalidGrantTokenException) { + return InvalidGrantTokenException_ToDafny(*InvalidGrantTokenException) } - var KMSInternalException *types.KMSInternalException - if errors.As(err, &KMSInternalException) { - return KMSInternalException_ToDafny(*KMSInternalException) + var InvalidImportTokenException *types.InvalidImportTokenException + if errors.As(err, &InvalidImportTokenException) { + return InvalidImportTokenException_ToDafny(*InvalidImportTokenException) } - var XksProxyUriEndpointInUseException *types.XksProxyUriEndpointInUseException - if errors.As(err, &XksProxyUriEndpointInUseException) { - return XksProxyUriEndpointInUseException_ToDafny(*XksProxyUriEndpointInUseException) + var InvalidKeyUsageException *types.InvalidKeyUsageException + if errors.As(err, &InvalidKeyUsageException) { + return InvalidKeyUsageException_ToDafny(*InvalidKeyUsageException) } - var InvalidAliasNameException *types.InvalidAliasNameException - if errors.As(err, &InvalidAliasNameException) { - return InvalidAliasNameException_ToDafny(*InvalidAliasNameException) + var InvalidMarkerException *types.InvalidMarkerException + if errors.As(err, &InvalidMarkerException) { + return InvalidMarkerException_ToDafny(*InvalidMarkerException) } - var XksProxyUriInUseException *types.XksProxyUriInUseException - if errors.As(err, &XksProxyUriInUseException) { - return XksProxyUriInUseException_ToDafny(*XksProxyUriInUseException) + var KeyUnavailableException *types.KeyUnavailableException + if errors.As(err, &KeyUnavailableException) { + return KeyUnavailableException_ToDafny(*KeyUnavailableException) } - var AlreadyExistsException *types.AlreadyExistsException - if errors.As(err, &AlreadyExistsException) { - return AlreadyExistsException_ToDafny(*AlreadyExistsException) + var KMSInternalException *types.KMSInternalException + if errors.As(err, &KMSInternalException) { + return KMSInternalException_ToDafny(*KMSInternalException) } - var CustomKeyStoreNotFoundException *types.CustomKeyStoreNotFoundException - if errors.As(err, &CustomKeyStoreNotFoundException) { - return CustomKeyStoreNotFoundException_ToDafny(*CustomKeyStoreNotFoundException) + var KMSInvalidMacException *types.KMSInvalidMacException + if errors.As(err, &KMSInvalidMacException) { + return KMSInvalidMacException_ToDafny(*KMSInvalidMacException) } - var IncorrectKeyException *types.IncorrectKeyException - if errors.As(err, &IncorrectKeyException) { - return IncorrectKeyException_ToDafny(*IncorrectKeyException) + var KMSInvalidSignatureException *types.KMSInvalidSignatureException + if errors.As(err, &KMSInvalidSignatureException) { + return KMSInvalidSignatureException_ToDafny(*KMSInvalidSignatureException) } var KMSInvalidStateException *types.KMSInvalidStateException @@ -1334,49 +1359,54 @@ func Error_ToDafny(err error) ComAmazonawsKmsTypes.Error { return KMSInvalidStateException_ToDafny(*KMSInvalidStateException) } - var XksKeyAlreadyInUseException *types.XksKeyAlreadyInUseException - if errors.As(err, &XksKeyAlreadyInUseException) { - return XksKeyAlreadyInUseException_ToDafny(*XksKeyAlreadyInUseException) - } - var LimitExceededException *types.LimitExceededException if errors.As(err, &LimitExceededException) { return LimitExceededException_ToDafny(*LimitExceededException) } + var MalformedPolicyDocumentException *types.MalformedPolicyDocumentException + if errors.As(err, &MalformedPolicyDocumentException) { + return MalformedPolicyDocumentException_ToDafny(*MalformedPolicyDocumentException) + } + var NotFoundException *types.NotFoundException if errors.As(err, &NotFoundException) { return NotFoundException_ToDafny(*NotFoundException) } - var XksProxyVpcEndpointServiceInUseException *types.XksProxyVpcEndpointServiceInUseException - if errors.As(err, &XksProxyVpcEndpointServiceInUseException) { - return XksProxyVpcEndpointServiceInUseException_ToDafny(*XksProxyVpcEndpointServiceInUseException) + var TagException *types.TagException + if errors.As(err, &TagException) { + return TagException_ToDafny(*TagException) } - var IncorrectKeyMaterialException *types.IncorrectKeyMaterialException - if errors.As(err, &IncorrectKeyMaterialException) { - return IncorrectKeyMaterialException_ToDafny(*IncorrectKeyMaterialException) + var UnsupportedOperationException *types.UnsupportedOperationException + if errors.As(err, &UnsupportedOperationException) { + return UnsupportedOperationException_ToDafny(*UnsupportedOperationException) } - var CloudHsmClusterNotRelatedException *types.CloudHsmClusterNotRelatedException - if errors.As(err, &CloudHsmClusterNotRelatedException) { - return CloudHsmClusterNotRelatedException_ToDafny(*CloudHsmClusterNotRelatedException) + var XksKeyAlreadyInUseException *types.XksKeyAlreadyInUseException + if errors.As(err, &XksKeyAlreadyInUseException) { + return XksKeyAlreadyInUseException_ToDafny(*XksKeyAlreadyInUseException) } - var DisabledException *types.DisabledException - if errors.As(err, &DisabledException) { - return DisabledException_ToDafny(*DisabledException) + var XksKeyInvalidConfigurationException *types.XksKeyInvalidConfigurationException + if errors.As(err, &XksKeyInvalidConfigurationException) { + return XksKeyInvalidConfigurationException_ToDafny(*XksKeyInvalidConfigurationException) } - var DependencyTimeoutException *types.DependencyTimeoutException - if errors.As(err, &DependencyTimeoutException) { - return DependencyTimeoutException_ToDafny(*DependencyTimeoutException) + var XksKeyNotFoundException *types.XksKeyNotFoundException + if errors.As(err, &XksKeyNotFoundException) { + return XksKeyNotFoundException_ToDafny(*XksKeyNotFoundException) } - var InvalidGrantIdException *types.InvalidGrantIdException - if errors.As(err, &InvalidGrantIdException) { - return InvalidGrantIdException_ToDafny(*InvalidGrantIdException) + var XksProxyIncorrectAuthenticationCredentialException *types.XksProxyIncorrectAuthenticationCredentialException + if errors.As(err, &XksProxyIncorrectAuthenticationCredentialException) { + return XksProxyIncorrectAuthenticationCredentialException_ToDafny(*XksProxyIncorrectAuthenticationCredentialException) + } + + var XksProxyInvalidConfigurationException *types.XksProxyInvalidConfigurationException + if errors.As(err, &XksProxyInvalidConfigurationException) { + return XksProxyInvalidConfigurationException_ToDafny(*XksProxyInvalidConfigurationException) } var XksProxyInvalidResponseException *types.XksProxyInvalidResponseException @@ -1384,88 +1414,49 @@ func Error_ToDafny(err error) ComAmazonawsKmsTypes.Error { return XksProxyInvalidResponseException_ToDafny(*XksProxyInvalidResponseException) } - var ConflictException *types.ConflictException - if errors.As(err, &ConflictException) { - return ConflictException_ToDafny(*ConflictException) - } - - var InvalidKeyUsageException *types.InvalidKeyUsageException - if errors.As(err, &InvalidKeyUsageException) { - return InvalidKeyUsageException_ToDafny(*InvalidKeyUsageException) - } - - var KeyUnavailableException *types.KeyUnavailableException - if errors.As(err, &KeyUnavailableException) { - return KeyUnavailableException_ToDafny(*KeyUnavailableException) - } - - var CloudHsmClusterNotFoundException *types.CloudHsmClusterNotFoundException - if errors.As(err, &CloudHsmClusterNotFoundException) { - return CloudHsmClusterNotFoundException_ToDafny(*CloudHsmClusterNotFoundException) - } - - var InvalidArnException *types.InvalidArnException - if errors.As(err, &InvalidArnException) { - return InvalidArnException_ToDafny(*InvalidArnException) - } - - var CloudHsmClusterInUseException *types.CloudHsmClusterInUseException - if errors.As(err, &CloudHsmClusterInUseException) { - return CloudHsmClusterInUseException_ToDafny(*CloudHsmClusterInUseException) - } - - var TagException *types.TagException - if errors.As(err, &TagException) { - return TagException_ToDafny(*TagException) + var XksProxyUriEndpointInUseException *types.XksProxyUriEndpointInUseException + if errors.As(err, &XksProxyUriEndpointInUseException) { + return XksProxyUriEndpointInUseException_ToDafny(*XksProxyUriEndpointInUseException) } - var InvalidGrantTokenException *types.InvalidGrantTokenException - if errors.As(err, &InvalidGrantTokenException) { - return InvalidGrantTokenException_ToDafny(*InvalidGrantTokenException) + var XksProxyUriInUseException *types.XksProxyUriInUseException + if errors.As(err, &XksProxyUriInUseException) { + return XksProxyUriInUseException_ToDafny(*XksProxyUriInUseException) } - var ExpiredImportTokenException *types.ExpiredImportTokenException - if errors.As(err, &ExpiredImportTokenException) { - return ExpiredImportTokenException_ToDafny(*ExpiredImportTokenException) + var XksProxyUriUnreachableException *types.XksProxyUriUnreachableException + if errors.As(err, &XksProxyUriUnreachableException) { + return XksProxyUriUnreachableException_ToDafny(*XksProxyUriUnreachableException) } - var CloudHsmClusterInvalidConfigurationException *types.CloudHsmClusterInvalidConfigurationException - if errors.As(err, &CloudHsmClusterInvalidConfigurationException) { - return CloudHsmClusterInvalidConfigurationException_ToDafny(*CloudHsmClusterInvalidConfigurationException) + var XksProxyVpcEndpointServiceInUseException *types.XksProxyVpcEndpointServiceInUseException + if errors.As(err, &XksProxyVpcEndpointServiceInUseException) { + return XksProxyVpcEndpointServiceInUseException_ToDafny(*XksProxyVpcEndpointServiceInUseException) } - var XksProxyIncorrectAuthenticationCredentialException *types.XksProxyIncorrectAuthenticationCredentialException - if errors.As(err, &XksProxyIncorrectAuthenticationCredentialException) { - return XksProxyIncorrectAuthenticationCredentialException_ToDafny(*XksProxyIncorrectAuthenticationCredentialException) + var XksProxyVpcEndpointServiceInvalidConfigurationException *types.XksProxyVpcEndpointServiceInvalidConfigurationException + if errors.As(err, &XksProxyVpcEndpointServiceInvalidConfigurationException) { + return XksProxyVpcEndpointServiceInvalidConfigurationException_ToDafny(*XksProxyVpcEndpointServiceInvalidConfigurationException) } - var CustomKeyStoreNameInUseException *types.CustomKeyStoreNameInUseException - if errors.As(err, &CustomKeyStoreNameInUseException) { - return CustomKeyStoreNameInUseException_ToDafny(*CustomKeyStoreNameInUseException) + var XksProxyVpcEndpointServiceNotFoundException *types.XksProxyVpcEndpointServiceNotFoundException + if errors.As(err, &XksProxyVpcEndpointServiceNotFoundException) { + return XksProxyVpcEndpointServiceNotFoundException_ToDafny(*XksProxyVpcEndpointServiceNotFoundException) } return OpaqueError_Input_ToDafny(err) } -func com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_DryRun_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_CancelKeyDeletionRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(*input) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CancelKeyDeletionResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1474,71 +1465,43 @@ func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_ToDafny(input }() } -func com_amazonaws_kms_SignResponse_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec)) - }() -} - -func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(input *types.XksProxyAuthenticationCredentialType) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_ConnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyAuthenticationCredentialType_.Create_XksProxyAuthenticationCredentialType_(com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_ToDafny(input.RawSecretAccessKey))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } +func com_amazonaws_kms_CreateAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ReEncryptResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} +func com_amazonaws_kms_CreateAliasRequest_TargetKeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - for _, e := range input { - v = append(v, e) + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_KeyListEntry_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1547,7 +1510,7 @@ func com_amazonaws_kms_KeyListEntry_KeyId_ToDafny(input *string) Wrappers.Option }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_TrustAnchorCertificate_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1556,18 +1519,16 @@ func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(i }() } -func com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_KeyStorePassword_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateDataKeyRequest_KeySpec_ToDafny(input types.DataKeySpec) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreType_ToDafny(input types.CustomKeyStoreType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -1577,27 +1538,27 @@ func com_amazonaws_kms_GenerateDataKeyRequest_KeySpec_ToDafny(input types.DataKe } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeySpec)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomKeyStoreType)) }() } -func com_amazonaws_kms_DeleteCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1606,24 +1567,30 @@ func com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input *string) Wrappers. }() } -func com_amazonaws_kms_ReEncryptResponse_SourceEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(input *types.XksProxyAuthenticationCredentialType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyAuthenticationCredentialType_.Create_XksProxyAuthenticationCredentialType_(com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_ToDafny(input.RawSecretAccessKey))) + }() +} + +func com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } @@ -1636,7 +1603,7 @@ func com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_T }() } -func com_amazonaws_kms_CreateKeyRequest_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -1646,27 +1613,27 @@ func com_amazonaws_kms_CreateKeyRequest_KeySpec_ToDafny(input types.KeySpec) Wra } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) }() } -func com_amazonaws_kms_DescribeCustomKeyStoresRequest_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_CreateCustomKeyStoreResponse_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ReplicateKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_CreateGrantRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -1675,17 +1642,16 @@ func com_amazonaws_kms_ReplicateKeyRequest_KeyId_ToDafny(input *string) dafny.Se }() } -func com_amazonaws_kms_RotationsListEntry_RotationDate_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_CreateGrantRequest_GranteePrincipal_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ConflictException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateGrantRequest_RetiringPrincipal_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1694,22 +1660,22 @@ func com_amazonaws_kms_ConflictException_message_ToDafny(input *string) Wrappers }() } -func com_amazonaws_kms_ListGrantsResponse_Grants_ToDafny(input []types.GrantListEntry) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_CreateGrantRequest_Operations_ToDafny(input []types.GrantOperation) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_GrantList_member_ToDafny(val) + element := com_amazonaws_kms_GrantOperationList_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_GrantOperationList_member_ToDafny(input types.GrantOperation) ComAmazonawsKmsTypes.GrantOperation { + return func() ComAmazonawsKmsTypes.GrantOperation { var index int for _, enumVal := range input.Values() { index++ @@ -1718,27 +1684,84 @@ func com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input types.KeyUsageType) Wr } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_GrantOperation_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) + return enum.(ComAmazonawsKmsTypes.GrantOperation) }() } -func com_amazonaws_kms_CancelKeyDeletionRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_CreateGrantRequest_Constraints_ToDafny(input *types.GrantConstraints) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_GrantConstraints_.Create_GrantConstraints_(com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input.EncryptionContextSubset), com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input.EncryptionContextEquals))) + }() +} + +func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_EncryptionContextType_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_EncryptionContextType_value_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GrantTokenList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_Name_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1747,14 +1770,16 @@ func com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_ToDafny( }() } -func com_amazonaws_kms_ReplicateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_kms_CreateGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateGrantResponse_GrantToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1763,16 +1788,16 @@ func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input }() } -func com_amazonaws_kms_GetKeyPolicyRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_CreateGrantResponse_GrantId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_DescribeCustomKeyStoresRequest_Marker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateKeyRequest_Policy_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1781,25 +1806,79 @@ func com_amazonaws_kms_DescribeCustomKeyStoresRequest_Marker_ToDafny(input *stri }() } -func com_amazonaws_kms_CloudHsmClusterNotActiveException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateKeyRequest_Description_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) }() } -func com_amazonaws_kms_InvalidMarkerException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateKeyRequest_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) }() } -func com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input types.KeyManagerType) Wrappers.Option { +func com_amazonaws_kms_CreateKeyRequest_Origin_ToDafny(input types.OriginType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -1809,57 +1888,64 @@ func com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input types.KeyManagerType } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyManagerType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyManagerType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) }() } -func com_amazonaws_kms_TagKeyList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_kms_CreateKeyRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyList_member_ToDafny(input types.KeyListEntry) ComAmazonawsKmsTypes.KeyListEntry { - return func() ComAmazonawsKmsTypes.KeyListEntry { +func com_amazonaws_kms_CreateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { - return ComAmazonawsKmsTypes.Companion_KeyListEntry_.Create_KeyListEntry_(com_amazonaws_kms_KeyListEntry_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyListEntry_KeyArn_ToDafny(input.KeyArn)) + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_CreateKeyRequest_MultiRegion_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_CreateKeyRequest_Tags_ToDafny(input []types.Tag) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_ListResourceTagsResponse_Truncated_ToDafny(input bool) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_TagList_member_ToDafny(input types.Tag) ComAmazonawsKmsTypes.Tag { + return func() ComAmazonawsKmsTypes.Tag { - return Wrappers.Companion_Option_.Create_Some_(input) + return ComAmazonawsKmsTypes.Companion_Tag_.Create_Tag_(com_amazonaws_kms_Tag_TagKey_ToDafny(input.TagKey), com_amazonaws_kms_Tag_TagValue_ToDafny(input.TagValue)) }() } -func com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_Tag_TagKey_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_PutKeyPolicyRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_Tag_TagValue_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -1868,38 +1954,34 @@ func com_amazonaws_kms_PutKeyPolicyRequest_KeyId_ToDafny(input *string) dafny.Se }() } -func com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CreateKeyRequest_MultiRegion_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_EncryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_CreateKeyRequest_XksKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateMacResponse_Mac_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_CreateKeyResponse_KeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) }() } -func com_amazonaws_kms_RotateKeyOnDemandResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -1908,14 +1990,7 @@ func com_amazonaws_kms_RotateKeyOnDemandResponse_KeyId_ToDafny(input *string) Wr }() } -func com_amazonaws_kms_MultiRegionKeyList_member_ToDafny(input types.MultiRegionKey) ComAmazonawsKmsTypes.MultiRegionKey { - return func() ComAmazonawsKmsTypes.MultiRegionKey { - - return ComAmazonawsKmsTypes.Companion_MultiRegionKey_.Create_MultiRegionKey_(com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input.Arn), com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input.Region)) - }() -} - -func com_amazonaws_kms_GetParametersForImportRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -1924,25 +1999,42 @@ func com_amazonaws_kms_GetParametersForImportRequest_KeyId_ToDafny(input *string }() } -func com_amazonaws_kms_ListKeysRequest_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ListKeyRotationsRequest_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_VerifyMacResponse_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_KeyMetadata_Description_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -1952,18 +2044,18 @@ func com_amazonaws_kms_VerifyMacResponse_MacAlgorithm_ToDafny(input types.MacAlg } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) }() } -func com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input types.OriginType) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input types.KeyState) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -1973,66 +2065,38 @@ func com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input types.OriginType) Wrappe } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) - }() -} - -func com_amazonaws_kms_XksProxyInvalidResponseException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_CloudHsmClusterNotFoundException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyState)) }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_kms_PolicyNameList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_ListKeyRotationsResponse_Rotations_ToDafny(input []types.RotationsListEntry) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_RotationsList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_GetPublicKeyResponse_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input types.OriginType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2042,109 +2106,36 @@ func com_amazonaws_kms_GetPublicKeyResponse_KeySpec_ToDafny(input types.KeySpec) } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) - }() -} - -func com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_RotationsListEntry_KeyId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_ReplicateKeyRequest_Tags_ToDafny(input []types.Tag) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_TagList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_kms_CreateGrantRequest_Operations_ToDafny(input []types.GrantOperation) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_GrantOperationList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) - }() -} - -func com_amazonaws_kms_ListResourceTagsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_CreateAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) }() } -func com_amazonaws_kms_ReplicateKeyResponse_ReplicaKeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) - }() -} - -func com_amazonaws_kms_UpdateAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input types.KeyEncryptionMechanism) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input types.ExpirationModelType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2154,19 +2145,19 @@ func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input types. } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyEncryptionMechanism_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyEncryptionMechanism)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ExpirationModelType)) }() } -func com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { - return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { +func com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input types.KeyManagerType) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -2175,105 +2166,165 @@ func com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(input types.Signi } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyManagerType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyManagerType)) }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) }() } -func com_amazonaws_kms_DeriveSharedSecretResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_ListKeyRotationsRequest_Marker_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_KeyStorePassword_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input []types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_VerifyRequest_DryRun_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(input types.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(*input) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) }() } -func com_amazonaws_kms_ScheduleKeyDeletionResponse_PendingWindowInDays_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input []types.SigningAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_UpdatePrimaryRegionRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil +func com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { + return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input []types.KeyAgreementAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_AliasListEntry_LastUpdatedDate_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(input types.KeyAgreementAlgorithmSpec) ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { + return func() ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) }() } -func com_amazonaws_kms_RevokeGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2282,47 +2333,55 @@ func com_amazonaws_kms_RevokeGrantRequest_DryRun_ToDafny(input *bool) Wrappers.O }() } -func com_amazonaws_kms_ListResourceTagsRequest_Marker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input *types.MultiRegionConfiguration) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_MultiRegionConfiguration_.Create_MultiRegionConfiguration_(com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_ToDafny(input.MultiRegionKeyType), com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_ToDafny(input.PrimaryKey), com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_ToDafny(input.ReplicaKeys))) }() } -func com_amazonaws_kms_XksProxyUriInUseException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_ToDafny(input types.MultiRegionKeyType) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MultiRegionKeyType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MultiRegionKeyType)) }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PrivateKeyCiphertextBlob_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_ToDafny(input *types.MultiRegionKey) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_MultiRegionKey_.Create_MultiRegionKey_(com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input.Arn), com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input.Region))) }() } -func com_amazonaws_kms_UntagResourceRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CreateKeyRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2331,58 +2390,52 @@ func com_amazonaws_kms_CreateKeyRequest_CustomKeyStoreId_ToDafny(input *string) }() } -func com_amazonaws_kms_EncryptRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_ToDafny(input []types.MultiRegionKey) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_MultiRegionKeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_DecryptResponse_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) +func com_amazonaws_kms_MultiRegionKeyList_member_ToDafny(input types.MultiRegionKey) ComAmazonawsKmsTypes.MultiRegionKey { + return func() ComAmazonawsKmsTypes.MultiRegionKey { + + return ComAmazonawsKmsTypes.Companion_MultiRegionKey_.Create_MultiRegionKey_(com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input.Arn), com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input.Region)) }() } -func com_amazonaws_kms_ReplicateKeyRequest_Description_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input []types.MacAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_MacAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_GetParametersForImportRequest_WrappingAlgorithm_ToDafny(input types.AlgorithmSpec) ComAmazonawsKmsTypes.AlgorithmSpec { - return func() ComAmazonawsKmsTypes.AlgorithmSpec { +func com_amazonaws_kms_MacAlgorithmSpecList_member_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { + return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { var index int for _, enumVal := range input.Values() { index++ @@ -2391,27 +2444,27 @@ func com_amazonaws_kms_GetParametersForImportRequest_WrappingAlgorithm_ToDafny(i } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_AlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.AlgorithmSpec) + return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) }() } -func com_amazonaws_kms_InvalidImportTokenException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input *types.XksKeyConfigurationType) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksKeyConfigurationType_.Create_XksKeyConfigurationType_(com_amazonaws_kms_XksKeyConfigurationType_Id_ToDafny(input.Id))) }() } -func com_amazonaws_kms_UnsupportedOperationException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_XksKeyConfigurationType_Id_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2420,20 +2473,20 @@ func com_amazonaws_kms_UnsupportedOperationException_message_ToDafny(input *stri }() } -func com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyCiphertextBlob_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_DecryptRequest_CiphertextBlob_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_DecryptRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() @@ -2444,45 +2497,31 @@ func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_EncryptionContext_ }() } -func com_amazonaws_kms_GrantListEntry_Operations_ToDafny(input []types.GrantOperation) Wrappers.Option { +func com_amazonaws_kms_DecryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_GrantOperationList_member_ToDafny(val) + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_EncryptionContextType_value_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func com_amazonaws_kms_DeleteImportedKeyMaterialRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_DecryptRequest_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_kms_RotationsList_member_ToDafny(input types.RotationsListEntry) ComAmazonawsKmsTypes.RotationsListEntry { - return func() ComAmazonawsKmsTypes.RotationsListEntry { - - return ComAmazonawsKmsTypes.Companion_RotationsListEntry_.Create_RotationsListEntry_(com_amazonaws_kms_RotationsListEntry_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_RotationsListEntry_RotationDate_ToDafny(input.RotationDate), com_amazonaws_kms_RotationsListEntry_RotationType_ToDafny(input.RotationType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_VerifyRequest_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { - return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { +func com_amazonaws_kms_DecryptRequest_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -2491,19 +2530,28 @@ func com_amazonaws_kms_VerifyRequest_SigningAlgorithm_ToDafny(input types.Signin } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) }() } -func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(input types.KeyAgreementAlgorithmSpec) ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { - return func() ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { +func com_amazonaws_kms_DecryptRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + }() +} + +func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input types.KeyEncryptionMechanism) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -2512,27 +2560,40 @@ func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(input types. } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyEncryptionMechanism_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyEncryptionMechanism)) }() } -func com_amazonaws_kms_DeriveSharedSecretRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_DecryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_DecryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2541,7 +2602,7 @@ func com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_ToDafny(input }() } -func com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyPlaintext_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_DecryptResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -2554,56 +2615,78 @@ func com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyPlaintext_ToDafny(i }() } -func com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input []types.KeyAgreementAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_DecryptResponse_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) }() } -func com_amazonaws_kms_PutKeyPolicyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_kms_DecryptResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} - return Wrappers.Companion_Option_.Create_Some_(input) +func com_amazonaws_kms_DeleteAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_AliasListEntry_AliasName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_DeleteCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ListGrantsRequest_GrantId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_DeleteImportedKeyMaterialRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ListGrantsRequest_GranteePrincipal_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_GetPublicKeyResponse_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretRequest_KeyAgreementAlgorithm_ToDafny(input types.KeyAgreementAlgorithmSpec) ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { + return func() ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { var index int for _, enumVal := range input.Values() { index++ @@ -2612,63 +2695,72 @@ func com_amazonaws_kms_GetPublicKeyResponse_KeyUsage_ToDafny(input types.KeyUsag } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) + return enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_DeriveSharedSecretRequest_PublicKey_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { + var v []interface{} if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_GetKeyPolicyResponse_PolicyName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_ListGrantsRequest_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) }() } -func com_amazonaws_kms_ReplicateKeyRequest_ReplicaRegion_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_DeriveSharedSecretResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_DecryptResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretResponse_SharedSecret_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -2681,47 +2773,42 @@ func com_amazonaws_kms_DecryptResponse_CiphertextForRecipient_ToDafny(input []by }() } -func com_amazonaws_kms_DisconnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_kms_SignRequest_DryRun_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input []types.SigningAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_ListGrantsResponse_Truncated_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_kms_DeriveSharedSecretResponse_KeyAgreementAlgorithm_ToDafny(input types.KeyAgreementAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec)) }() } -func com_amazonaws_kms_MacAlgorithmSpecList_member_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { - return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { +func com_amazonaws_kms_DeriveSharedSecretResponse_KeyOrigin_ToDafny(input types.OriginType) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -2730,27 +2817,27 @@ func com_amazonaws_kms_MacAlgorithmSpecList_member_ToDafny(input types.MacAlgori } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) }() } -func com_amazonaws_kms_ListGrantsRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_NotFoundException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2759,69 +2846,82 @@ func com_amazonaws_kms_NotFoundException_message_ToDafny(input *string) Wrappers }() } -func com_amazonaws_kms_CreateAliasRequest_TargetKeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_GetPublicKeyResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_Marker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_DescribeCustomKeyStoresResponse_CustomKeyStores_ToDafny(input []types.CustomKeyStoresListEntry) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_CustomKeyStoresList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_VerifyMacRequest_Message_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} +func com_amazonaws_kms_CustomKeyStoresList_member_ToDafny(input types.CustomKeyStoresListEntry) ComAmazonawsKmsTypes.CustomKeyStoresListEntry { + return func() ComAmazonawsKmsTypes.CustomKeyStoresListEntry { + + return ComAmazonawsKmsTypes.Companion_CustomKeyStoresListEntry_.Create_CustomKeyStoresListEntry_(com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_ToDafny(input.CustomKeyStoreName), com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_ToDafny(input.TrustAnchorCertificate), com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_ToDafny(input.ConnectionState), com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_ToDafny(input.ConnectionErrorCode), com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_ToDafny(input.CustomKeyStoreType), com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_ToDafny(input.XksProxyConfiguration)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateMacRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input *types.MultiRegionConfiguration) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_MultiRegionConfiguration_.Create_MultiRegionConfiguration_(com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_ToDafny(input.MultiRegionKeyType), com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_ToDafny(input.PrimaryKey), com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_ToDafny(input.ReplicaKeys))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_EncryptRequest_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_ToDafny(input types.ConnectionStateType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2831,18 +2931,18 @@ func com_amazonaws_kms_EncryptRequest_EncryptionAlgorithm_ToDafny(input types.En } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionStateType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ConnectionStateType)) }() } -func com_amazonaws_kms_SignRequest_MessageType_ToDafny(input types.MessageType) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_ToDafny(input types.ConnectionErrorCodeType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2852,18 +2952,18 @@ func com_amazonaws_kms_SignRequest_MessageType_ToDafny(input types.MessageType) } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionErrorCodeType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MessageType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ConnectionErrorCodeType)) }() } -func com_amazonaws_kms_ImportKeyMaterialRequest_ValidTo_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2873,7 +2973,7 @@ func com_amazonaws_kms_ImportKeyMaterialRequest_ValidTo_ToDafny(input *time.Time }() } -func com_amazonaws_kms_EncryptResponse_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_ToDafny(input types.CustomKeyStoreType) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -2883,55 +2983,66 @@ func com_amazonaws_kms_EncryptResponse_EncryptionAlgorithm_ToDafny(input types.E } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomKeyStoreType)) }() } -func com_amazonaws_kms_AliasList_member_ToDafny(input types.AliasListEntry) ComAmazonawsKmsTypes.AliasListEntry { - return func() ComAmazonawsKmsTypes.AliasListEntry { - - return ComAmazonawsKmsTypes.Companion_AliasListEntry_.Create_AliasListEntry_(com_amazonaws_kms_AliasListEntry_AliasName_ToDafny(input.AliasName), com_amazonaws_kms_AliasListEntry_AliasArn_ToDafny(input.AliasArn), com_amazonaws_kms_AliasListEntry_TargetKeyId_ToDafny(input.TargetKeyId), com_amazonaws_kms_AliasListEntry_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_AliasListEntry_LastUpdatedDate_ToDafny(input.LastUpdatedDate)) +func com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_ToDafny(input *types.XksProxyConfigurationType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyConfigurationType_.Create_XksProxyConfigurationType_(com_amazonaws_kms_XksProxyConfigurationType_Connectivity_ToDafny(input.Connectivity), com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_ToDafny(input.UriEndpoint), com_amazonaws_kms_XksProxyConfigurationType_UriPath_ToDafny(input.UriPath), com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_ToDafny(input.VpcEndpointServiceName))) }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_XksProxyConfigurationType_Connectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) }() } -func com_amazonaws_kms_VerifyMacRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GetKeyRotationStatusResponse_OnDemandRotationStartDate_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ReEncryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_XksProxyConfigurationType_UriPath_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2940,7 +3051,7 @@ func com_amazonaws_kms_ReEncryptResponse_KeyId_ToDafny(input *string) Wrappers.O }() } -func com_amazonaws_kms_InvalidCiphertextException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -2949,145 +3060,156 @@ func com_amazonaws_kms_InvalidCiphertextException_message_ToDafny(input *string) }() } -func com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input *types.XksKeyConfigurationType) Wrappers.Option { +func com_amazonaws_kms_DescribeCustomKeyStoresResponse_NextMarker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksKeyConfigurationType_.Create_XksKeyConfigurationType_(com_amazonaws_kms_XksKeyConfigurationType_Id_ToDafny(input.Id))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ListKeyRotationsResponse_Truncated_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_kms_DescribeCustomKeyStoresResponse_Truncated_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_DescribeCustomKeyStoresResponse_CustomKeyStores_ToDafny(input []types.CustomKeyStoresListEntry) Wrappers.Option { +func com_amazonaws_kms_DescribeKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DescribeKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_CustomKeyStoresList_member_ToDafny(val) + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_RetireGrantRequest_GrantId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_DescribeKeyResponse_KeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) }() } -func com_amazonaws_kms_GenerateDataKeyResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} +func com_amazonaws_kms_DisableKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_GenerateRandomResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} +func com_amazonaws_kms_DisableKeyRotationRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_KMSInvalidSignatureException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_DisconnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_EncryptionContextType_key_ToDafny(input string) dafny.Sequence { +func com_amazonaws_kms_EnableKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_GrantListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_EnableKeyRotationRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_CreateGrantResponse_GrantToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_EnableKeyRotationRequest_RotationPeriodInDays_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_GetParametersForImportResponse_ImportToken_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} +func com_amazonaws_kms_EncryptRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ListKeyPoliciesResponse_Truncated_ToDafny(input bool) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) +func com_amazonaws_kms_EncryptRequest_Plaintext_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_AliasListEntry_AliasArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_EncryptRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_EncryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_CreateKeyRequest_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { +func com_amazonaws_kms_EncryptRequest_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3097,39 +3219,27 @@ func com_amazonaws_kms_CreateKeyRequest_CustomerMasterKeySpec_ToDafny(input type } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) }() } -func com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input types.KeyState) Wrappers.Option { +func com_amazonaws_kms_EncryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyState)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_EncryptResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -3142,7 +3252,7 @@ func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PublicKey_ToD }() } -func com_amazonaws_kms_RetireGrantRequest_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_EncryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3151,26 +3261,58 @@ func com_amazonaws_kms_RetireGrantRequest_KeyId_ToDafny(input *string) Wrappers. }() } -func com_amazonaws_kms_CreateGrantRequest_RetiringPrincipal_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_EncryptResponse_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_CreateGrantResponse_GrantId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_SignRequest_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { - return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { +func com_amazonaws_kms_GenerateDataKeyRequest_KeySpec_ToDafny(input types.DataKeySpec) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -3179,46 +3321,50 @@ func com_amazonaws_kms_SignRequest_SigningAlgorithm_ToDafny(input types.SigningA } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeySpec)) }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_ReplicateKeyResponse_ReplicaPolicy_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) }() } -func com_amazonaws_kms_GetKeyRotationStatusResponse_NextRotationDate_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -3231,16 +3377,20 @@ func com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input []byte) W }() } -func com_amazonaws_kms_TagResourceRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_GenerateDataKeyResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3249,34 +3399,31 @@ func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input *string) Wrapp }() } -func com_amazonaws_kms_RetireGrantRequest_GrantToken_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_ListKeyPoliciesRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil + for _, e := range input { + v = append(v, e) } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_GetParametersForImportResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_kms_Tag_TagKey_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_GenerateDataKeyPairRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -3285,8 +3432,8 @@ func com_amazonaws_kms_Tag_TagKey_ToDafny(input *string) dafny.Sequence { }() } -func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairRequest_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) ComAmazonawsKmsTypes.DataKeyPairSpec { + return func() ComAmazonawsKmsTypes.DataKeyPairSpec { var index int for _, enumVal := range input.Values() { index++ @@ -3295,41 +3442,41 @@ func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input types.Cus } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) + return enum.(ComAmazonawsKmsTypes.DataKeyPairSpec) }() } -func com_amazonaws_kms_ListResourceTagsResponse_Tags_ToDafny(input []types.Tag) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_TagList_member_ToDafny(val) + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) }() } -func com_amazonaws_kms_EnableKeyRotationRequest_RotationPeriodInDays_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3338,96 +3485,46 @@ func com_amazonaws_kms_EnableKeyRotationRequest_RotationPeriodInDays_ToDafny(inp }() } -func com_amazonaws_kms_UntagResourceRequest_TagKeys_ToDafny(input []string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_TagKeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) - }() -} - -func com_amazonaws_kms_GrantListEntry_GranteePrincipal_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyCiphertextBlob_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_DeriveSharedSecretResponse_KeyAgreementAlgorithm_ToDafny(input types.KeyAgreementAlgorithmSpec) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec)) - }() -} - -func com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input []types.EncryptionAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyPlaintext_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) - }() -} - -func com_amazonaws_kms_ConnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil + for _, e := range input { + v = append(v, e) } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_GenerateMacRequest_Message_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_GenerateDataKeyPairResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } for _, e := range input { v = append(v, e) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_LimitExceededException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3436,7 +3533,7 @@ func com_amazonaws_kms_LimitExceededException_message_ToDafny(input *string) Wra }() } -func com_amazonaws_kms_RotationsListEntry_RotationType_ToDafny(input types.RotationType) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairResponse_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3446,19 +3543,52 @@ func com_amazonaws_kms_RotationsListEntry_RotationType_ToDafny(input types.Rotat } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_RotationType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.RotationType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeyPairSpec)) }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) ComAmazonawsKmsTypes.DataKeyPairSpec { + return func() ComAmazonawsKmsTypes.DataKeyPairSpec { var index int for _, enumVal := range input.Values() { index++ @@ -3474,29 +3604,11 @@ func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyPairSpec_T break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeyPairSpec)) - }() -} - -func com_amazonaws_kms_DisabledException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return enum.(ComAmazonawsKmsTypes.DataKeyPairSpec) }() } -func com_amazonaws_kms_GenerateMacRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3510,7 +3622,7 @@ func com_amazonaws_kms_GenerateMacRequest_GrantTokens_ToDafny(input []string) Wr }() } -func com_amazonaws_kms_ListKeyPoliciesRequest_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3519,41 +3631,33 @@ func com_amazonaws_kms_ListKeyPoliciesRequest_Limit_ToDafny(input *int32) Wrappe }() } -func com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PrivateKeyCiphertextBlob_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_CreateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) - }() -} - -func com_amazonaws_kms_CreateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_VerifyMacResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_GrantListEntry_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3562,7 +3666,7 @@ func com_amazonaws_kms_GrantListEntry_KeyId_ToDafny(input *string) Wrappers.Opti }() } -func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyState_ToDafny(input types.KeyState) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3572,32 +3676,38 @@ func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyState_ToDafny(input types. } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyState)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeyPairSpec)) }() } -func com_amazonaws_kms_ReplicateKeyResponse_ReplicaTags_ToDafny(input []types.Tag) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_TagList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_kms_GenerateDataKeyPairResponse_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeySpec_ToDafny(input types.DataKeySpec) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -3607,57 +3717,50 @@ func com_amazonaws_kms_GenerateDataKeyPairResponse_KeyPairSpec_ToDafny(input typ } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeyPairSpec)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeySpec)) }() } -func com_amazonaws_kms_DescribeCustomKeyStoresResponse_NextMarker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_VerifyMacRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_GenerateMacRequest_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { - return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_DeriveSharedSecretResponse_SharedSecret_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -3670,39 +3773,29 @@ func com_amazonaws_kms_DeriveSharedSecretResponse_SharedSecret_ToDafny(input []b }() } -func com_amazonaws_kms_GetKeyRotationStatusRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_TagResourceRequest_Tags_ToDafny(input []types.Tag) dafny.Sequence { +func com_amazonaws_kms_GenerateMacRequest_Message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { + var v []interface{} if input == nil { return nil } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_TagList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) - }() -} - -func com_amazonaws_kms_CloudHsmClusterInUseException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + for _, e := range input { + v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_UpdatePrimaryRegionRequest_PrimaryRegion_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_GenerateMacRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -3711,25 +3804,28 @@ func com_amazonaws_kms_UpdatePrimaryRegionRequest_PrimaryRegion_ToDafny(input *s }() } -func com_amazonaws_kms_GenerateDataKeyResponse_KeyId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_kms_GenerateMacRequest_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { + return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_GetPublicKeyResponse_KeyId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_GenerateMacRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3743,16 +3839,16 @@ func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_GrantTokens_ToDafn }() } -func com_amazonaws_kms_XksProxyUriUnreachableException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateMacRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_GenerateDataKeyPairResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_GenerateMacResponse_Mac_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -3765,8 +3861,8 @@ func com_amazonaws_kms_GenerateDataKeyPairResponse_PublicKey_ToDafny(input []byt }() } -func com_amazonaws_kms_DeriveSharedSecretRequest_KeyAgreementAlgorithm_ToDafny(input types.KeyAgreementAlgorithmSpec) ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { - return func() ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { +func com_amazonaws_kms_GenerateMacResponse_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -3775,25 +3871,18 @@ func com_amazonaws_kms_DeriveSharedSecretRequest_KeyAgreementAlgorithm_ToDafny(i } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break - } - } - return enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) - }() -} - -func com_amazonaws_kms_VerifyMacResponse_MacValid_ToDafny(input bool) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec)) }() } -func com_amazonaws_kms_TagException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateMacResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3802,7 +3891,7 @@ func com_amazonaws_kms_TagException_message_ToDafny(input *string) Wrappers.Opti }() } -func com_amazonaws_kms_RetireGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_GenerateRandomRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3811,98 +3900,103 @@ func com_amazonaws_kms_RetireGrantRequest_DryRun_ToDafny(input *bool) Wrappers.O }() } -func com_amazonaws_kms_RotateKeyOnDemandRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_GenerateRandomRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KMSInvalidMacException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GenerateRandomRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) }() } -func com_amazonaws_kms_ListAliasesRequest_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_GenerateRandomResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_CreateGrantRequest_Constraints_ToDafny(input *types.GrantConstraints) Wrappers.Option { +func com_amazonaws_kms_GenerateRandomResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_GrantConstraints_.Create_GrantConstraints_(com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input.EncryptionContextSubset), com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input.EncryptionContextEquals))) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_CreateGrantRequest_Name_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_GetKeyPolicyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_GetPublicKeyResponse_KeyAgreementAlgorithms_ToDafny(input []types.KeyAgreementAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_GetKeyPolicyRequest_PolicyName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CreateGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_GetKeyPolicyResponse_Policy_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateMacRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_GetKeyPolicyResponse_PolicyName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GetPublicKeyResponse_SigningAlgorithms_ToDafny(input []types.SigningAlgorithmSpec) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_GetKeyRotationStatusRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ListKeyRotationsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetKeyRotationStatusResponse_KeyRotationEnabled_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_GetKeyRotationStatusResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3911,42 +4005,46 @@ func com_amazonaws_kms_ListKeyRotationsResponse_NextMarker_ToDafny(input *string }() } -func com_amazonaws_kms_CreateKeyRequest_XksKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetKeyRotationStatusResponse_RotationPeriodInDays_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_DescribeKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_GetKeyRotationStatusResponse_NextRotationDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_GenerateDataKeyPairRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_GetKeyRotationStatusResponse_OnDemandRotationStartDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) +func com_amazonaws_kms_GetParametersForImportRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_CreateKeyRequest_Origin_ToDafny(input types.OriginType) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_GetParametersForImportRequest_WrappingAlgorithm_ToDafny(input types.AlgorithmSpec) ComAmazonawsKmsTypes.AlgorithmSpec { + return func() ComAmazonawsKmsTypes.AlgorithmSpec { var index int for _, enumVal := range input.Values() { index++ @@ -3955,27 +4053,39 @@ func com_amazonaws_kms_CreateKeyRequest_Origin_ToDafny(input types.OriginType) W } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_AlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) + return enum.(ComAmazonawsKmsTypes.AlgorithmSpec) }() } -func com_amazonaws_kms_GetKeyPolicyRequest_PolicyName_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() +func com_amazonaws_kms_GetParametersForImportRequest_WrappingKeySpec_ToDafny(input types.WrappingKeySpec) ComAmazonawsKmsTypes.WrappingKeySpec { + return func() ComAmazonawsKmsTypes.WrappingKeySpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_WrappingKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.WrappingKeySpec) }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_KeyStorePassword_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetParametersForImportResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -3984,90 +4094,66 @@ func com_amazonaws_kms_CreateCustomKeyStoreRequest_KeyStorePassword_ToDafny(inpu }() } -func com_amazonaws_kms_ImportKeyMaterialRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_kms_KeyUnavailableException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetParametersForImportResponse_ImportToken_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_DecryptRequest_CiphertextBlob_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_GetParametersForImportResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } for _, e := range input { v = append(v, e) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_MalformedPolicyDocumentException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetParametersForImportResponse_ParametersValidTo_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_ReEncryptRequest_SourceEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } +func com_amazonaws_kms_GetPublicKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_XksKeyConfigurationType_Id_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_ImportKeyMaterialRequest_EncryptedKeyMaterial_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_ListAliasesResponse_NextMarker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4076,7 +4162,7 @@ func com_amazonaws_kms_ListAliasesResponse_NextMarker_ToDafny(input *string) Wra }() } -func com_amazonaws_kms_DeriveSharedSecretResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { var v []interface{} if input == nil { @@ -4089,35 +4175,50 @@ func com_amazonaws_kms_DeriveSharedSecretResponse_CiphertextForRecipient_ToDafny }() } -func com_amazonaws_kms_GenerateDataKeyPairRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) }() } -func com_amazonaws_kms_DependencyTimeoutException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) }() } -func com_amazonaws_kms_DecryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_GrantOperationList_member_ToDafny(input types.GrantOperation) ComAmazonawsKmsTypes.GrantOperation { - return func() ComAmazonawsKmsTypes.GrantOperation { var index int for _, enumVal := range input.Values() { index++ @@ -4126,66 +4227,69 @@ func com_amazonaws_kms_GrantOperationList_member_ToDafny(input types.GrantOperat } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_GrantOperation_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.GrantOperation) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) }() } -func com_amazonaws_kms_DecryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_EncryptionAlgorithms_ToDafny(input []types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_DecryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_SigningAlgorithms_ToDafny(input []types.SigningAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + element := com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input bool) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) - }() -} - -func com_amazonaws_kms_KMSInternalException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GetPublicKeyResponse_KeyAgreementAlgorithms_ToDafny(input []types.KeyAgreementAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_GetKeyPolicyResponse_Policy_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_ImportKeyMaterialRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ReEncryptRequest_CiphertextBlob_ToDafny(input []byte) dafny.Sequence { +func com_amazonaws_kms_ImportKeyMaterialRequest_ImportToken_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -4198,65 +4302,69 @@ func com_amazonaws_kms_ReEncryptRequest_CiphertextBlob_ToDafny(input []byte) daf }() } -func com_amazonaws_kms_ReEncryptRequest_SourceKeyId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_ImportKeyMaterialRequest_EncryptedKeyMaterial_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_ListAliasesRequest_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ImportKeyMaterialRequest_ValidTo_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_VerifyRequest_Message_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil +func com_amazonaws_kms_ImportKeyMaterialRequest_ExpirationModel_ToDafny(input types.ExpirationModelType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - for _, e := range input { - v = append(v, e) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ExpirationModelType)) }() } -func com_amazonaws_kms_ReEncryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_ListAliasesRequest_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_EncryptResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_ListAliasesRequest_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_ListKeysResponse_NextMarker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListAliasesRequest_Marker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4265,27 +4373,28 @@ func com_amazonaws_kms_ListKeysResponse_NextMarker_ToDafny(input *string) Wrappe }() } -func com_amazonaws_kms_GenerateDataKeyRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { +func com_amazonaws_kms_ListAliasesResponse_Aliases_ToDafny(input []types.AliasListEntry) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_AliasList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_GenerateDataKeyRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_AliasList_member_ToDafny(input types.AliasListEntry) ComAmazonawsKmsTypes.AliasListEntry { + return func() ComAmazonawsKmsTypes.AliasListEntry { - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) - } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return ComAmazonawsKmsTypes.Companion_AliasListEntry_.Create_AliasListEntry_(com_amazonaws_kms_AliasListEntry_AliasName_ToDafny(input.AliasName), com_amazonaws_kms_AliasListEntry_AliasArn_ToDafny(input.AliasArn), com_amazonaws_kms_AliasListEntry_TargetKeyId_ToDafny(input.TargetKeyId), com_amazonaws_kms_AliasListEntry_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_AliasListEntry_LastUpdatedDate_ToDafny(input.LastUpdatedDate)) }() } -func com_amazonaws_kms_IncorrectKeyException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_AliasListEntry_AliasName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4294,55 +4403,45 @@ func com_amazonaws_kms_IncorrectKeyException_message_ToDafny(input *string) Wrap }() } -func com_amazonaws_kms_XksProxyConfigurationType_Connectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { +func com_amazonaws_kms_AliasListEntry_AliasArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_EnableKeyRotationRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_AliasListEntry_TargetKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_IncorrectKeyMaterialException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_AliasListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_ReEncryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_AliasListEntry_LastUpdatedDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_GenerateMacResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListAliasesResponse_NextMarker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4351,7 +4450,14 @@ func com_amazonaws_kms_GenerateMacResponse_KeyId_ToDafny(input *string) Wrappers }() } -func com_amazonaws_kms_DeriveSharedSecretRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_ListAliasesResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListGrantsRequest_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4360,20 +4466,16 @@ func com_amazonaws_kms_DeriveSharedSecretRequest_DryRun_ToDafny(input *bool) Wra }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_ListGrantsRequest_Marker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GetPublicKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_ListGrantsRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -4382,16 +4484,16 @@ func com_amazonaws_kms_GetPublicKeyRequest_KeyId_ToDafny(input *string) dafny.Se }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_ListGrantsRequest_GrantId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GrantListEntry_IssuingAccount_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListGrantsRequest_GranteePrincipal_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4400,12 +4502,17 @@ func com_amazonaws_kms_GrantListEntry_IssuingAccount_ToDafny(input *string) Wrap }() } -func com_amazonaws_kms_CustomKeyStoreNameInUseException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListGrantsResponse_Grants_ToDafny(input []types.GrantListEntry) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } @@ -4416,7 +4523,7 @@ func com_amazonaws_kms_GrantList_member_ToDafny(input types.GrantListEntry) ComA }() } -func com_amazonaws_kms_KeyListEntry_KeyArn_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GrantListEntry_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4425,7 +4532,7 @@ func com_amazonaws_kms_KeyListEntry_KeyArn_ToDafny(input *string) Wrappers.Optio }() } -func com_amazonaws_kms_PutKeyPolicyRequest_PolicyName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_GrantListEntry_GrantId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4434,145 +4541,101 @@ func com_amazonaws_kms_PutKeyPolicyRequest_PolicyName_ToDafny(input *string) Wra }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_GrantListEntry_Name_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_kms_GetKeyRotationStatusResponse_KeyRotationEnabled_ToDafny(input bool) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CreateKeyRequest_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { +func com_amazonaws_kms_GrantListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_DescribeKeyResponse_KeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { +func com_amazonaws_kms_GrantListEntry_GranteePrincipal_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_ToDafny(input types.CustomKeyStoreType) Wrappers.Option { +func com_amazonaws_kms_GrantListEntry_RetiringPrincipal_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomKeyStoreType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GetParametersForImportResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_GrantListEntry_IssuingAccount_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_DeriveSharedSecretRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { +func com_amazonaws_kms_GrantListEntry_Operations_ToDafny(input []types.GrantOperation) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantOperationList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_CustomKeyStoresList_member_ToDafny(input types.CustomKeyStoresListEntry) ComAmazonawsKmsTypes.CustomKeyStoresListEntry { - return func() ComAmazonawsKmsTypes.CustomKeyStoresListEntry { - - return ComAmazonawsKmsTypes.Companion_CustomKeyStoresListEntry_.Create_CustomKeyStoresListEntry_(com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_ToDafny(input.CustomKeyStoreName), com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_ToDafny(input.TrustAnchorCertificate), com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_ToDafny(input.ConnectionState), com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_ToDafny(input.ConnectionErrorCode), com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_ToDafny(input.CustomKeyStoreType), com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_ToDafny(input.XksProxyConfiguration)) +func com_amazonaws_kms_GrantListEntry_Constraints_ToDafny(input *types.GrantConstraints) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_GrantConstraints_.Create_GrantConstraints_(com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input.EncryptionContextSubset), com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input.EncryptionContextEquals))) }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeySpec_ToDafny(input types.DataKeySpec) Wrappers.Option { +func com_amazonaws_kms_ListGrantsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeySpec)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input types.ExpirationModelType) Wrappers.Option { +func com_amazonaws_kms_ListGrantsResponse_Truncated_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ExpirationModelType)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_ListKeyPoliciesRequest_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4581,37 +4644,37 @@ func com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input *bool) Wrappers.Opt }() } -func com_amazonaws_kms_VerifyRequest_MessageType_ToDafny(input types.MessageType) Wrappers.Option { +func com_amazonaws_kms_ListKeyPoliciesRequest_Marker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MessageType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GetKeyRotationStatusResponse_RotationPeriodInDays_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_ListKeyPoliciesResponse_PolicyNames_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_PolicyNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_DecryptRequest_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_PolicyNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesResponse_NextMarker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4620,20 +4683,32 @@ func com_amazonaws_kms_DecryptRequest_KeyId_ToDafny(input *string) Wrappers.Opti }() } -func com_amazonaws_kms_ImportKeyMaterialRequest_ImportToken_ToDafny(input []byte) dafny.Sequence { +func com_amazonaws_kms_ListKeyPoliciesResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListKeyRotationsRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { - var v []interface{} if input == nil { return nil } - for _, e := range input { - v = append(v, e) + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ListKeyRotationsRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_GetKeyRotationStatusResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListKeyRotationsRequest_Marker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4642,20 +4717,28 @@ func com_amazonaws_kms_GetKeyRotationStatusResponse_KeyId_ToDafny(input *string) }() } -func com_amazonaws_kms_GenerateRandomResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_ListKeyRotationsResponse_Rotations_ToDafny(input []types.RotationsListEntry) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_RotationsList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_RotationsList_member_ToDafny(input types.RotationsListEntry) ComAmazonawsKmsTypes.RotationsListEntry { + return func() ComAmazonawsKmsTypes.RotationsListEntry { + + return ComAmazonawsKmsTypes.Companion_RotationsListEntry_.Create_RotationsListEntry_(com_amazonaws_kms_RotationsListEntry_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_RotationsListEntry_RotationDate_ToDafny(input.RotationDate), com_amazonaws_kms_RotationsListEntry_RotationType_ToDafny(input.RotationType)) + }() +} + +func com_amazonaws_kms_RotationsListEntry_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4664,25 +4747,38 @@ func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_ToDafny(input * }() } -func com_amazonaws_kms_GenerateRandomRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { +func com_amazonaws_kms_RotationsListEntry_RotationDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_ToDafny(input *types.MultiRegionKey) Wrappers.Option { +func com_amazonaws_kms_RotationsListEntry_RotationType_ToDafny(input types.RotationType) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_MultiRegionKey_.Create_MultiRegionKey_(com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input.Arn), com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input.Region))) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_RotationType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.RotationType)) }() } -func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListKeyRotationsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4691,29 +4787,23 @@ func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_ToDafny( }() } -func com_amazonaws_kms_GenerateDataKeyPairResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListKeyRotationsResponse_Truncated_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_EncryptRequest_Plaintext_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} +func com_amazonaws_kms_ListKeysRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_ExpiredImportTokenException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListKeysRequest_Marker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4722,21 +4812,37 @@ func com_amazonaws_kms_ExpiredImportTokenException_message_ToDafny(input *string }() } -func com_amazonaws_kms_VerifyMacRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_ListKeysResponse_Keys_ToDafny(input []types.KeyListEntry) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + element := com_amazonaws_kms_KeyList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_NewCustomKeyStoreName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_KeyList_member_ToDafny(input types.KeyListEntry) ComAmazonawsKmsTypes.KeyListEntry { + return func() ComAmazonawsKmsTypes.KeyListEntry { + + return ComAmazonawsKmsTypes.Companion_KeyListEntry_.Create_KeyListEntry_(com_amazonaws_kms_KeyListEntry_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyListEntry_KeyArn_ToDafny(input.KeyArn)) + }() +} + +func com_amazonaws_kms_KeyListEntry_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyListEntry_KeyArn_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4745,26 +4851,23 @@ func com_amazonaws_kms_UpdateCustomKeyStoreRequest_NewCustomKeyStoreName_ToDafny }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(input *types.XksProxyAuthenticationCredentialType) Wrappers.Option { +func com_amazonaws_kms_ListKeysResponse_NextMarker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyAuthenticationCredentialType_.Create_XksProxyAuthenticationCredentialType_(com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_ToDafny(input.RawSecretAccessKey))) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_ListKeysResponse_Truncated_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_RevokeGrantRequest_GrantId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_ListResourceTagsRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -4773,7 +4876,7 @@ func com_amazonaws_kms_RevokeGrantRequest_GrantId_ToDafny(input *string) dafny.S }() } -func com_amazonaws_kms_GenerateDataKeyRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_ListResourceTagsRequest_Limit_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4782,7 +4885,7 @@ func com_amazonaws_kms_GenerateDataKeyRequest_NumberOfBytes_ToDafny(input *int32 }() } -func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListResourceTagsRequest_Marker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4791,58 +4894,21 @@ func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_ToDafny(input }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListResourceTagsResponse_Tags_ToDafny(input []types.Tag) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { - return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) - }() -} - -func com_amazonaws_kms_GenerateDataKeyPairRequest_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) ComAmazonawsKmsTypes.DataKeyPairSpec { - return func() ComAmazonawsKmsTypes.DataKeyPairSpec { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } - return enum.(ComAmazonawsKmsTypes.DataKeyPairSpec) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_TrustAnchorCertificate_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ListResourceTagsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4851,68 +4917,61 @@ func com_amazonaws_kms_CreateCustomKeyStoreRequest_TrustAnchorCertificate_ToDafn }() } -func com_amazonaws_kms_DescribeKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) +func com_amazonaws_kms_ListResourceTagsResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_CreateKeyResponse_KeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_PutKeyPolicyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ListKeyPoliciesResponse_PolicyNames_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_PutKeyPolicyRequest_PolicyName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_PolicyNameList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_SignRequest_Message_ToDafny(input []byte) dafny.Sequence { +func com_amazonaws_kms_PutKeyPolicyRequest_Policy_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { - var v []interface{} if input == nil { return nil } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ListAliasesResponse_Truncated_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_kms_PutKeyPolicyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_SignRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_ReEncryptRequest_CiphertextBlob_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { + var v []interface{} if input == nil { return nil } - return dafny.SeqOfChars([]dafny.Char(*input)...) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_ReEncryptRequest_SourceEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { fieldValue := dafny.NewMapBuilder() @@ -4923,26 +4982,7 @@ func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input ma }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_DryRun_ToDafny(input *bool) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(*input) - }() -} - -func com_amazonaws_kms_AliasListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) - }() -} - -func com_amazonaws_kms_GrantListEntry_GrantId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ReEncryptRequest_SourceKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -4951,35 +4991,28 @@ func com_amazonaws_kms_GrantListEntry_GrantId_ToDafny(input *string) Wrappers.Op }() } -func com_amazonaws_kms_XksKeyAlreadyInUseException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_ReEncryptRequest_DestinationKeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_KMSInvalidStateException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} -func com_amazonaws_kms_CreateCustomKeyStoreResponse_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) }() } -func com_amazonaws_kms_VerifyMacRequest_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { - return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { +func com_amazonaws_kms_ReEncryptRequest_SourceEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -4988,27 +5021,39 @@ func com_amazonaws_kms_VerifyMacRequest_MacAlgorithm_ToDafny(input types.MacAlgo } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) }() } -func com_amazonaws_kms_InvalidKeyUsageException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) }() } -func com_amazonaws_kms_GetPublicKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_ReEncryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5022,26 +5067,29 @@ func com_amazonaws_kms_GetPublicKeyRequest_GrantTokens_ToDafny(input []string) W }() } -func com_amazonaws_kms_GenerateRandomRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ReEncryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_GetParametersForImportResponse_ParametersValidTo_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_ReEncryptResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { return func() Wrappers.Option { + var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_EncryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ReEncryptResponse_SourceKeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5050,21 +5098,16 @@ func com_amazonaws_kms_EncryptResponse_KeyId_ToDafny(input *string) Wrappers.Opt }() } -func com_amazonaws_kms_ListAliasesResponse_Aliases_ToDafny(input []types.AliasListEntry) Wrappers.Option { +func com_amazonaws_kms_ReEncryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_AliasList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ImportKeyMaterialRequest_ExpirationModel_ToDafny(input types.ExpirationModelType) Wrappers.Option { +func com_amazonaws_kms_ReEncryptResponse_SourceEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -5074,56 +5117,18 @@ func com_amazonaws_kms_ImportKeyMaterialRequest_ExpirationModel_ToDafny(input ty } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ExpirationModelType)) - }() -} - -func com_amazonaws_kms_ReplicateKeyRequest_Policy_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_XksProxyInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_GenerateDataKeyResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { - var v []interface{} - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - for _, e := range input { - v = append(v, e) + enum, ok = allEnums() + if !ok { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) - }() -} - -func com_amazonaws_kms_VerifyResponse_SignatureValid_ToDafny(input bool) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_ToDafny(input types.ConnectionErrorCodeType) Wrappers.Option { +func com_amazonaws_kms_ReEncryptResponse_DestinationEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { @@ -5133,18 +5138,36 @@ func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_ToDafny(inpu } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionErrorCodeType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ConnectionErrorCodeType)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) }() } -func com_amazonaws_kms_XksProxyConfigurationType_UriPath_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ReplicateKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_ReplicaRegion_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_Policy_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5153,62 +5176,69 @@ func com_amazonaws_kms_XksProxyConfigurationType_UriPath_ToDafny(input *string) }() } -func com_amazonaws_kms_ScheduleKeyDeletionResponse_DeletionDate_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_ReplicateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_Description_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CreateGrantRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_ReplicateKeyRequest_Tags_ToDafny(input []types.Tag) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ReplicateKeyResponse_ReplicaKeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) }() } -func com_amazonaws_kms_DecryptResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_ReplicateKeyResponse_ReplicaPolicy_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateDataKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_ReplicateKeyResponse_ReplicaTags_ToDafny(input []types.Tag) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + element := com_amazonaws_kms_TagList_member_ToDafny(val) fieldValue = append(fieldValue, element) } return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_RetireGrantRequest_GrantToken_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5217,7 +5247,7 @@ func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_ToDafny(input }() } -func com_amazonaws_kms_InvalidAliasNameException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_RetireGrantRequest_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5226,7 +5256,7 @@ func com_amazonaws_kms_InvalidAliasNameException_message_ToDafny(input *string) }() } -func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_RetireGrantRequest_GrantId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5235,28 +5265,16 @@ func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_ToDafny(input * }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_ToDafny(input types.ConnectionStateType) Wrappers.Option { +func com_amazonaws_kms_RetireGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionStateType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ConnectionStateType)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_DisableKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_RevokeGrantRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5265,7 +5283,7 @@ func com_amazonaws_kms_DisableKeyRequest_KeyId_ToDafny(input *string) dafny.Sequ }() } -func com_amazonaws_kms_PutKeyPolicyRequest_Policy_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_RevokeGrantRequest_GrantId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5274,43 +5292,34 @@ func com_amazonaws_kms_PutKeyPolicyRequest_Policy_ToDafny(input *string) dafny.S }() } -func com_amazonaws_kms_InvalidGrantIdException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_RevokeGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_GenerateDataKeyPairRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_RotateKeyOnDemandRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_GenerateDataKeyPairResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_RotateKeyOnDemandResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_UpdateKeyDescriptionRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_ScheduleKeyDeletionRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5319,21 +5328,16 @@ func com_amazonaws_kms_UpdateKeyDescriptionRequest_KeyId_ToDafny(input *string) }() } -func com_amazonaws_kms_ListKeysResponse_Keys_ToDafny(input []types.KeyListEntry) Wrappers.Option { +func com_amazonaws_kms_ScheduleKeyDeletionRequest_PendingWindowInDays_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_KeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5342,29 +5346,18 @@ func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(i }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { +func com_amazonaws_kms_ScheduleKeyDeletionResponse_DeletionDate_ToDafny(input *time.Time) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) }() } -func com_amazonaws_kms_GetParametersForImportRequest_WrappingKeySpec_ToDafny(input types.WrappingKeySpec) ComAmazonawsKmsTypes.WrappingKeySpec { - return func() ComAmazonawsKmsTypes.WrappingKeySpec { +func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyState_ToDafny(input types.KeyState) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -5373,68 +5366,27 @@ func com_amazonaws_kms_GetParametersForImportRequest_WrappingKeySpec_ToDafny(inp } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_WrappingKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.WrappingKeySpec) - }() -} - -func com_amazonaws_kms_Tag_TagValue_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_kms_SignResponse_KeyId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_GrantListEntry_RetiringPrincipal_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_GrantListEntry_Name_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyState)) }() } -func com_amazonaws_kms_EncryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_ScheduleKeyDeletionResponse_PendingWindowInDays_ToDafny(input *int32) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreName_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_SignRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5443,34 +5395,56 @@ func com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreName_ToDafny(in }() } -func com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input *time.Time) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_SignRequest_Message_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_DescribeCustomKeyStoresResponse_Truncated_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_kms_SignRequest_MessageType_ToDafny(input types.MessageType) Wrappers.Option { return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(input) + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MessageType)) }() } -func com_amazonaws_kms_EnableKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_SignRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_VerifyResponse_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_SignRequest_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { + return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { var index int for _, enumVal := range input.Values() { index++ @@ -5486,25 +5460,43 @@ func com_amazonaws_kms_VerifyResponse_SigningAlgorithm_ToDafny(input types.Signi break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec)) + return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) }() } -func com_amazonaws_kms_VerifyRequest_Signature_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_SignRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_SignResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_SignResponse_Signature_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { var v []interface{} if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } for _, e := range input { v = append(v, e) } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) ComAmazonawsKmsTypes.DataKeyPairSpec { - return func() ComAmazonawsKmsTypes.DataKeyPairSpec { +func com_amazonaws_kms_SignResponse_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -5513,55 +5505,80 @@ func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyPairSpec_To } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.DataKeyPairSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec)) }() } -func com_amazonaws_kms_SignRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_TagResourceRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_TagResourceRequest_Tags_ToDafny(input []types.Tag) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + element := com_amazonaws_kms_TagList_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_kms_DeriveSharedSecretRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_UntagResourceRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UntagResourceRequest_TagKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil } var fieldValue []interface{} = make([]interface{}, 0) for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + element := com_amazonaws_kms_TagKeyList_member_ToDafny(val) fieldValue = append(fieldValue, element) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return dafny.SeqOf(fieldValue...) }() } -func com_amazonaws_kms_AlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_TagKeyList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_UpdateAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_CreateGrantRequest_GranteePrincipal_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_UpdateAliasRequest_TargetKeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5570,16 +5587,16 @@ func com_amazonaws_kms_CreateGrantRequest_GranteePrincipal_ToDafny(input *string }() } -func com_amazonaws_kms_DecryptRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ListGrantsRequest_Marker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_NewCustomKeyStoreName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5588,7 +5605,7 @@ func com_amazonaws_kms_ListGrantsRequest_Marker_ToDafny(input *string) Wrappers. }() } -func com_amazonaws_kms_DryRunOperationException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_KeyStorePassword_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5597,28 +5614,25 @@ func com_amazonaws_kms_DryRunOperationException_message_ToDafny(input *string) W }() } -func com_amazonaws_kms_DecryptRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5627,7 +5641,7 @@ func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyId_ToDafny(input *string) }() } -func com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5636,63 +5650,150 @@ func com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_ToDafny(input *stri }() } -func com_amazonaws_kms_GrantListEntry_Constraints_ToDafny(input *types.GrantConstraints) Wrappers.Option { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(input *types.XksProxyAuthenticationCredentialType) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_GrantConstraints_.Create_GrantConstraints_(com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input.EncryptionContextSubset), com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input.EncryptionContextEquals))) + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyAuthenticationCredentialType_.Create_XksProxyAuthenticationCredentialType_(com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_ToDafny(input.RawSecretAccessKey))) }() } -func com_amazonaws_kms_TagList_member_ToDafny(input types.Tag) ComAmazonawsKmsTypes.Tag { - return func() ComAmazonawsKmsTypes.Tag { +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) + }() +} - return ComAmazonawsKmsTypes.Companion_Tag_.Create_Tag_(com_amazonaws_kms_Tag_TagKey_ToDafny(input.TagKey), com_amazonaws_kms_Tag_TagValue_ToDafny(input.TagValue)) +func com_amazonaws_kms_UpdateKeyDescriptionRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_ReEncryptResponse_SourceKeyId_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_UpdateKeyDescriptionRequest_Description_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_ToDafny(input *types.XksProxyConfigurationType) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_UpdatePrimaryRegionRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyConfigurationType_.Create_XksProxyConfigurationType_(com_amazonaws_kms_XksProxyConfigurationType_Connectivity_ToDafny(input.Connectivity), com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_ToDafny(input.UriEndpoint), com_amazonaws_kms_XksProxyConfigurationType_UriPath_ToDafny(input.UriPath), com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_ToDafny(input.VpcEndpointServiceName))) + return dafny.SeqOfChars([]dafny.Char(*input)...) }() } -func com_amazonaws_kms_SignResponse_Signature_ToDafny(input []byte) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_UpdatePrimaryRegionRequest_PrimaryRegion_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_VerifyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_VerifyRequest_Message_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } for _, e := range input { v = append(v, e) } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreName_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_VerifyRequest_MessageType_ToDafny(input types.MessageType) Wrappers.Option { return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MessageType)) + }() +} + +func com_amazonaws_kms_VerifyRequest_Signature_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_VerifyRequest_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { + return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) }() } -func com_amazonaws_kms_CreateGrantRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_VerifyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5706,16 +5807,16 @@ func com_amazonaws_kms_CreateGrantRequest_GrantTokens_ToDafny(input []string) Wr }() } -func com_amazonaws_kms_DisableKeyRotationRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_VerifyRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_ListKeyPoliciesRequest_Marker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_VerifyResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5724,14 +5825,35 @@ func com_amazonaws_kms_ListKeyPoliciesRequest_Marker_ToDafny(input *string) Wrap }() } -func com_amazonaws_kms_ListKeysResponse_Truncated_ToDafny(input bool) Wrappers.Option { +func com_amazonaws_kms_VerifyResponse_SignatureValid_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_VerifyMacRequest_Mac_ToDafny(input []byte) dafny.Sequence { +func com_amazonaws_kms_VerifyResponse_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_VerifyMacRequest_Message_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -5744,7 +5866,7 @@ func com_amazonaws_kms_VerifyMacRequest_Mac_ToDafny(input []byte) dafny.Sequence }() } -func com_amazonaws_kms_GenerateDataKeyPairRequest_KeyId_ToDafny(input *string) dafny.Sequence { +func com_amazonaws_kms_VerifyMacRequest_KeyId_ToDafny(input *string) dafny.Sequence { return func() dafny.Sequence { if input == nil { return nil @@ -5753,17 +5875,8 @@ func com_amazonaws_kms_GenerateDataKeyPairRequest_KeyId_ToDafny(input *string) d }() } -func com_amazonaws_kms_XksKeyNotFoundException_message_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) - }() -} - -func com_amazonaws_kms_DeriveSharedSecretResponse_KeyOrigin_ToDafny(input types.OriginType) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_VerifyMacRequest_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { + return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { var index int for _, enumVal := range input.Values() { index++ @@ -5772,45 +5885,54 @@ func com_amazonaws_kms_DeriveSharedSecretResponse_KeyOrigin_ToDafny(input types. } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) + return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) }() } -func com_amazonaws_kms_ListKeysRequest_Marker_ToDafny(input *string) Wrappers.Option { - return func() Wrappers.Option { +func com_amazonaws_kms_VerifyMacRequest_Mac_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} if input == nil { - return Wrappers.Companion_Option_.Create_None_() + return nil } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_VerifyMacRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) }() } -func com_amazonaws_kms_KeyMetadata_Description_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_VerifyMacRequest_DryRun_ToDafny(input *bool) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + return Wrappers.Companion_Option_.Create_Some_(*input) }() } -func com_amazonaws_kms_ListGrantsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_VerifyMacResponse_KeyId_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5819,45 +5941,15 @@ func com_amazonaws_kms_ListGrantsResponse_NextMarker_ToDafny(input *string) Wrap }() } -func com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input *time.Time) Wrappers.Option { +func com_amazonaws_kms_VerifyMacResponse_MacValid_ToDafny(input bool) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - formattedTime := input.Format("2006-01-02T15:04:05.999999Z") - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) - }() -} - -func com_amazonaws_kms_ListKeyRotationsRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} -func com_amazonaws_kms_DeleteAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) - }() -} - -func com_amazonaws_kms_VerifyRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { - if input == nil { - return nil - } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(input) }() } -func com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(input types.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { +func com_amazonaws_kms_VerifyMacResponse_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { var index int for _, enumVal := range input.Values() { index++ @@ -5866,31 +5958,27 @@ func com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(input types.En } } var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { var ok bool enum, ok = allEnums() if !ok { break } } - return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec)) }() } -func com_amazonaws_kms_DeriveSharedSecretRequest_PublicKey_ToDafny(input []byte) dafny.Sequence { - return func() dafny.Sequence { - var v []interface{} +func com_amazonaws_kms_AlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOf(v...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_InvalidArnException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CloudHsmClusterInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5899,37 +5987,25 @@ func com_amazonaws_kms_InvalidArnException_message_ToDafny(input *string) Wrappe }() } -func com_amazonaws_kms_GenerateDataKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateMacResponse_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_CloudHsmClusterNotActiveException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CustomKeyStoreNotFoundException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CloudHsmClusterNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5938,43 +6014,43 @@ func com_amazonaws_kms_CustomKeyStoreNotFoundException_message_ToDafny(input *st }() } -func com_amazonaws_kms_UpdateKeyDescriptionRequest_Description_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateDataKeyPairRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_ConflictException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_RevokeGrantRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GenerateDataKeyRequest_DryRun_ToDafny(input *bool) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_InvalidGrantTokenException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoreNameInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5983,7 +6059,7 @@ func com_amazonaws_kms_InvalidGrantTokenException_message_ToDafny(input *string) }() } -func com_amazonaws_kms_CreateKeyRequest_Policy_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_CustomKeyStoreNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -5992,30 +6068,34 @@ func com_amazonaws_kms_CreateKeyRequest_Policy_ToDafny(input *string) Wrappers.O }() } -func com_amazonaws_kms_GetPublicKeyResponse_EncryptionAlgorithms_ToDafny(input []types.EncryptionAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_DependencyTimeoutException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DisabledException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ScheduleKeyDeletionRequest_PendingWindowInDays_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_DryRunOperationException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_ExpiredImportTokenException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6024,67 +6104,52 @@ func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_messag }() } -func com_amazonaws_kms_GetPublicKeyResponse_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { +func com_amazonaws_kms_IncorrectKeyException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_IncorrectKeyMaterialException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_IncorrectTrustAnchorException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ReEncryptResponse_DestinationEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_InvalidAliasNameException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ReEncryptRequest_DestinationKeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_InvalidArnException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_InvalidCiphertextException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6093,7 +6158,7 @@ func com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input *string) Wrappers.Opt }() } -func com_amazonaws_kms_IncorrectTrustAnchorException_message_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_InvalidGrantIdException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6102,7 +6167,7 @@ func com_amazonaws_kms_IncorrectTrustAnchorException_message_ToDafny(input *stri }() } -func com_amazonaws_kms_CreateKeyRequest_Description_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_InvalidGrantTokenException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6111,7 +6176,7 @@ func com_amazonaws_kms_CreateKeyRequest_Description_ToDafny(input *string) Wrapp }() } -func com_amazonaws_kms_ListAliasesRequest_Marker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_InvalidImportTokenException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6120,16 +6185,16 @@ func com_amazonaws_kms_ListAliasesRequest_Marker_ToDafny(input *string) Wrappers }() } -func com_amazonaws_kms_EncryptRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_InvalidKeyUsageException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ListKeyPoliciesResponse_NextMarker_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_InvalidMarkerException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6138,78 +6203,61 @@ func com_amazonaws_kms_ListKeyPoliciesResponse_NextMarker_ToDafny(input *string) }() } -func com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_KeyUnavailableException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ScheduleKeyDeletionRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_KMSInternalException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_UpdateAliasRequest_TargetKeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_KMSInvalidMacException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreType_ToDafny(input types.CustomKeyStoreType) Wrappers.Option { +func com_amazonaws_kms_KMSInvalidSignatureException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomKeyStoreType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_VerifyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { +func com_amazonaws_kms_KMSInvalidStateException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_GrantTokenList_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) +func com_amazonaws_kms_LimitExceededException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CancelKeyDeletionResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_MalformedPolicyDocumentException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6218,46 +6266,34 @@ func com_amazonaws_kms_CancelKeyDeletionResponse_KeyId_ToDafny(input *string) Wr }() } -func com_amazonaws_kms_GenerateRandomRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_NotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { +func com_amazonaws_kms_TagException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ListResourceTagsRequest_KeyId_ToDafny(input *string) dafny.Sequence { - return func() dafny.Sequence { +func com_amazonaws_kms_UnsupportedOperationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { if input == nil { - return nil + return Wrappers.Companion_Option_.Create_None_() } - return dafny.SeqOfChars([]dafny.Char(*input)...) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_XksKeyAlreadyInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6266,66 +6302,43 @@ func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input }() } -func com_amazonaws_kms_GenerateDataKeyResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { +func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var v []interface{} if input == nil { return Wrappers.Companion_Option_.Create_None_() } - for _, e := range input { - v = append(v, e) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_ReEncryptRequest_SourceEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { +func com_amazonaws_kms_XksKeyNotFoundException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - - fieldValue := dafny.NewMapBuilder() - for key, val := range input { - fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_DecryptRequest_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_ToDafny(input []types.MultiRegionKey) Wrappers.Option { +func com_amazonaws_kms_XksProxyInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_MultiRegionKeyList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_VerifyResponse_KeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_XksProxyInvalidResponseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6334,28 +6347,16 @@ func com_amazonaws_kms_VerifyResponse_KeyId_ToDafny(input *string) Wrappers.Opti }() } -func com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_ToDafny(input types.MultiRegionKeyType) Wrappers.Option { +func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MultiRegionKeyType_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MultiRegionKeyType)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_AliasListEntry_TargetKeyId_ToDafny(input *string) Wrappers.Option { +func com_amazonaws_kms_XksProxyUriInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() @@ -6364,39 +6365,38 @@ func com_amazonaws_kms_AliasListEntry_TargetKeyId_ToDafny(input *string) Wrapper }() } -func com_amazonaws_kms_ListResourceTagsRequest_Limit_ToDafny(input *int32) Wrappers.Option { +func com_amazonaws_kms_XksProxyUriUnreachableException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(*input) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_CreateKeyRequest_Tags_ToDafny(input []types.Tag) Wrappers.Option { +func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_TagList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } -func com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input []types.MacAlgorithmSpec) Wrappers.Option { +func com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := com_amazonaws_kms_MacAlgorithmSpecList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() } - return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) }() } diff --git a/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_native.go b/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_native.go index 03b5bdc31..9064975e2 100644 --- a/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_native.go +++ b/ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/comamazonawskmssmithygenerated/to_native.go @@ -1196,481 +1196,481 @@ func VerifyMacOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.VerifyMacRespons } -func XksProxyVpcEndpointServiceInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceInvalidConfigurationException { - return func() types.XksProxyVpcEndpointServiceInvalidConfigurationException { +func AlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.AlreadyExistsException { + return func() types.AlreadyExistsException { - return types.XksProxyVpcEndpointServiceInvalidConfigurationException{ - Message: com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.AlreadyExistsException{ + Message: com_amazonaws_kms_AlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func KMSInvalidMacException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidMacException { - return func() types.KMSInvalidMacException { +func CloudHsmClusterInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterInUseException { + return func() types.CloudHsmClusterInUseException { - return types.KMSInvalidMacException{ - Message: com_amazonaws_kms_KMSInvalidMacException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CloudHsmClusterInUseException{ + Message: com_amazonaws_kms_CloudHsmClusterInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func UnsupportedOperationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.UnsupportedOperationException { - return func() types.UnsupportedOperationException { +func CloudHsmClusterInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterInvalidConfigurationException { + return func() types.CloudHsmClusterInvalidConfigurationException { - return types.UnsupportedOperationException{ - Message: com_amazonaws_kms_UnsupportedOperationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CloudHsmClusterInvalidConfigurationException{ + Message: com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func MalformedPolicyDocumentException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.MalformedPolicyDocumentException { - return func() types.MalformedPolicyDocumentException { +func CloudHsmClusterNotActiveException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotActiveException { + return func() types.CloudHsmClusterNotActiveException { - return types.MalformedPolicyDocumentException{ - Message: com_amazonaws_kms_MalformedPolicyDocumentException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CloudHsmClusterNotActiveException{ + Message: com_amazonaws_kms_CloudHsmClusterNotActiveException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksKeyInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyInvalidConfigurationException { - return func() types.XksKeyInvalidConfigurationException { +func CloudHsmClusterNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotFoundException { + return func() types.CloudHsmClusterNotFoundException { - return types.XksKeyInvalidConfigurationException{ - Message: com_amazonaws_kms_XksKeyInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CloudHsmClusterNotFoundException{ + Message: com_amazonaws_kms_CloudHsmClusterNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyVpcEndpointServiceNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceNotFoundException { - return func() types.XksProxyVpcEndpointServiceNotFoundException { +func CloudHsmClusterNotRelatedException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotRelatedException { + return func() types.CloudHsmClusterNotRelatedException { - return types.XksProxyVpcEndpointServiceNotFoundException{ - Message: com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CloudHsmClusterNotRelatedException{ + Message: com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidCiphertextException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidCiphertextException { - return func() types.InvalidCiphertextException { +func ConflictException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.ConflictException { + return func() types.ConflictException { - return types.InvalidCiphertextException{ - Message: com_amazonaws_kms_InvalidCiphertextException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ConflictException{ + Message: com_amazonaws_kms_ConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyUriUnreachableException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriUnreachableException { - return func() types.XksProxyUriUnreachableException { +func CustomKeyStoreHasCMKsException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreHasCMKsException { + return func() types.CustomKeyStoreHasCMKsException { - return types.XksProxyUriUnreachableException{ - Message: com_amazonaws_kms_XksProxyUriUnreachableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CustomKeyStoreHasCMKsException{ + Message: com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidImportTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidImportTokenException { - return func() types.InvalidImportTokenException { +func CustomKeyStoreInvalidStateException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreInvalidStateException { + return func() types.CustomKeyStoreInvalidStateException { - return types.InvalidImportTokenException{ - Message: com_amazonaws_kms_InvalidImportTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CustomKeyStoreInvalidStateException{ + Message: com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CloudHsmClusterNotActiveException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotActiveException { - return func() types.CloudHsmClusterNotActiveException { +func CustomKeyStoreNameInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreNameInUseException { + return func() types.CustomKeyStoreNameInUseException { - return types.CloudHsmClusterNotActiveException{ - Message: com_amazonaws_kms_CloudHsmClusterNotActiveException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CustomKeyStoreNameInUseException{ + Message: com_amazonaws_kms_CustomKeyStoreNameInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidMarkerException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidMarkerException { - return func() types.InvalidMarkerException { +func CustomKeyStoreNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreNotFoundException { + return func() types.CustomKeyStoreNotFoundException { - return types.InvalidMarkerException{ - Message: com_amazonaws_kms_InvalidMarkerException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.CustomKeyStoreNotFoundException{ + Message: com_amazonaws_kms_CustomKeyStoreNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func DryRunOperationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DryRunOperationException { - return func() types.DryRunOperationException { +func DependencyTimeoutException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DependencyTimeoutException { + return func() types.DependencyTimeoutException { - return types.DryRunOperationException{ - Message: com_amazonaws_kms_DryRunOperationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.DependencyTimeoutException{ + Message: com_amazonaws_kms_DependencyTimeoutException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func IncorrectTrustAnchorException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectTrustAnchorException { - return func() types.IncorrectTrustAnchorException { +func DisabledException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DisabledException { + return func() types.DisabledException { - return types.IncorrectTrustAnchorException{ - Message: com_amazonaws_kms_IncorrectTrustAnchorException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.DisabledException{ + Message: com_amazonaws_kms_DisabledException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func KMSInvalidSignatureException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidSignatureException { - return func() types.KMSInvalidSignatureException { +func DryRunOperationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DryRunOperationException { + return func() types.DryRunOperationException { - return types.KMSInvalidSignatureException{ - Message: com_amazonaws_kms_KMSInvalidSignatureException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.DryRunOperationException{ + Message: com_amazonaws_kms_DryRunOperationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksKeyNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyNotFoundException { - return func() types.XksKeyNotFoundException { +func ExpiredImportTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.ExpiredImportTokenException { + return func() types.ExpiredImportTokenException { - return types.XksKeyNotFoundException{ - Message: com_amazonaws_kms_XksKeyNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.ExpiredImportTokenException{ + Message: com_amazonaws_kms_ExpiredImportTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CustomKeyStoreHasCMKsException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreHasCMKsException { - return func() types.CustomKeyStoreHasCMKsException { +func IncorrectKeyException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectKeyException { + return func() types.IncorrectKeyException { - return types.CustomKeyStoreHasCMKsException{ - Message: com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.IncorrectKeyException{ + Message: com_amazonaws_kms_IncorrectKeyException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyInvalidConfigurationException { - return func() types.XksProxyInvalidConfigurationException { +func IncorrectKeyMaterialException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectKeyMaterialException { + return func() types.IncorrectKeyMaterialException { - return types.XksProxyInvalidConfigurationException{ - Message: com_amazonaws_kms_XksProxyInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.IncorrectKeyMaterialException{ + Message: com_amazonaws_kms_IncorrectKeyMaterialException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CustomKeyStoreInvalidStateException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreInvalidStateException { - return func() types.CustomKeyStoreInvalidStateException { +func IncorrectTrustAnchorException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectTrustAnchorException { + return func() types.IncorrectTrustAnchorException { - return types.CustomKeyStoreInvalidStateException{ - Message: com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.IncorrectTrustAnchorException{ + Message: com_amazonaws_kms_IncorrectTrustAnchorException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func KMSInternalException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInternalException { - return func() types.KMSInternalException { +func InvalidAliasNameException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidAliasNameException { + return func() types.InvalidAliasNameException { - return types.KMSInternalException{ - Message: com_amazonaws_kms_KMSInternalException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidAliasNameException{ + Message: com_amazonaws_kms_InvalidAliasNameException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyUriEndpointInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriEndpointInUseException { - return func() types.XksProxyUriEndpointInUseException { +func InvalidArnException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidArnException { + return func() types.InvalidArnException { - return types.XksProxyUriEndpointInUseException{ - Message: com_amazonaws_kms_XksProxyUriEndpointInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidArnException{ + Message: com_amazonaws_kms_InvalidArnException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidAliasNameException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidAliasNameException { - return func() types.InvalidAliasNameException { +func InvalidCiphertextException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidCiphertextException { + return func() types.InvalidCiphertextException { - return types.InvalidAliasNameException{ - Message: com_amazonaws_kms_InvalidAliasNameException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidCiphertextException{ + Message: com_amazonaws_kms_InvalidCiphertextException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyUriInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriInUseException { - return func() types.XksProxyUriInUseException { +func InvalidGrantIdException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidGrantIdException { + return func() types.InvalidGrantIdException { - return types.XksProxyUriInUseException{ - Message: com_amazonaws_kms_XksProxyUriInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidGrantIdException{ + Message: com_amazonaws_kms_InvalidGrantIdException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func AlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.AlreadyExistsException { - return func() types.AlreadyExistsException { +func InvalidGrantTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidGrantTokenException { + return func() types.InvalidGrantTokenException { - return types.AlreadyExistsException{ - Message: com_amazonaws_kms_AlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidGrantTokenException{ + Message: com_amazonaws_kms_InvalidGrantTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CustomKeyStoreNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreNotFoundException { - return func() types.CustomKeyStoreNotFoundException { +func InvalidImportTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidImportTokenException { + return func() types.InvalidImportTokenException { - return types.CustomKeyStoreNotFoundException{ - Message: com_amazonaws_kms_CustomKeyStoreNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidImportTokenException{ + Message: com_amazonaws_kms_InvalidImportTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func IncorrectKeyException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectKeyException { - return func() types.IncorrectKeyException { +func InvalidKeyUsageException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidKeyUsageException { + return func() types.InvalidKeyUsageException { - return types.IncorrectKeyException{ - Message: com_amazonaws_kms_IncorrectKeyException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidKeyUsageException{ + Message: com_amazonaws_kms_InvalidKeyUsageException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func KMSInvalidStateException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidStateException { - return func() types.KMSInvalidStateException { +func InvalidMarkerException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidMarkerException { + return func() types.InvalidMarkerException { - return types.KMSInvalidStateException{ - Message: com_amazonaws_kms_KMSInvalidStateException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.InvalidMarkerException{ + Message: com_amazonaws_kms_InvalidMarkerException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksKeyAlreadyInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyAlreadyInUseException { - return func() types.XksKeyAlreadyInUseException { +func KeyUnavailableException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KeyUnavailableException { + return func() types.KeyUnavailableException { - return types.XksKeyAlreadyInUseException{ - Message: com_amazonaws_kms_XksKeyAlreadyInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.KeyUnavailableException{ + Message: com_amazonaws_kms_KeyUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func LimitExceededException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.LimitExceededException { - return func() types.LimitExceededException { +func KMSInternalException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInternalException { + return func() types.KMSInternalException { - return types.LimitExceededException{ - Message: com_amazonaws_kms_LimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.KMSInternalException{ + Message: com_amazonaws_kms_KMSInternalException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func NotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.NotFoundException { - return func() types.NotFoundException { +func KMSInvalidMacException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidMacException { + return func() types.KMSInvalidMacException { - return types.NotFoundException{ - Message: com_amazonaws_kms_NotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.KMSInvalidMacException{ + Message: com_amazonaws_kms_KMSInvalidMacException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyVpcEndpointServiceInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceInUseException { - return func() types.XksProxyVpcEndpointServiceInUseException { +func KMSInvalidSignatureException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidSignatureException { + return func() types.KMSInvalidSignatureException { - return types.XksProxyVpcEndpointServiceInUseException{ - Message: com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.KMSInvalidSignatureException{ + Message: com_amazonaws_kms_KMSInvalidSignatureException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func IncorrectKeyMaterialException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectKeyMaterialException { - return func() types.IncorrectKeyMaterialException { +func KMSInvalidStateException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidStateException { + return func() types.KMSInvalidStateException { - return types.IncorrectKeyMaterialException{ - Message: com_amazonaws_kms_IncorrectKeyMaterialException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.KMSInvalidStateException{ + Message: com_amazonaws_kms_KMSInvalidStateException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CloudHsmClusterNotRelatedException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotRelatedException { - return func() types.CloudHsmClusterNotRelatedException { +func LimitExceededException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.LimitExceededException { + return func() types.LimitExceededException { - return types.CloudHsmClusterNotRelatedException{ - Message: com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.LimitExceededException{ + Message: com_amazonaws_kms_LimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func DisabledException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DisabledException { - return func() types.DisabledException { +func MalformedPolicyDocumentException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.MalformedPolicyDocumentException { + return func() types.MalformedPolicyDocumentException { - return types.DisabledException{ - Message: com_amazonaws_kms_DisabledException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.MalformedPolicyDocumentException{ + Message: com_amazonaws_kms_MalformedPolicyDocumentException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func DependencyTimeoutException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DependencyTimeoutException { - return func() types.DependencyTimeoutException { +func NotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.NotFoundException { + return func() types.NotFoundException { - return types.DependencyTimeoutException{ - Message: com_amazonaws_kms_DependencyTimeoutException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.NotFoundException{ + Message: com_amazonaws_kms_NotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidGrantIdException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidGrantIdException { - return func() types.InvalidGrantIdException { +func TagException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.TagException { + return func() types.TagException { - return types.InvalidGrantIdException{ - Message: com_amazonaws_kms_InvalidGrantIdException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.TagException{ + Message: com_amazonaws_kms_TagException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyInvalidResponseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyInvalidResponseException { - return func() types.XksProxyInvalidResponseException { +func UnsupportedOperationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.UnsupportedOperationException { + return func() types.UnsupportedOperationException { - return types.XksProxyInvalidResponseException{ - Message: com_amazonaws_kms_XksProxyInvalidResponseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.UnsupportedOperationException{ + Message: com_amazonaws_kms_UnsupportedOperationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ConflictException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.ConflictException { - return func() types.ConflictException { +func XksKeyAlreadyInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyAlreadyInUseException { + return func() types.XksKeyAlreadyInUseException { - return types.ConflictException{ - Message: com_amazonaws_kms_ConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksKeyAlreadyInUseException{ + Message: com_amazonaws_kms_XksKeyAlreadyInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidKeyUsageException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidKeyUsageException { - return func() types.InvalidKeyUsageException { +func XksKeyInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyInvalidConfigurationException { + return func() types.XksKeyInvalidConfigurationException { - return types.InvalidKeyUsageException{ - Message: com_amazonaws_kms_InvalidKeyUsageException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksKeyInvalidConfigurationException{ + Message: com_amazonaws_kms_XksKeyInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func KeyUnavailableException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KeyUnavailableException { - return func() types.KeyUnavailableException { +func XksKeyNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyNotFoundException { + return func() types.XksKeyNotFoundException { - return types.KeyUnavailableException{ - Message: com_amazonaws_kms_KeyUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksKeyNotFoundException{ + Message: com_amazonaws_kms_XksKeyNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CloudHsmClusterNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotFoundException { - return func() types.CloudHsmClusterNotFoundException { +func XksProxyIncorrectAuthenticationCredentialException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyIncorrectAuthenticationCredentialException { + return func() types.XksProxyIncorrectAuthenticationCredentialException { - return types.CloudHsmClusterNotFoundException{ - Message: com_amazonaws_kms_CloudHsmClusterNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyIncorrectAuthenticationCredentialException{ + Message: com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidArnException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidArnException { - return func() types.InvalidArnException { +func XksProxyInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyInvalidConfigurationException { + return func() types.XksProxyInvalidConfigurationException { - return types.InvalidArnException{ - Message: com_amazonaws_kms_InvalidArnException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyInvalidConfigurationException{ + Message: com_amazonaws_kms_XksProxyInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CloudHsmClusterInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterInUseException { - return func() types.CloudHsmClusterInUseException { +func XksProxyInvalidResponseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyInvalidResponseException { + return func() types.XksProxyInvalidResponseException { - return types.CloudHsmClusterInUseException{ - Message: com_amazonaws_kms_CloudHsmClusterInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyInvalidResponseException{ + Message: com_amazonaws_kms_XksProxyInvalidResponseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func TagException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.TagException { - return func() types.TagException { +func XksProxyUriEndpointInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriEndpointInUseException { + return func() types.XksProxyUriEndpointInUseException { - return types.TagException{ - Message: com_amazonaws_kms_TagException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyUriEndpointInUseException{ + Message: com_amazonaws_kms_XksProxyUriEndpointInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func InvalidGrantTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidGrantTokenException { - return func() types.InvalidGrantTokenException { +func XksProxyUriInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriInUseException { + return func() types.XksProxyUriInUseException { - return types.InvalidGrantTokenException{ - Message: com_amazonaws_kms_InvalidGrantTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyUriInUseException{ + Message: com_amazonaws_kms_XksProxyUriInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func ExpiredImportTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.ExpiredImportTokenException { - return func() types.ExpiredImportTokenException { +func XksProxyUriUnreachableException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriUnreachableException { + return func() types.XksProxyUriUnreachableException { - return types.ExpiredImportTokenException{ - Message: com_amazonaws_kms_ExpiredImportTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyUriUnreachableException{ + Message: com_amazonaws_kms_XksProxyUriUnreachableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CloudHsmClusterInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterInvalidConfigurationException { - return func() types.CloudHsmClusterInvalidConfigurationException { +func XksProxyVpcEndpointServiceInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceInUseException { + return func() types.XksProxyVpcEndpointServiceInUseException { - return types.CloudHsmClusterInvalidConfigurationException{ - Message: com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyVpcEndpointServiceInUseException{ + Message: com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func XksProxyIncorrectAuthenticationCredentialException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyIncorrectAuthenticationCredentialException { - return func() types.XksProxyIncorrectAuthenticationCredentialException { +func XksProxyVpcEndpointServiceInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceInvalidConfigurationException { + return func() types.XksProxyVpcEndpointServiceInvalidConfigurationException { - return types.XksProxyIncorrectAuthenticationCredentialException{ - Message: com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyVpcEndpointServiceInvalidConfigurationException{ + Message: com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() } -func CustomKeyStoreNameInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreNameInUseException { - return func() types.CustomKeyStoreNameInUseException { +func XksProxyVpcEndpointServiceNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceNotFoundException { + return func() types.XksProxyVpcEndpointServiceNotFoundException { - return types.CustomKeyStoreNameInUseException{ - Message: com_amazonaws_kms_CustomKeyStoreNameInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + return types.XksProxyVpcEndpointServiceNotFoundException{ + Message: com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), } }() @@ -1690,250 +1690,264 @@ func OpaqueError_Output_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) error func Error_FromDafny(err ComAmazonawsKmsTypes.Error) error { // Service Errors - if err.Is_XksProxyVpcEndpointServiceInvalidConfigurationException() { - e := XksProxyVpcEndpointServiceInvalidConfigurationException_FromDafny(err) + if err.Is_AlreadyExistsException() { + e := AlreadyExistsException_FromDafny(err) return &e } - if err.Is_KMSInvalidMacException() { - e := KMSInvalidMacException_FromDafny(err) + if err.Is_CloudHsmClusterInUseException() { + e := CloudHsmClusterInUseException_FromDafny(err) return &e } - if err.Is_UnsupportedOperationException() { - e := UnsupportedOperationException_FromDafny(err) + if err.Is_CloudHsmClusterInvalidConfigurationException() { + e := CloudHsmClusterInvalidConfigurationException_FromDafny(err) return &e } - if err.Is_MalformedPolicyDocumentException() { - e := MalformedPolicyDocumentException_FromDafny(err) + if err.Is_CloudHsmClusterNotActiveException() { + e := CloudHsmClusterNotActiveException_FromDafny(err) return &e } - if err.Is_XksKeyInvalidConfigurationException() { - e := XksKeyInvalidConfigurationException_FromDafny(err) + if err.Is_CloudHsmClusterNotFoundException() { + e := CloudHsmClusterNotFoundException_FromDafny(err) return &e } - if err.Is_XksProxyVpcEndpointServiceNotFoundException() { - e := XksProxyVpcEndpointServiceNotFoundException_FromDafny(err) + if err.Is_CloudHsmClusterNotRelatedException() { + e := CloudHsmClusterNotRelatedException_FromDafny(err) return &e } - if err.Is_InvalidCiphertextException() { - e := InvalidCiphertextException_FromDafny(err) + if err.Is_ConflictException() { + e := ConflictException_FromDafny(err) return &e } - if err.Is_XksProxyUriUnreachableException() { - e := XksProxyUriUnreachableException_FromDafny(err) + if err.Is_CustomKeyStoreHasCMKsException() { + e := CustomKeyStoreHasCMKsException_FromDafny(err) return &e } - if err.Is_InvalidImportTokenException() { - e := InvalidImportTokenException_FromDafny(err) + if err.Is_CustomKeyStoreInvalidStateException() { + e := CustomKeyStoreInvalidStateException_FromDafny(err) return &e } - if err.Is_CloudHsmClusterNotActiveException() { - e := CloudHsmClusterNotActiveException_FromDafny(err) + if err.Is_CustomKeyStoreNameInUseException() { + e := CustomKeyStoreNameInUseException_FromDafny(err) return &e } - if err.Is_InvalidMarkerException() { - e := InvalidMarkerException_FromDafny(err) + if err.Is_CustomKeyStoreNotFoundException() { + e := CustomKeyStoreNotFoundException_FromDafny(err) return &e } - if err.Is_DryRunOperationException() { - e := DryRunOperationException_FromDafny(err) + if err.Is_DependencyTimeoutException() { + e := DependencyTimeoutException_FromDafny(err) return &e } - if err.Is_IncorrectTrustAnchorException() { - e := IncorrectTrustAnchorException_FromDafny(err) + if err.Is_DisabledException() { + e := DisabledException_FromDafny(err) return &e } - if err.Is_KMSInvalidSignatureException() { - e := KMSInvalidSignatureException_FromDafny(err) + if err.Is_DryRunOperationException() { + e := DryRunOperationException_FromDafny(err) return &e } - if err.Is_XksKeyNotFoundException() { - e := XksKeyNotFoundException_FromDafny(err) + if err.Is_ExpiredImportTokenException() { + e := ExpiredImportTokenException_FromDafny(err) return &e } - if err.Is_CustomKeyStoreHasCMKsException() { - e := CustomKeyStoreHasCMKsException_FromDafny(err) + if err.Is_IncorrectKeyException() { + e := IncorrectKeyException_FromDafny(err) return &e } - if err.Is_XksProxyInvalidConfigurationException() { - e := XksProxyInvalidConfigurationException_FromDafny(err) + if err.Is_IncorrectKeyMaterialException() { + e := IncorrectKeyMaterialException_FromDafny(err) return &e } - if err.Is_CustomKeyStoreInvalidStateException() { - e := CustomKeyStoreInvalidStateException_FromDafny(err) + if err.Is_IncorrectTrustAnchorException() { + e := IncorrectTrustAnchorException_FromDafny(err) return &e } - if err.Is_KMSInternalException() { - e := KMSInternalException_FromDafny(err) + if err.Is_InvalidAliasNameException() { + e := InvalidAliasNameException_FromDafny(err) return &e } - if err.Is_XksProxyUriEndpointInUseException() { - e := XksProxyUriEndpointInUseException_FromDafny(err) + if err.Is_InvalidArnException() { + e := InvalidArnException_FromDafny(err) return &e } - if err.Is_InvalidAliasNameException() { - e := InvalidAliasNameException_FromDafny(err) + if err.Is_InvalidCiphertextException() { + e := InvalidCiphertextException_FromDafny(err) return &e } - if err.Is_XksProxyUriInUseException() { - e := XksProxyUriInUseException_FromDafny(err) + if err.Is_InvalidGrantIdException() { + e := InvalidGrantIdException_FromDafny(err) return &e } - if err.Is_AlreadyExistsException() { - e := AlreadyExistsException_FromDafny(err) + if err.Is_InvalidGrantTokenException() { + e := InvalidGrantTokenException_FromDafny(err) return &e } - if err.Is_CustomKeyStoreNotFoundException() { - e := CustomKeyStoreNotFoundException_FromDafny(err) + if err.Is_InvalidImportTokenException() { + e := InvalidImportTokenException_FromDafny(err) return &e } - if err.Is_IncorrectKeyException() { - e := IncorrectKeyException_FromDafny(err) + if err.Is_InvalidKeyUsageException() { + e := InvalidKeyUsageException_FromDafny(err) return &e } - if err.Is_KMSInvalidStateException() { - e := KMSInvalidStateException_FromDafny(err) + if err.Is_InvalidMarkerException() { + e := InvalidMarkerException_FromDafny(err) return &e } - if err.Is_XksKeyAlreadyInUseException() { - e := XksKeyAlreadyInUseException_FromDafny(err) + if err.Is_KeyUnavailableException() { + e := KeyUnavailableException_FromDafny(err) return &e } - if err.Is_LimitExceededException() { - e := LimitExceededException_FromDafny(err) + if err.Is_KMSInternalException() { + e := KMSInternalException_FromDafny(err) return &e } - if err.Is_NotFoundException() { - e := NotFoundException_FromDafny(err) + if err.Is_KMSInvalidMacException() { + e := KMSInvalidMacException_FromDafny(err) return &e } - if err.Is_XksProxyVpcEndpointServiceInUseException() { - e := XksProxyVpcEndpointServiceInUseException_FromDafny(err) + if err.Is_KMSInvalidSignatureException() { + e := KMSInvalidSignatureException_FromDafny(err) return &e } - if err.Is_IncorrectKeyMaterialException() { - e := IncorrectKeyMaterialException_FromDafny(err) + if err.Is_KMSInvalidStateException() { + e := KMSInvalidStateException_FromDafny(err) return &e } - if err.Is_CloudHsmClusterNotRelatedException() { - e := CloudHsmClusterNotRelatedException_FromDafny(err) + if err.Is_LimitExceededException() { + e := LimitExceededException_FromDafny(err) return &e } - if err.Is_DisabledException() { - e := DisabledException_FromDafny(err) + if err.Is_MalformedPolicyDocumentException() { + e := MalformedPolicyDocumentException_FromDafny(err) return &e } - if err.Is_DependencyTimeoutException() { - e := DependencyTimeoutException_FromDafny(err) + if err.Is_NotFoundException() { + e := NotFoundException_FromDafny(err) return &e } - if err.Is_InvalidGrantIdException() { - e := InvalidGrantIdException_FromDafny(err) + if err.Is_TagException() { + e := TagException_FromDafny(err) return &e } - if err.Is_XksProxyInvalidResponseException() { - e := XksProxyInvalidResponseException_FromDafny(err) + if err.Is_UnsupportedOperationException() { + e := UnsupportedOperationException_FromDafny(err) return &e } - if err.Is_ConflictException() { - e := ConflictException_FromDafny(err) + if err.Is_XksKeyAlreadyInUseException() { + e := XksKeyAlreadyInUseException_FromDafny(err) return &e } - if err.Is_InvalidKeyUsageException() { - e := InvalidKeyUsageException_FromDafny(err) + if err.Is_XksKeyInvalidConfigurationException() { + e := XksKeyInvalidConfigurationException_FromDafny(err) return &e } - if err.Is_KeyUnavailableException() { - e := KeyUnavailableException_FromDafny(err) + if err.Is_XksKeyNotFoundException() { + e := XksKeyNotFoundException_FromDafny(err) return &e } - if err.Is_CloudHsmClusterNotFoundException() { - e := CloudHsmClusterNotFoundException_FromDafny(err) + if err.Is_XksProxyIncorrectAuthenticationCredentialException() { + e := XksProxyIncorrectAuthenticationCredentialException_FromDafny(err) return &e } - if err.Is_InvalidArnException() { - e := InvalidArnException_FromDafny(err) + if err.Is_XksProxyInvalidConfigurationException() { + e := XksProxyInvalidConfigurationException_FromDafny(err) return &e } - if err.Is_CloudHsmClusterInUseException() { - e := CloudHsmClusterInUseException_FromDafny(err) + if err.Is_XksProxyInvalidResponseException() { + e := XksProxyInvalidResponseException_FromDafny(err) return &e } - if err.Is_TagException() { - e := TagException_FromDafny(err) + if err.Is_XksProxyUriEndpointInUseException() { + e := XksProxyUriEndpointInUseException_FromDafny(err) return &e } - if err.Is_InvalidGrantTokenException() { - e := InvalidGrantTokenException_FromDafny(err) + if err.Is_XksProxyUriInUseException() { + e := XksProxyUriInUseException_FromDafny(err) return &e } - if err.Is_ExpiredImportTokenException() { - e := ExpiredImportTokenException_FromDafny(err) + if err.Is_XksProxyUriUnreachableException() { + e := XksProxyUriUnreachableException_FromDafny(err) return &e } - if err.Is_CloudHsmClusterInvalidConfigurationException() { - e := CloudHsmClusterInvalidConfigurationException_FromDafny(err) + if err.Is_XksProxyVpcEndpointServiceInUseException() { + e := XksProxyVpcEndpointServiceInUseException_FromDafny(err) return &e } - if err.Is_XksProxyIncorrectAuthenticationCredentialException() { - e := XksProxyIncorrectAuthenticationCredentialException_FromDafny(err) + if err.Is_XksProxyVpcEndpointServiceInvalidConfigurationException() { + e := XksProxyVpcEndpointServiceInvalidConfigurationException_FromDafny(err) return &e } - if err.Is_CustomKeyStoreNameInUseException() { - e := CustomKeyStoreNameInUseException_FromDafny(err) + if err.Is_XksProxyVpcEndpointServiceNotFoundException() { + e := XksProxyVpcEndpointServiceNotFoundException_FromDafny(err) return &e } return OpaqueError_Output_FromDafny(err) } -func com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CancelKeyDeletionInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CancelKeyDeletionOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -1949,23 +1963,39 @@ func com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_m } }() } -func com_amazonaws_kms_VerifyMacOutput_MacValid_FromDafny(input interface{}) bool { - return func() bool { - var b bool - if input == nil { - return b +func com_amazonaws_kms_ConnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - b = input.(bool) - return b }() } -func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateAliasInput_AliasName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + }() +} +func com_amazonaws_kms_CreateAliasInput_TargetKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -1975,7 +2005,7 @@ func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreName_FromDafny } }() } -func com_amazonaws_kms_CreateGrantInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreName_FromDafny(input interface{}) *string { return func() *string { var s string @@ -1989,7 +2019,7 @@ func com_amazonaws_kms_CreateGrantInput_KeyId_FromDafny(input interface{}) *stri } }() } -func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2005,7 +2035,7 @@ func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_FromDafny(inp } }() } -func com_amazonaws_kms_KeyListEntry_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateCustomKeyStoreInput_TrustAnchorCertificate_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2021,11 +2051,13 @@ func com_amazonaws_kms_KeyListEntry_KeyId_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_VerifyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateCustomKeyStoreInput_KeyStorePassword_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -2035,40 +2067,44 @@ func com_amazonaws_kms_VerifyInput_KeyId_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreType_FromDafny(input interface{}) types.CustomKeyStoreType { + return func() types.CustomKeyStoreType { + var u types.CustomKeyStoreType if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsKmsTypes.CustomKeyStoreType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomKeyStoreType).Equals(inputEnum) { + break + } } - m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m + return u.Values()[index] }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2084,11 +2120,13 @@ func com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_ConnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -2098,17 +2136,18 @@ func com_amazonaws_kms_ConnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(inp } }() } -func com_amazonaws_kms_DeriveSharedSecretInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(input interface{}) *types.XksProxyAuthenticationCredentialType { + return func() *types.XksProxyAuthenticationCredentialType { if input == nil { return nil } - b = input.(bool) - return &b + return &types.XksProxyAuthenticationCredentialType{ + AccessKeyId: com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_AccessKeyId()), + RawSecretAccessKey: com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_RawSecretAccessKey()), + } }() } -func com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -2122,49 +2161,34 @@ func com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_F } }() } -func com_amazonaws_kms_GetPublicKeyOutput_EncryptionAlgorithms_FromDafny(input interface{}) []types.EncryptionAlgorithmSpec { - return func() []types.EncryptionAlgorithmSpec { - var fieldValue []types.EncryptionAlgorithmSpec - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_kms_ReEncryptInput_CiphertextBlob_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input interface{}) *string { + return func() *string { + var s string + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_GetParametersForImportInput_WrappingKeySpec_FromDafny(input interface{}) types.WrappingKeySpec { - return func() types.WrappingKeySpec { - var u types.WrappingKeySpec +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { + return func() types.XksProxyConnectivityType { + var u types.XksProxyConnectivityType + if input == nil { + return u + } - inputEnum := input.(ComAmazonawsKmsTypes.WrappingKeySpec) + inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_WrappingKeySpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.WrappingKeySpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { break } } @@ -2172,32 +2196,51 @@ func com_amazonaws_kms_GetParametersForImportInput_WrappingKeySpec_FromDafny(inp return u.Values()[index] }() } -func com_amazonaws_kms_RotationsListEntry_RotationDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_CreateCustomKeyStoreOutput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_kms_ConflictException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateGrantInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_GranteePrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_RetiringPrincipal_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2213,20 +2256,31 @@ func com_amazonaws_kms_ConflictException_message_FromDafny(input interface{}) *s } }() } -func com_amazonaws_kms_SignOutput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { - return func() types.SigningAlgorithmSpec { - var u types.SigningAlgorithmSpec - if input == nil { - return u +func com_amazonaws_kms_CreateGrantInput_Operations_FromDafny(input interface{}) []types.GrantOperation { + return func() []types.GrantOperation { + var fieldValue []types.GrantOperation + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantOperationList_member_FromDafny(val)) } + return fieldValue + }() +} +func com_amazonaws_kms_GrantOperationList_member_FromDafny(input interface{}) types.GrantOperation { + return func() types.GrantOperation { + var u types.GrantOperation - inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + inputEnum := input.(ComAmazonawsKmsTypes.GrantOperation) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_GrantOperation_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.GrantOperation).Equals(inputEnum) { break } } @@ -2234,90 +2288,82 @@ func com_amazonaws_kms_SignOutput_SigningAlgorithm_FromDafny(input interface{}) return u.Values()[index] }() } -func com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { - return func() types.KeyUsageType { - var u types.KeyUsageType +func com_amazonaws_kms_CreateGrantInput_Constraints_FromDafny(input interface{}) *types.GrantConstraints { + return func() *types.GrantConstraints { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { - break - } - } + return &types.GrantConstraints{ + EncryptionContextSubset: com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextSubset().UnwrapOr(nil)), + EncryptionContextEquals: com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextEquals().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_kms_GenerateDataKeyOutput_CiphertextBlob_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return b - } else { - b = append(b, val.(byte)) + break } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_kms_GetKeyPolicyInput_PolicyName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_EncryptionContextType_key_FromDafny(input interface{}) string { + return func() string { var s string if input == nil { - return nil + return s } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_CreateAliasInput_TargetKeyId_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_EncryptionContextType_value_FromDafny(input interface{}) string { + return func() string { var s string - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_ListKeysOutput_Keys_FromDafny(input interface{}) []types.KeyListEntry { - return func() []types.KeyListEntry { - var fieldValue []types.KeyListEntry +func com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_kms_KeyList_member_FromDafny(val)) + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_kms_ReEncryptInput_GrantTokens_FromDafny(input interface{}) []string { +func com_amazonaws_kms_CreateGrantInput_GrantTokens_FromDafny(input interface{}) []string { return func() []string { var fieldValue []string if input == nil { @@ -2333,69 +2379,63 @@ func com_amazonaws_kms_ReEncryptInput_GrantTokens_FromDafny(input interface{}) [ return fieldValue }() } -func com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_GrantTokenList_member_FromDafny(input interface{}) string { + return func() string { var s string - if input == nil { - return nil - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_DecryptOutput_Plaintext_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_CreateGrantInput_Name_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } +func com_amazonaws_kms_CreateGrantInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil } + b = input.(bool) + return &b }() } -func com_amazonaws_kms_VerifyInput_Message_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_CreateGrantOutput_GrantToken_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_CloudHsmClusterNotActiveException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateGrantOutput_GrantId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2411,7 +2451,7 @@ func com_amazonaws_kms_CloudHsmClusterNotActiveException_message_FromDafny(input } }() } -func com_amazonaws_kms_InvalidMarkerException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateKeyInput_Policy_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2427,11 +2467,13 @@ func com_amazonaws_kms_InvalidMarkerException_message_FromDafny(input interface{ } }() } -func com_amazonaws_kms_DeleteCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateKeyInput_Description_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -2441,30 +2483,41 @@ func com_amazonaws_kms_DeleteCustomKeyStoreInput_CustomKeyStoreId_FromDafny(inpu } }() } -func com_amazonaws_kms_ReEncryptInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_kms_CreateKeyInput_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { + return func() types.KeyUsageType { + var u types.KeyUsageType if input == nil { - return nil + return u } - b = input.(bool) - return &b + + inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] }() } -func com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input interface{}) types.KeyManagerType { - return func() types.KeyManagerType { - var u types.KeyManagerType +func com_amazonaws_kms_CreateKeyInput_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { + return func() types.CustomerMasterKeySpec { + var u types.CustomerMasterKeySpec if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.KeyManagerType) + inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyManagerType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.KeyManagerType).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { break } } @@ -2472,53 +2525,77 @@ func com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input interface{}) types return u.Values()[index] }() } -func com_amazonaws_kms_EncryptInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_CreateKeyInput_KeySpec_FromDafny(input interface{}) types.KeySpec { + return func() types.KeySpec { + var u types.KeySpec + if input == nil { + return u + } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_KeyStorePassword_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_CreateKeyInput_Origin_FromDafny(input interface{}) types.OriginType { + return func() types.OriginType { + var u types.OriginType if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsKmsTypes.OriginType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_TagKeyList_member_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_kms_CreateKeyInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { var s string - + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_GenerateMacInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_CreateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_CreateKeyInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag if input == nil { return nil } @@ -2527,63 +2604,59 @@ func com_amazonaws_kms_GenerateMacInput_GrantTokens_FromDafny(input interface{}) if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_kms_DecryptOutput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec - if input == nil { - return u +func com_amazonaws_kms_TagList_member_FromDafny(input interface{}) types.Tag { + return func() types.Tag { + + return types.Tag{ + TagKey: com_amazonaws_kms_Tag_TagKey_FromDafny(input.(ComAmazonawsKmsTypes.Tag).Dtor_TagKey()), + TagValue: com_amazonaws_kms_Tag_TagValue_FromDafny(input.(ComAmazonawsKmsTypes.Tag).Dtor_TagValue()), } + }() +} +func com_amazonaws_kms_Tag_TagKey_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_KeyList_member_FromDafny(input interface{}) types.KeyListEntry { - return func() types.KeyListEntry { +func com_amazonaws_kms_Tag_TagValue_FromDafny(input interface{}) *string { + return func() *string { + var s string - return types.KeyListEntry{ - KeyId: com_amazonaws_kms_KeyListEntry_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyListEntry).Dtor_KeyId().UnwrapOr(nil)), - KeyArn: com_amazonaws_kms_KeyListEntry_KeyArn_FromDafny(input.(ComAmazonawsKmsTypes.KeyListEntry).Dtor_KeyArn().UnwrapOr(nil)), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_kms_CreateKeyInput_KeySpec_FromDafny(input interface{}) types.KeySpec { - return func() types.KeySpec { - var u types.KeySpec +func com_amazonaws_kms_CreateKeyInput_MultiRegion_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { - break - } - } + return nil } - return u.Values()[index] + b = input.(bool) + return &b }() } -func com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateKeyInput_XksKeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2599,7 +2672,41 @@ func com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CreateKeyOutput_KeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { + return func() *types.KeyMetadata { + if input == nil { + return nil + } + return &types.KeyMetadata{ + AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), + Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), + Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), + Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), + KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), + DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), + ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), + Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), + KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), + EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), + SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), + KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), + MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), + MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), + PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), + MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), + XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2615,50 +2722,39 @@ func com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_FromDafny(input int } }() } -func com_amazonaws_kms_MultiRegionKeyList_member_FromDafny(input interface{}) types.MultiRegionKey { - return func() types.MultiRegionKey { +func com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string - return types.MultiRegionKey{ - Arn: com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Arn().UnwrapOr(nil)), - Region: com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Region().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_ListGrantsOutput_Grants_FromDafny(input interface{}) []types.GrantListEntry { - return func() []types.GrantListEntry { - var fieldValue []types.GrantListEntry - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_GenerateDataKeyPairOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_DescribeCustomKeyStoresOutput_CustomKeyStores_FromDafny(input interface{}) []types.CustomKeyStoresListEntry { - return func() []types.CustomKeyStoresListEntry { - var fieldValue []types.CustomKeyStoresListEntry +func com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -2666,61 +2762,61 @@ func com_amazonaws_kms_DescribeCustomKeyStoresOutput_CustomKeyStores_FromDafny(i val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_CustomKeyStoresList_member_FromDafny(val)) } - return fieldValue + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_kms_ReEncryptOutput_DestinationEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec +func com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } - } + return b } - return u.Values()[index] + b = input.(bool) + return b }() } -func com_amazonaws_kms_TagResourceInput_Tags_FromDafny(input interface{}) []types.Tag { - return func() []types.Tag { - var fieldValue []types.Tag - +func com_amazonaws_kms_KeyMetadata_Description_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreType_FromDafny(input interface{}) types.CustomKeyStoreType { - return func() types.CustomKeyStoreType { - var u types.CustomKeyStoreType +func com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { + return func() types.KeyUsageType { + var u types.KeyUsageType if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.CustomKeyStoreType) + inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.CustomKeyStoreType).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { break } } @@ -2728,20 +2824,20 @@ func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreType_FromDafny(in return u.Values()[index] }() } -func com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input interface{}) types.OriginType { - return func() types.OriginType { - var u types.OriginType +func com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input interface{}) types.KeyState { + return func() types.KeyState { + var u types.KeyState if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.OriginType) + inputEnum := input.(ComAmazonawsKmsTypes.KeyState) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.KeyState).Equals(inputEnum) { break } } @@ -2749,99 +2845,78 @@ func com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input interface{}) types.Ori return u.Values()[index] }() } -func com_amazonaws_kms_ListKeyPoliciesInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_kms_GenerateMacInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_kms_XksProxyInvalidResponseException_message_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } - }() -} -func com_amazonaws_kms_SignInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + return &t } - return fieldValue }() } -func com_amazonaws_kms_CloudHsmClusterNotFoundException_message_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_PolicyNameList_member_FromDafny(input interface{}) string { - return func() string { - var s string - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_kms_GenerateRandomInput_NumberOfBytes_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input interface{}) types.OriginType { + return func() types.OriginType { + var u types.OriginType if input == nil { - return nil + return u } - i = input.(int32) - return &i + + inputEnum := input.(ComAmazonawsKmsTypes.OriginType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] }() } -func com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -2857,11 +2932,13 @@ func com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input interface{} } }() } -func com_amazonaws_kms_GetPublicKeyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -2871,20 +2948,20 @@ func com_amazonaws_kms_GetPublicKeyInput_KeyId_FromDafny(input interface{}) *str } }() } -func com_amazonaws_kms_GetPublicKeyOutput_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { - return func() types.KeyUsageType { - var u types.KeyUsageType +func com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input interface{}) types.ExpirationModelType { + return func() types.ExpirationModelType { + var u types.ExpirationModelType if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) + inputEnum := input.(ComAmazonawsKmsTypes.ExpirationModelType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.ExpirationModelType).Equals(inputEnum) { break } } @@ -2892,66 +2969,62 @@ func com_amazonaws_kms_GetPublicKeyOutput_KeyUsage_FromDafny(input interface{}) return u.Values()[index] }() } -func com_amazonaws_kms_RotationsListEntry_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input interface{}) types.KeyManagerType { + return func() types.KeyManagerType { + var u types.KeyManagerType if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsKmsTypes.KeyManagerType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyManagerType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyManagerType).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_CreateGrantInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { + return func() types.CustomerMasterKeySpec { + var u types.CustomerMasterKeySpec if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + return u } - return fieldValue - }() -} -func com_amazonaws_kms_ScheduleKeyDeletionInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_GenerateMacOutput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { - return func() types.MacAlgorithmSpec { - var u types.MacAlgorithmSpec +func com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input interface{}) types.KeySpec { + return func() types.KeySpec { + var u types.KeySpec if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { break } } @@ -2959,37 +3032,57 @@ func com_amazonaws_kms_GenerateMacOutput_MacAlgorithm_FromDafny(input interface{ return u.Values()[index] }() } -func com_amazonaws_kms_RetireGrantInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input interface{}) []types.EncryptionAlgorithmSpec { + return func() []types.EncryptionAlgorithmSpec { + var fieldValue []types.EncryptionAlgorithmSpec if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec - for i := dafny.Iterate(input); ; { + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input interface{}) []types.SigningAlgorithmSpec { + return func() []types.SigningAlgorithmSpec { + var fieldValue []types.SigningAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_SignInput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { +func com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(input interface{}) types.SigningAlgorithmSpec { return func() types.SigningAlgorithmSpec { var u types.SigningAlgorithmSpec @@ -3007,27 +3100,33 @@ func com_amazonaws_kms_SignInput_SigningAlgorithm_FromDafny(input interface{}) t return u.Values()[index] }() } -func com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input interface{}) []types.KeyAgreementAlgorithmSpec { + return func() []types.KeyAgreementAlgorithmSpec { + var fieldValue []types.KeyAgreementAlgorithmSpec if input == nil { return nil } - i = input.(int32) - return &i + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue }() } -func com_amazonaws_kms_GenerateDataKeyPairInput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { - return func() types.DataKeyPairSpec { - var u types.DataKeyPairSpec +func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { + return func() types.KeyAgreementAlgorithmSpec { + var u types.KeyAgreementAlgorithmSpec - inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + inputEnum := input.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec).Equals(inputEnum) { break } } @@ -3035,20 +3134,42 @@ func com_amazonaws_kms_GenerateDataKeyPairInput_KeyPairSpec_FromDafny(input inte return u.Values()[index] }() } -func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input interface{}) types.KeyEncryptionMechanism { - return func() types.KeyEncryptionMechanism { - var u types.KeyEncryptionMechanism +func com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input interface{}) *types.MultiRegionConfiguration { + return func() *types.MultiRegionConfiguration { + if input == nil { + return nil + } + return &types.MultiRegionConfiguration{ + MultiRegionKeyType: com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_MultiRegionKeyType().UnwrapOr(nil)), + PrimaryKey: com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_PrimaryKey().UnwrapOr(nil)), + ReplicaKeys: com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_ReplicaKeys().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_FromDafny(input interface{}) types.MultiRegionKeyType { + return func() types.MultiRegionKeyType { + var u types.MultiRegionKeyType if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.KeyEncryptionMechanism) + inputEnum := input.(ComAmazonawsKmsTypes.MultiRegionKeyType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyEncryptionMechanism_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MultiRegionKeyType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.KeyEncryptionMechanism).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.MultiRegionKeyType).Equals(inputEnum) { break } } @@ -3056,29 +3177,24 @@ func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input inte return u.Values()[index] }() } -func com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(input interface{}) types.SigningAlgorithmSpec { - return func() types.SigningAlgorithmSpec { - var u types.SigningAlgorithmSpec - - inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { - break - } - } +func com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_FromDafny(input interface{}) *types.MultiRegionKey { + return func() *types.MultiRegionKey { + if input == nil { + return nil + } + return &types.MultiRegionKey{ + Arn: com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Arn().UnwrapOr(nil)), + Region: com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Region().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_kms_RevokeGrantInput_GrantId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -3088,7 +3204,7 @@ func com_amazonaws_kms_RevokeGrantInput_GrantId_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_ReEncryptInput_SourceKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3104,9 +3220,9 @@ func com_amazonaws_kms_ReEncryptInput_SourceKeyId_FromDafny(input interface{}) * } }() } -func com_amazonaws_kms_VerifyInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_FromDafny(input interface{}) []types.MultiRegionKey { + return func() []types.MultiRegionKey { + var fieldValue []types.MultiRegionKey if input == nil { return nil } @@ -3115,85 +3231,75 @@ func com_amazonaws_kms_VerifyInput_GrantTokens_FromDafny(input interface{}) []st if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_kms_MultiRegionKeyList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_kms_ListAliasesInput_Marker_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_MultiRegionKeyList_member_FromDafny(input interface{}) types.MultiRegionKey { + return func() types.MultiRegionKey { + + return types.MultiRegionKey{ + Arn: com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Arn().UnwrapOr(nil)), + Region: com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Region().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + i = input.(int32) + return &i }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input interface{}) []types.MacAlgorithmSpec { + return func() []types.MacAlgorithmSpec { + var fieldValue []types.MacAlgorithmSpec if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_MacAlgorithmSpecList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_ListKeyPoliciesInput_Marker_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) +func com_amazonaws_kms_MacAlgorithmSpecList_member_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_AliasListEntry_LastUpdatedDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input interface{}) *types.XksKeyConfigurationType { + return func() *types.XksKeyConfigurationType { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + return &types.XksKeyConfigurationType{ + Id: com_amazonaws_kms_XksKeyConfigurationType_Id_FromDafny(input.(ComAmazonawsKmsTypes.XksKeyConfigurationType).Dtor_Id().UnwrapOr(nil)), } }() } -func com_amazonaws_kms_XksProxyUriInUseException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksKeyConfigurationType_Id_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3209,23 +3315,23 @@ func com_amazonaws_kms_XksProxyUriInUseException_message_FromDafny(input interfa } }() } -func com_amazonaws_kms_CreateGrantInput_RetiringPrincipal_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_DecryptInput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_ReEncryptInput_SourceEncryptionContext_FromDafny(input interface{}) map[string]string { +func com_amazonaws_kms_DecryptInput_EncryptionContext_FromDafny(input interface{}) map[string]string { return func() map[string]string { var m map[string]string = make(map[string]string) if input == nil { @@ -3242,7 +3348,7 @@ func com_amazonaws_kms_ReEncryptInput_SourceEncryptionContext_FromDafny(input in return m }() } -func com_amazonaws_kms_EncryptInput_GrantTokens_FromDafny(input interface{}) []string { +func com_amazonaws_kms_DecryptInput_GrantTokens_FromDafny(input interface{}) []string { return func() []string { var fieldValue []string if input == nil { @@ -3258,7 +3364,7 @@ func com_amazonaws_kms_EncryptInput_GrantTokens_FromDafny(input interface{}) []s return fieldValue }() } -func com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DecryptInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3274,79 +3380,76 @@ func com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_From } }() } -func com_amazonaws_kms_CreateKeyInput_MultiRegion_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_kms_CreateKeyInput_Tags_FromDafny(input interface{}) []types.Tag { - return func() []types.Tag { - var fieldValue []types.Tag +func com_amazonaws_kms_DecryptInput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_kms_InvalidImportTokenException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_DecryptInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), } }() } -func com_amazonaws_kms_GenerateMacInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input interface{}) types.KeyEncryptionMechanism { + return func() types.KeyEncryptionMechanism { + var u types.KeyEncryptionMechanism + if input == nil { + return u + } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + inputEnum := input.(ComAmazonawsKmsTypes.KeyEncryptionMechanism) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyEncryptionMechanism_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyEncryptionMechanism).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_UnsupportedOperationException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_DryRun_FromDafny(input interface{}) *bool { +func com_amazonaws_kms_DecryptInput_DryRun_FromDafny(input interface{}) *bool { return func() *bool { var b bool if input == nil { @@ -3356,7 +3459,7 @@ func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_DryRun_FromDafny(inp return &b }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_KeyStorePassword_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DecryptOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3372,49 +3475,23 @@ func com_amazonaws_kms_CreateCustomKeyStoreInput_KeyStorePassword_FromDafny(inpu } }() } -func com_amazonaws_kms_GenerateMacOutput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_DecryptOutput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_CreateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { - return func() bool { - var b bool - if input == nil { - return b - } - b = input.(bool) - return b - }() -} -func com_amazonaws_kms_GrantListEntry_Operations_FromDafny(input interface{}) []types.GrantOperation { - return func() []types.GrantOperation { - var fieldValue []types.GrantOperation - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + b = append(b, val.(byte)) } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantOperationList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_EncryptOutput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { +func com_amazonaws_kms_DecryptOutput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { return func() types.EncryptionAlgorithmSpec { var u types.EncryptionAlgorithmSpec if input == nil { @@ -3435,52 +3512,65 @@ func com_amazonaws_kms_EncryptOutput_EncryptionAlgorithm_FromDafny(input interfa return u.Values()[index] }() } -func com_amazonaws_kms_EncryptionContextType_value_FromDafny(input interface{}) string { - return func() string { +func com_amazonaws_kms_DecryptOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DeleteAliasInput_AliasName_FromDafny(input interface{}) *string { + return func() *string { var s string - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeySpec_FromDafny(input interface{}) types.DataKeySpec { - return func() types.DataKeySpec { - var u types.DataKeySpec - if input == nil { - return u - } +func com_amazonaws_kms_DeleteCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.DataKeySpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.DataKeySpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_RotationsList_member_FromDafny(input interface{}) types.RotationsListEntry { - return func() types.RotationsListEntry { +func com_amazonaws_kms_DeleteImportedKeyMaterialInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string - return types.RotationsListEntry{ - KeyId: com_amazonaws_kms_RotationsListEntry_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_KeyId().UnwrapOr(nil)), - RotationDate: com_amazonaws_kms_RotationsListEntry_RotationDate_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_RotationDate().UnwrapOr(nil)), - RotationType: com_amazonaws_kms_RotationsListEntry_RotationType_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_RotationType().UnwrapOr(nil)), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_kms_DisableKeyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DeriveSharedSecretInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -3494,7 +3584,7 @@ func com_amazonaws_kms_DisableKeyInput_KeyId_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { +func com_amazonaws_kms_DeriveSharedSecretInput_KeyAgreementAlgorithm_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { return func() types.KeyAgreementAlgorithmSpec { var u types.KeyAgreementAlgorithmSpec @@ -3512,81 +3602,60 @@ func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(input inte return u.Values()[index] }() } -func com_amazonaws_kms_ReEncryptInput_SourceEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec +func com_amazonaws_kms_DeriveSharedSecretInput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_DeriveSharedSecretInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_GenerateDataKeyInput_KeySpec_FromDafny(input interface{}) types.DataKeySpec { - return func() types.DataKeySpec { - var u types.DataKeySpec +func com_amazonaws_kms_DeriveSharedSecretInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.DataKeySpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.DataKeySpec).Equals(inputEnum) { - break - } - } + return nil } - return u.Values()[index] + b = input.(bool) + return &b }() } -func com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input interface{}) []types.KeyAgreementAlgorithmSpec { - return func() []types.KeyAgreementAlgorithmSpec { - var fieldValue []types.KeyAgreementAlgorithmSpec +func com_amazonaws_kms_DeriveSharedSecretInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(val)) + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), } - return fieldValue }() } -func com_amazonaws_kms_AliasListEntry_AliasName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DeriveSharedSecretOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3602,30 +3671,52 @@ func com_amazonaws_kms_AliasListEntry_AliasName_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_VerifyMacInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_kms_DeriveSharedSecretOutput_SharedSecret_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - b = input.(bool) - return &b + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() } -func com_amazonaws_kms_DecryptInput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec +func com_amazonaws_kms_DeriveSharedSecretOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretOutput_KeyAgreementAlgorithm_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { + return func() types.KeyAgreementAlgorithmSpec { + var u types.KeyAgreementAlgorithmSpec if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + inputEnum := input.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec).Equals(inputEnum) { break } } @@ -3633,7 +3724,28 @@ func com_amazonaws_kms_DecryptInput_EncryptionAlgorithm_FromDafny(input interfac return u.Values()[index] }() } -func com_amazonaws_kms_GenerateDataKeyOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DeriveSharedSecretOutput_KeyOrigin_FromDafny(input interface{}) types.OriginType { + return func() types.OriginType { + var u types.OriginType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.OriginType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3649,18 +3761,23 @@ func com_amazonaws_kms_GenerateDataKeyOutput_KeyId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_CreateGrantInput_Constraints_FromDafny(input interface{}) *types.GrantConstraints { - return func() *types.GrantConstraints { +func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.GrantConstraints{ - EncryptionContextSubset: com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextSubset().UnwrapOr(nil)), - EncryptionContextEquals: com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextEquals().UnwrapOr(nil)), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_kms_EnableKeyRotationInput_RotationPeriodInDays_FromDafny(input interface{}) *int32 { +func com_amazonaws_kms_DescribeCustomKeyStoresInput_Limit_FromDafny(input interface{}) *int32 { return func() *int32 { var i int32 if input == nil { @@ -3670,7 +3787,7 @@ func com_amazonaws_kms_EnableKeyRotationInput_RotationPeriodInDays_FromDafny(inp return &i }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_NewCustomKeyStoreName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DescribeCustomKeyStoresInput_Marker_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3686,17 +3803,39 @@ func com_amazonaws_kms_UpdateCustomKeyStoreInput_NewCustomKeyStoreName_FromDafny } }() } -func com_amazonaws_kms_VerifyInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_kms_DescribeCustomKeyStoresOutput_CustomKeyStores_FromDafny(input interface{}) []types.CustomKeyStoresListEntry { + return func() []types.CustomKeyStoresListEntry { + var fieldValue []types.CustomKeyStoresListEntry if input == nil { return nil } - b = input.(bool) - return &b + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_CustomKeyStoresList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_CustomKeyStoresList_member_FromDafny(input interface{}) types.CustomKeyStoresListEntry { + return func() types.CustomKeyStoresListEntry { + + return types.CustomKeyStoresListEntry{ + CustomKeyStoreId: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CustomKeyStoreName: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreName().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + TrustAnchorCertificate: com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_TrustAnchorCertificate().UnwrapOr(nil)), + ConnectionState: com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_ConnectionState().UnwrapOr(nil)), + ConnectionErrorCode: com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_ConnectionErrorCode().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CreationDate().UnwrapOr(nil)), + CustomKeyStoreType: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreType().UnwrapOr(nil)), + XksProxyConfiguration: com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_XksProxyConfiguration().UnwrapOr(nil)), + } }() } -func com_amazonaws_kms_ListGrantsInput_GrantId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3712,11 +3851,13 @@ func com_amazonaws_kms_ListGrantsInput_GrantId_FromDafny(input interface{}) *str } }() } -func com_amazonaws_kms_TagResourceInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -3726,7 +3867,7 @@ func com_amazonaws_kms_TagResourceInput_KeyId_FromDafny(input interface{}) *stri } }() } -func com_amazonaws_kms_CreateCustomKeyStoreOutput_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3742,27 +3883,13 @@ func com_amazonaws_kms_CreateCustomKeyStoreOutput_CustomKeyStoreId_FromDafny(inp } }() } -func com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyCiphertextBlob_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func com_amazonaws_kms_EnableKeyRotationInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -3772,17 +3899,20 @@ func com_amazonaws_kms_EnableKeyRotationInput_KeyId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_GenerateMacInput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { - return func() types.MacAlgorithmSpec { - var u types.MacAlgorithmSpec +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_FromDafny(input interface{}) types.ConnectionStateType { + return func() types.ConnectionStateType { + var u types.ConnectionStateType + if input == nil { + return u + } - inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + inputEnum := input.(ComAmazonawsKmsTypes.ConnectionStateType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionStateType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.ConnectionStateType).Equals(inputEnum) { break } } @@ -3790,20 +3920,20 @@ func com_amazonaws_kms_GenerateMacInput_MacAlgorithm_FromDafny(input interface{} return u.Values()[index] }() } -func com_amazonaws_kms_CreateKeyInput_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { - return func() types.CustomerMasterKeySpec { - var u types.CustomerMasterKeySpec +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_FromDafny(input interface{}) types.ConnectionErrorCodeType { + return func() types.ConnectionErrorCodeType { + var u types.ConnectionErrorCodeType if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) + inputEnum := input.(ComAmazonawsKmsTypes.ConnectionErrorCodeType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionErrorCodeType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.ConnectionErrorCodeType).Equals(inputEnum) { break } } @@ -3811,9 +3941,9 @@ func com_amazonaws_kms_CreateKeyInput_CustomerMasterKeySpec_FromDafny(input inte return u.Values()[index] }() } -func com_amazonaws_kms_ListAliasesOutput_Aliases_FromDafny(input interface{}) []types.AliasListEntry { - return func() []types.AliasListEntry { - var fieldValue []types.AliasListEntry +func com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -3821,42 +3951,35 @@ func com_amazonaws_kms_ListAliasesOutput_Aliases_FromDafny(input interface{}) [] val, ok := i() if !ok { break - } - fieldValue = append(fieldValue, com_amazonaws_kms_AliasList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_kms_DeriveSharedSecretOutput_KeyAgreementAlgorithm_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { - return func() types.KeyAgreementAlgorithmSpec { - var u types.KeyAgreementAlgorithmSpec +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_FromDafny(input interface{}) types.CustomKeyStoreType { + return func() types.CustomKeyStoreType { + var u types.CustomKeyStoreType if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) + inputEnum := input.(ComAmazonawsKmsTypes.CustomKeyStoreType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.CustomKeyStoreType).Equals(inputEnum) { break } } @@ -3864,80 +3987,34 @@ func com_amazonaws_kms_DeriveSharedSecretOutput_KeyAgreementAlgorithm_FromDafny( return u.Values()[index] }() } -func com_amazonaws_kms_ReEncryptInput_DestinationEncryptionContext_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_kms_DeriveSharedSecretInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_DeriveSharedSecretInput_PublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_FromDafny(input interface{}) *types.XksProxyConfigurationType { + return func() *types.XksProxyConfigurationType { if input == nil { return nil } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } + return &types.XksProxyConfigurationType{ + Connectivity: com_amazonaws_kms_XksProxyConfigurationType_Connectivity_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_Connectivity().UnwrapOr(nil)), + AccessKeyId: com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_AccessKeyId().UnwrapOr(nil)), + UriEndpoint: com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_UriEndpoint().UnwrapOr(nil)), + UriPath: com_amazonaws_kms_XksProxyConfigurationType_UriPath_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_UriPath().UnwrapOr(nil)), + VpcEndpointServiceName: com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_VpcEndpointServiceName().UnwrapOr(nil)), } }() } -func com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input interface{}) []types.SigningAlgorithmSpec { - return func() []types.SigningAlgorithmSpec { - var fieldValue []types.SigningAlgorithmSpec +func com_amazonaws_kms_XksProxyConfigurationType_Connectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { + return func() types.XksProxyConnectivityType { + var u types.XksProxyConnectivityType if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(val)) + return u } - return fieldValue - }() -} -func com_amazonaws_kms_MacAlgorithmSpecList_member_FromDafny(input interface{}) types.MacAlgorithmSpec { - return func() types.MacAlgorithmSpec { - var u types.MacAlgorithmSpec - inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { break } } @@ -3945,7 +4022,7 @@ func com_amazonaws_kms_MacAlgorithmSpecList_member_FromDafny(input interface{}) return u.Values()[index] }() } -func com_amazonaws_kms_NotFoundException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -3961,46 +4038,13 @@ func com_amazonaws_kms_NotFoundException_message_FromDafny(input interface{}) *s } }() } -func com_amazonaws_kms_ImportKeyMaterialInput_ExpirationModel_FromDafny(input interface{}) types.ExpirationModelType { - return func() types.ExpirationModelType { - var u types.ExpirationModelType - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.ExpirationModelType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.ExpirationModelType).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_kms_ListKeyRotationsInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + if input == nil { + return nil } - }() -} -func com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4010,7 +4054,7 @@ func com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafn } }() } -func com_amazonaws_kms_ReEncryptOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyConfigurationType_UriPath_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4026,25 +4070,7 @@ func com_amazonaws_kms_ReEncryptOutput_KeyId_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_kms_VerifyInput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { - return func() types.SigningAlgorithmSpec { - var u types.SigningAlgorithmSpec - - inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_kms_DeriveSharedSecretOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4060,56 +4086,33 @@ func com_amazonaws_kms_DeriveSharedSecretOutput_KeyId_FromDafny(input interface{ } }() } -func com_amazonaws_kms_ScheduleKeyDeletionOutput_DeletionDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_DescribeCustomKeyStoresOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input interface{}) *types.MultiRegionConfiguration { - return func() *types.MultiRegionConfiguration { +func com_amazonaws_kms_DescribeCustomKeyStoresOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return nil - } - return &types.MultiRegionConfiguration{ - MultiRegionKeyType: com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_MultiRegionKeyType().UnwrapOr(nil)), - PrimaryKey: com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_PrimaryKey().UnwrapOr(nil)), - ReplicaKeys: com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_ReplicaKeys().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_AliasList_member_FromDafny(input interface{}) types.AliasListEntry { - return func() types.AliasListEntry { - - return types.AliasListEntry{ - AliasName: com_amazonaws_kms_AliasListEntry_AliasName_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_AliasName().UnwrapOr(nil)), - AliasArn: com_amazonaws_kms_AliasListEntry_AliasArn_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_AliasArn().UnwrapOr(nil)), - TargetKeyId: com_amazonaws_kms_AliasListEntry_TargetKeyId_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_TargetKeyId().UnwrapOr(nil)), - CreationDate: com_amazonaws_kms_AliasListEntry_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_CreationDate().UnwrapOr(nil)), - LastUpdatedDate: com_amazonaws_kms_AliasListEntry_LastUpdatedDate_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_LastUpdatedDate().UnwrapOr(nil)), + return b } + b = input.(bool) + return b }() } -func com_amazonaws_kms_DeleteAliasInput_AliasName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DescribeKeyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4123,7 +4126,7 @@ func com_amazonaws_kms_DeleteAliasInput_AliasName_FromDafny(input interface{}) * } }() } -func com_amazonaws_kms_GenerateDataKeyInput_GrantTokens_FromDafny(input interface{}) []string { +func com_amazonaws_kms_DescribeKeyInput_GrantTokens_FromDafny(input interface{}) []string { return func() []string { var fieldValue []string if input == nil { @@ -4139,40 +4142,45 @@ func com_amazonaws_kms_GenerateDataKeyInput_GrantTokens_FromDafny(input interfac return fieldValue }() } -func com_amazonaws_kms_GenerateMacOutput_Mac_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) - } - } - }() -} -func com_amazonaws_kms_DecryptInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { - return func() *types.RecipientInfo { +func com_amazonaws_kms_DescribeKeyOutput_KeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { + return func() *types.KeyMetadata { if input == nil { return nil } - return &types.RecipientInfo{ - KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), - AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + return &types.KeyMetadata{ + AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), + Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), + Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), + Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), + KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), + DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), + ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), + Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), + KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), + EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), + SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), + KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), + MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), + MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), + PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), + MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), + XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), } }() } -func com_amazonaws_kms_ReplicateKeyInput_Policy_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DisableKeyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4182,7 +4190,7 @@ func com_amazonaws_kms_ReplicateKeyInput_Policy_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_RotateKeyOnDemandInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DisableKeyRotationInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4196,7 +4204,7 @@ func com_amazonaws_kms_RotateKeyOnDemandInput_KeyId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DisconnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4210,13 +4218,11 @@ func com_amazonaws_kms_UpdateCustomKeyStoreInput_CustomKeyStoreId_FromDafny(inpu } }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_EnableKeyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4226,7 +4232,7 @@ func com_amazonaws_kms_CreateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(inp } }() } -func com_amazonaws_kms_UpdatePrimaryRegionInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_EnableKeyRotationInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4240,13 +4246,21 @@ func com_amazonaws_kms_UpdatePrimaryRegionInput_KeyId_FromDafny(input interface{ } }() } -func com_amazonaws_kms_InvalidCiphertextException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_EnableKeyRotationInput_RotationPeriodInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_EncryptInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -4256,17 +4270,23 @@ func com_amazonaws_kms_InvalidCiphertextException_message_FromDafny(input interf } }() } -func com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input interface{}) *types.XksKeyConfigurationType { - return func() *types.XksKeyConfigurationType { +func com_amazonaws_kms_EncryptInput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - return &types.XksKeyConfigurationType{ - Id: com_amazonaws_kms_XksKeyConfigurationType_Id_FromDafny(input.(ComAmazonawsKmsTypes.XksKeyConfigurationType).Dtor_Id().UnwrapOr(nil)), + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } } }() } -func com_amazonaws_kms_GenerateDataKeyPairInput_EncryptionContext_FromDafny(input interface{}) map[string]string { +func com_amazonaws_kms_EncryptInput_EncryptionContext_FromDafny(input interface{}) map[string]string { return func() map[string]string { var m map[string]string = make(map[string]string) if input == nil { @@ -4283,41 +4303,9 @@ func com_amazonaws_kms_GenerateDataKeyPairInput_EncryptionContext_FromDafny(inpu return m }() } -func com_amazonaws_kms_KMSInvalidSignatureException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_EncryptionContextType_key_FromDafny(input interface{}) string { - return func() string { - var s string - if input == nil { - return s - } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return []string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_GrantListEntry_CreationDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_kms_EncryptInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } @@ -4325,70 +4313,60 @@ func com_amazonaws_kms_GrantListEntry_CreationDate_FromDafny(input interface{}) val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } + return fieldValue }() } -func com_amazonaws_kms_AliasListEntry_AliasArn_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_EncryptInput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_ListKeysInput_Marker_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_EncryptInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + b = input.(bool) + return &b }() } -func com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_EncryptOutput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_ListKeyRotationsInput_Marker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_EncryptOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4404,20 +4382,20 @@ func com_amazonaws_kms_ListKeyRotationsInput_Marker_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input interface{}) types.KeyState { - return func() types.KeyState { - var u types.KeyState +func com_amazonaws_kms_EncryptOutput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.KeyState) + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.KeyState).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { break } } @@ -4425,17 +4403,7 @@ func com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input interface{}) types.K return u.Values()[index] }() } -func com_amazonaws_kms_PutKeyPolicyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { - return func() bool { - var b bool - if input == nil { - return b - } - b = input.(bool) - return b - }() -} -func com_amazonaws_kms_UntagResourceInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4449,36 +4417,47 @@ func com_amazonaws_kms_UntagResourceInput_KeyId_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_GenerateDataKeyPairOutput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_kms_VerifyInput_MessageType_FromDafny(input interface{}) types.MessageType { - return func() types.MessageType { - var u types.MessageType +func com_amazonaws_kms_GenerateDataKeyInput_NumberOfBytes_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_KeySpec_FromDafny(input interface{}) types.DataKeySpec { + return func() types.DataKeySpec { + var u types.DataKeySpec if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.MessageType) + inputEnum := input.(ComAmazonawsKmsTypes.DataKeySpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.MessageType).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.DataKeySpec).Equals(inputEnum) { break } } @@ -4486,23 +4465,44 @@ func com_amazonaws_kms_VerifyInput_MessageType_FromDafny(input interface{}) type return u.Values()[index] }() } -func com_amazonaws_kms_ReplicateKeyInput_Description_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input interface{}) []byte { +func com_amazonaws_kms_GenerateDataKeyInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_GenerateDataKeyOutput_CiphertextBlob_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -4518,21 +4518,23 @@ func com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input interfa } }() } -func com_amazonaws_kms_DeleteImportedKeyMaterialInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { +func com_amazonaws_kms_GenerateDataKeyOutput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4548,33 +4550,40 @@ func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_GenerateDataKeyPairInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_kms_GenerateDataKeyOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - b = input.(bool) - return &b + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() } -func com_amazonaws_kms_DeriveSharedSecretInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_GenerateDataKeyPairInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return fieldValue + return m }() } -func com_amazonaws_kms_Tag_TagKey_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyPairInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4588,20 +4597,17 @@ func com_amazonaws_kms_Tag_TagKey_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { - return func() types.CustomerMasterKeySpec { - var u types.CustomerMasterKeySpec - if input == nil { - return u - } +func com_amazonaws_kms_GenerateDataKeyPairInput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec - inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { break } } @@ -4609,23 +4615,92 @@ func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input interfa return u.Values()[index] }() } -func com_amazonaws_kms_RotateKeyOnDemandOutput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyPairInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyCiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyPlaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4641,49 +4716,61 @@ func com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_ListKeyRotationsOutput_Truncated_FromDafny(input interface{}) bool { - return func() bool { - var b bool +func com_amazonaws_kms_GenerateDataKeyPairOutput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec if input == nil { - return b + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + break + } + } } - b = input.(bool) - return b + return u.Values()[index] }() } -func com_amazonaws_kms_GrantListEntry_GranteePrincipal_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyPairOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_kms_GenerateDataKeyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4697,9 +4784,27 @@ func com_amazonaws_kms_GenerateDataKeyInput_KeyId_FromDafny(input interface{}) * } }() } -func com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input interface{}) []types.EncryptionAlgorithmSpec { - return func() []types.EncryptionAlgorithmSpec { - var fieldValue []types.EncryptionAlgorithmSpec +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } @@ -4708,68 +4813,54 @@ func com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input interfac if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_kms_ListResourceTagsInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - i = input.(int32) - return &i + b = input.(bool) + return &b }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PrivateKeyCiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_GenerateDataKeyPairInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_LimitExceededException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_VerifyOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4785,54 +4876,20 @@ func com_amazonaws_kms_VerifyOutput_KeyId_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_DescribeKeyOutput_KeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { - return func() *types.KeyMetadata { - if input == nil { - return nil - } - return &types.KeyMetadata{ - AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), - KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), - Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), - CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), - Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), - Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), - KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), - KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), - DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), - ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), - Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), - CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), - CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), - ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), - KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), - CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), - KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), - EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), - SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), - KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), - MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), - MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), - PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), - MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), - XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_RotationsListEntry_RotationType_FromDafny(input interface{}) types.RotationType { - return func() types.RotationType { - var u types.RotationType +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.RotationType) + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_RotationType_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.RotationType).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { break } } @@ -4840,23 +4897,7 @@ func com_amazonaws_kms_RotationsListEntry_RotationType_FromDafny(input interface return u.Values()[index] }() } -func com_amazonaws_kms_DisabledException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_ListResourceTagsInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -4870,39 +4911,45 @@ func com_amazonaws_kms_ListResourceTagsInput_KeyId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_DecryptOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return b - } else { - b = append(b, val.(byte)) + break } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_kms_GetPublicKeyOutput_PublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeySpec_FromDafny(input interface{}) types.DataKeySpec { + return func() types.DataKeySpec { + var u types.DataKeySpec if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeySpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_ScheduleKeyDeletionOutput_PendingWindowInDays_FromDafny(input interface{}) *int32 { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_NumberOfBytes_FromDafny(input interface{}) *int32 { return func() *int32 { var i int32 if input == nil { @@ -4912,22 +4959,6 @@ func com_amazonaws_kms_ScheduleKeyDeletionOutput_PendingWindowInDays_FromDafny(i return &i }() } -func com_amazonaws_kms_GetKeyRotationStatusOutput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_GrantTokens_FromDafny(input interface{}) []string { return func() []string { var fieldValue []string @@ -4944,33 +4975,33 @@ func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_GrantTokens_FromDafn return fieldValue }() } -func com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } + b = input.(bool) + return &b }() } -func com_amazonaws_kms_VerifyOutput_SignatureValid_FromDafny(input interface{}) bool { - return func() bool { - var b bool +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { - return b + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } } - b = input.(bool) - return b }() } -func com_amazonaws_kms_GrantListEntry_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -4986,17 +5017,23 @@ func com_amazonaws_kms_GrantListEntry_KeyId_FromDafny(input interface{}) *string } }() } -func com_amazonaws_kms_GetKeyRotationStatusOutput_KeyRotationEnabled_FromDafny(input interface{}) bool { - return func() bool { - var b bool +func com_amazonaws_kms_GenerateMacInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { - return b + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } } - b = input.(bool) - return b }() } -func com_amazonaws_kms_ReplicateKeyInput_ReplicaRegion_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateMacInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -5010,77 +5047,94 @@ func com_amazonaws_kms_ReplicateKeyInput_ReplicaRegion_FromDafny(input interface } }() } -func com_amazonaws_kms_UntagResourceInput_TagKeys_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_GenerateMacInput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } } - fieldValue = append(fieldValue, com_amazonaws_kms_TagKeyList_member_FromDafny(val)) } - return fieldValue + return u.Values()[index] }() } -func com_amazonaws_kms_CloudHsmClusterInUseException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateMacInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_ListGrantsOutput_Truncated_FromDafny(input interface{}) bool { - return func() bool { +func com_amazonaws_kms_GenerateMacInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { var b bool if input == nil { - return b + return nil } b = input.(bool) - return b + return &b }() } -func com_amazonaws_kms_ListAliasesInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateMacOutput_Mac_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_DescribeCustomKeyStoresInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_kms_GenerateMacOutput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec if input == nil { - return nil + return u } - i = input.(int32) - return &i + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] }() } -func com_amazonaws_kms_UpdateKeyDescriptionInput_Description_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateMacOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5090,7 +5144,7 @@ func com_amazonaws_kms_UpdateKeyDescriptionInput_Description_FromDafny(input int } }() } -func com_amazonaws_kms_ListAliasesInput_Limit_FromDafny(input interface{}) *int32 { +func com_amazonaws_kms_GenerateRandomInput_NumberOfBytes_FromDafny(input interface{}) *int32 { return func() *int32 { var i int32 if input == nil { @@ -5100,7 +5154,7 @@ func com_amazonaws_kms_ListAliasesInput_Limit_FromDafny(input interface{}) *int3 return &i }() } -func com_amazonaws_kms_XksProxyUriUnreachableException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GenerateRandomInput_CustomKeyStoreId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5116,39 +5170,50 @@ func com_amazonaws_kms_XksProxyUriUnreachableException_message_FromDafny(input i } }() } -func com_amazonaws_kms_CreateKeyInput_CustomKeyStoreId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateRandomInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GenerateRandomOutput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_TagException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GenerateRandomOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_ImportKeyMaterialInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GetKeyPolicyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -5162,60 +5227,7 @@ func com_amazonaws_kms_ImportKeyMaterialInput_KeyId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_DeriveSharedSecretOutput_KeyOrigin_FromDafny(input interface{}) types.OriginType { - return func() types.OriginType { - var u types.OriginType - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.OriginType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_kms_EncryptInput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(input interface{}) *types.XksProxyAuthenticationCredentialType { - return func() *types.XksProxyAuthenticationCredentialType { - if input == nil { - return nil - } - return &types.XksProxyAuthenticationCredentialType{ - AccessKeyId: com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_AccessKeyId()), - RawSecretAccessKey: com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_RawSecretAccessKey()), - } - }() -} -func com_amazonaws_kms_KMSInvalidMacException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GetKeyPolicyInput_PolicyName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5231,69 +5243,69 @@ func com_amazonaws_kms_KMSInvalidMacException_message_FromDafny(input interface{ } }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(input interface{}) *types.XksProxyAuthenticationCredentialType { - return func() *types.XksProxyAuthenticationCredentialType { +func com_amazonaws_kms_GetKeyPolicyOutput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.XksProxyAuthenticationCredentialType{ - AccessKeyId: com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_AccessKeyId()), - RawSecretAccessKey: com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_RawSecretAccessKey()), + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } }() } -func com_amazonaws_kms_EncryptOutput_CiphertextBlob_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GetKeyPolicyOutput_PolicyName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_GetPublicKeyOutput_KeySpec_FromDafny(input interface{}) types.KeySpec { - return func() types.KeySpec { - var u types.KeySpec - if input == nil { - return u - } +func com_amazonaws_kms_GetKeyRotationStatusInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_DecryptInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { +func com_amazonaws_kms_GetKeyRotationStatusOutput_KeyRotationEnabled_FromDafny(input interface{}) bool { + return func() bool { var b bool if input == nil { - return nil + return b } b = input.(bool) - return &b + return b }() } -func com_amazonaws_kms_DisableKeyRotationInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GetKeyRotationStatusOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5303,56 +5315,67 @@ func com_amazonaws_kms_DisableKeyRotationInput_KeyId_FromDafny(input interface{} } }() } -func com_amazonaws_kms_GenerateDataKeyInput_EncryptionContext_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_kms_GetKeyRotationStatusOutput_RotationPeriodInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m + i = input.(int32) + return &i }() } -func com_amazonaws_kms_GenerateRandomOutput_Plaintext_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GetKeyRotationStatusOutput_NextRotationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + break } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } + return &t } }() } -func com_amazonaws_kms_GetParametersForImportOutput_ImportToken_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GetKeyRotationStatusOutput_OnDemandRotationStartDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + break } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } + return &t } }() } -func com_amazonaws_kms_GetKeyRotationStatusInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GetParametersForImportInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -5366,30 +5389,35 @@ func com_amazonaws_kms_GetKeyRotationStatusInput_KeyId_FromDafny(input interface } }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_NumberOfBytes_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil +func com_amazonaws_kms_GetParametersForImportInput_WrappingAlgorithm_FromDafny(input interface{}) types.AlgorithmSpec { + return func() types.AlgorithmSpec { + var u types.AlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.AlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_AlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.AlgorithmSpec).Equals(inputEnum) { + break + } + } } - i = input.(int32) - return &i + return u.Values()[index] }() } -func com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyState_FromDafny(input interface{}) types.KeyState { - return func() types.KeyState { - var u types.KeyState - if input == nil { - return u - } +func com_amazonaws_kms_GetParametersForImportInput_WrappingKeySpec_FromDafny(input interface{}) types.WrappingKeySpec { + return func() types.WrappingKeySpec { + var u types.WrappingKeySpec - inputEnum := input.(ComAmazonawsKmsTypes.KeyState) + inputEnum := input.(ComAmazonawsKmsTypes.WrappingKeySpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_WrappingKeySpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.KeyState).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.WrappingKeySpec).Equals(inputEnum) { break } } @@ -5397,7 +5425,7 @@ func com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyState_FromDafny(input interf return u.Values()[index] }() } -func com_amazonaws_kms_ListKeyPoliciesOutput_NextMarker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GetParametersForImportOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5413,7 +5441,7 @@ func com_amazonaws_kms_ListKeyPoliciesOutput_NextMarker_FromDafny(input interfac } }() } -func com_amazonaws_kms_GenerateDataKeyOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { +func com_amazonaws_kms_GetParametersForImportOutput_ImportToken_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -5429,13 +5457,13 @@ func com_amazonaws_kms_GenerateDataKeyOutput_CiphertextForRecipient_FromDafny(in } }() } -func com_amazonaws_kms_DecryptInput_CiphertextBlob_FromDafny(input interface{}) []byte { +func com_amazonaws_kms_GetParametersForImportOutput_PublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return b @@ -5445,9 +5473,9 @@ func com_amazonaws_kms_DecryptInput_CiphertextBlob_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_GenerateDataKeyPairInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_GetParametersForImportOutput_ParametersValidTo_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -5455,19 +5483,26 @@ func com_amazonaws_kms_GenerateDataKeyPairInput_GrantTokens_FromDafny(input inte val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } - return fieldValue + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_kms_KeyUnavailableException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GetPublicKeyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5477,11 +5512,29 @@ func com_amazonaws_kms_KeyUnavailableException_message_FromDafny(input interface } }() } -func com_amazonaws_kms_CreateGrantInput_GranteePrincipal_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GetPublicKeyInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -5491,7 +5544,7 @@ func com_amazonaws_kms_CreateGrantInput_GranteePrincipal_FromDafny(input interfa } }() } -func com_amazonaws_kms_ReEncryptOutput_CiphertextBlob_FromDafny(input interface{}) []byte { +func com_amazonaws_kms_GetPublicKeyOutput_PublicKey_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -5507,35 +5560,104 @@ func com_amazonaws_kms_ReEncryptOutput_CiphertextBlob_FromDafny(input interface{ } }() } -func com_amazonaws_kms_ReplicateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { - return func() bool { - var b bool +func com_amazonaws_kms_GetPublicKeyOutput_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { + return func() types.CustomerMasterKeySpec { + var u types.CustomerMasterKeySpec if input == nil { - return b + return u } - b = input.(bool) - return b + + inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_KeySpec_FromDafny(input interface{}) types.KeySpec { + return func() types.KeySpec { + var u types.KeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { + return func() types.KeyUsageType { + var u types.KeyUsageType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_EncryptionAlgorithms_FromDafny(input interface{}) []types.EncryptionAlgorithmSpec { + return func() []types.EncryptionAlgorithmSpec { + var fieldValue []types.EncryptionAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue }() } -func com_amazonaws_kms_MalformedPolicyDocumentException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_GetPublicKeyOutput_SigningAlgorithms_FromDafny(input interface{}) []types.SigningAlgorithmSpec { + return func() []types.SigningAlgorithmSpec { + var fieldValue []types.SigningAlgorithmSpec if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_GetParametersForImportOutput_ParametersValidTo_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string +func com_amazonaws_kms_GetPublicKeyOutput_KeyAgreementAlgorithms_FromDafny(input interface{}) []types.KeyAgreementAlgorithmSpec { + return func() []types.KeyAgreementAlgorithmSpec { + var fieldValue []types.KeyAgreementAlgorithmSpec if input == nil { return nil } @@ -5543,22 +5665,13 @@ func com_amazonaws_kms_GetParametersForImportOutput_ParametersValidTo_FromDafny( val, ok := i() if !ok { break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) } - return &t + fieldValue = append(fieldValue, com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_UpdateKeyDescriptionInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ImportKeyMaterialInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -5572,85 +5685,77 @@ func com_amazonaws_kms_UpdateKeyDescriptionInput_KeyId_FromDafny(input interface } }() } -func com_amazonaws_kms_ScheduleKeyDeletionInput_PendingWindowInDays_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_kms_GetKeyRotationStatusOutput_RotationPeriodInDays_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_kms_XksKeyConfigurationType_Id_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_ImportKeyMaterialInput_ImportToken_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_ListKeyRotationsOutput_NextMarker_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_ImportKeyMaterialInput_EncryptedKeyMaterial_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_DependencyTimeoutException_message_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_ImportKeyMaterialInput_ValidTo_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_kms_GrantOperationList_member_FromDafny(input interface{}) types.GrantOperation { - return func() types.GrantOperation { - var u types.GrantOperation +func com_amazonaws_kms_ImportKeyMaterialInput_ExpirationModel_FromDafny(input interface{}) types.ExpirationModelType { + return func() types.ExpirationModelType { + var u types.ExpirationModelType + if input == nil { + return u + } - inputEnum := input.(ComAmazonawsKmsTypes.GrantOperation) + inputEnum := input.(ComAmazonawsKmsTypes.ExpirationModelType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_GrantOperation_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.GrantOperation).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.ExpirationModelType).Equals(inputEnum) { break } } @@ -5658,7 +5763,7 @@ func com_amazonaws_kms_GrantOperationList_member_FromDafny(input interface{}) ty return u.Values()[index] }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListAliasesInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5674,17 +5779,17 @@ func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input } }() } -func com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input interface{}) bool { - return func() bool { - var b bool +func com_amazonaws_kms_ListAliasesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { - return b + return nil } - b = input.(bool) - return b + i = input.(int32) + return &i }() } -func com_amazonaws_kms_KMSInternalException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListAliasesInput_Marker_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5700,9 +5805,9 @@ func com_amazonaws_kms_KMSInternalException_message_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_ReplicateKeyInput_Tags_FromDafny(input interface{}) []types.Tag { - return func() []types.Tag { - var fieldValue []types.Tag +func com_amazonaws_kms_ListAliasesOutput_Aliases_FromDafny(input interface{}) []types.AliasListEntry { + return func() []types.AliasListEntry { + var fieldValue []types.AliasListEntry if input == nil { return nil } @@ -5711,75 +5816,56 @@ func com_amazonaws_kms_ReplicateKeyInput_Tags_FromDafny(input interface{}) []typ if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_kms_AliasList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_kms_VerifyInput_Signature_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_AliasList_member_FromDafny(input interface{}) types.AliasListEntry { + return func() types.AliasListEntry { + + return types.AliasListEntry{ + AliasName: com_amazonaws_kms_AliasListEntry_AliasName_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_AliasName().UnwrapOr(nil)), + AliasArn: com_amazonaws_kms_AliasListEntry_AliasArn_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_AliasArn().UnwrapOr(nil)), + TargetKeyId: com_amazonaws_kms_AliasListEntry_TargetKeyId_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_TargetKeyId().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_AliasListEntry_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_CreationDate().UnwrapOr(nil)), + LastUpdatedDate: com_amazonaws_kms_AliasListEntry_LastUpdatedDate_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_LastUpdatedDate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_AliasListEntry_AliasName_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) - } - } - }() -} -func com_amazonaws_kms_ListResourceTagsOutput_Truncated_FromDafny(input interface{}) bool { - return func() bool { - var b bool - if input == nil { - return b - } - b = input.(bool) - return b - }() -} -func com_amazonaws_kms_ReEncryptInput_DestinationEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_ReplicateKeyOutput_ReplicaTags_FromDafny(input interface{}) []types.Tag { - return func() []types.Tag { - var fieldValue []types.Tag +func com_amazonaws_kms_AliasListEntry_AliasArn_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_CreateGrantOutput_GrantToken_FromDafny(input interface{}) *string { +func com_amazonaws_kms_AliasListEntry_TargetKeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5795,9 +5881,9 @@ func com_amazonaws_kms_CreateGrantOutput_GrantToken_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_ListKeyPoliciesOutput_PolicyNames_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_AliasListEntry_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } @@ -5805,50 +5891,47 @@ func com_amazonaws_kms_ListKeyPoliciesOutput_PolicyNames_FromDafny(input interfa val, ok := i() if !ok { break + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_PolicyNameList_member_FromDafny(val)) } - return fieldValue + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_kms_IncorrectKeyException_message_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_AliasListEntry_LastUpdatedDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } - }() -} -func com_amazonaws_kms_XksProxyConfigurationType_Connectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { - return func() types.XksProxyConnectivityType { - var u types.XksProxyConnectivityType - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { - break - } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } + return &t } - return u.Values()[index] }() } -func com_amazonaws_kms_CreateKeyInput_Policy_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListAliasesOutput_NextMarker_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5864,7 +5947,27 @@ func com_amazonaws_kms_CreateKeyInput_Policy_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_kms_IncorrectKeyMaterialException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListAliasesOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListGrantsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListGrantsInput_Marker_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5880,17 +5983,7 @@ func com_amazonaws_kms_IncorrectKeyMaterialException_message_FromDafny(input int } }() } -func com_amazonaws_kms_DescribeCustomKeyStoresOutput_Truncated_FromDafny(input interface{}) bool { - return func() bool { - var b bool - if input == nil { - return b - } - b = input.(bool) - return b - }() -} -func com_amazonaws_kms_UpdateAliasInput_AliasName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListGrantsInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -5904,7 +5997,7 @@ func com_amazonaws_kms_UpdateAliasInput_AliasName_FromDafny(input interface{}) * } }() } -func com_amazonaws_kms_GrantListEntry_IssuingAccount_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListGrantsInput_GrantId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5920,28 +6013,7 @@ func com_amazonaws_kms_GrantListEntry_IssuingAccount_FromDafny(input interface{} } }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { - return func() types.XksProxyConnectivityType { - var u types.XksProxyConnectivityType - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_kms_CustomKeyStoreNameInUseException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListGrantsInput_GranteePrincipal_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -5957,6 +6029,22 @@ func com_amazonaws_kms_CustomKeyStoreNameInUseException_message_FromDafny(input } }() } +func com_amazonaws_kms_ListGrantsOutput_Grants_FromDafny(input interface{}) []types.GrantListEntry { + return func() []types.GrantListEntry { + var fieldValue []types.GrantListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantList_member_FromDafny(val)) + } + return fieldValue + }() +} func com_amazonaws_kms_GrantList_member_FromDafny(input interface{}) types.GrantListEntry { return func() types.GrantListEntry { @@ -5973,23 +6061,23 @@ func com_amazonaws_kms_GrantList_member_FromDafny(input interface{}) types.Grant } }() } -func com_amazonaws_kms_VerifyMacInput_Mac_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GrantListEntry_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_KeyListEntry_KeyArn_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GrantListEntry_GrantId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6005,7 +6093,7 @@ func com_amazonaws_kms_KeyListEntry_KeyArn_FromDafny(input interface{}) *string } }() } -func com_amazonaws_kms_DescribeCustomKeyStoresOutput_NextMarker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GrantListEntry_Name_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6021,50 +6109,64 @@ func com_amazonaws_kms_DescribeCustomKeyStoresOutput_NextMarker_FromDafny(input } }() } -func com_amazonaws_kms_CreateKeyInput_XksKeyId_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_GrantListEntry_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + break } else { s = s + string(val.(dafny.Char)) } } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } }() } -func com_amazonaws_kms_ListKeysOutput_Truncated_FromDafny(input interface{}) bool { - return func() bool { - var b bool +func com_amazonaws_kms_GrantListEntry_GranteePrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return b + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } } - b = input.(bool) - return b }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_EncryptionContext_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_kms_GrantListEntry_RetiringPrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_kms_ListResourceTagsOutput_NextMarker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_GrantListEntry_IssuingAccount_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6080,44 +6182,60 @@ func com_amazonaws_kms_ListResourceTagsOutput_NextMarker_FromDafny(input interfa } }() } -func com_amazonaws_kms_EncryptInput_Plaintext_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_GrantListEntry_Operations_FromDafny(input interface{}) []types.GrantOperation { + return func() []types.GrantOperation { + var fieldValue []types.GrantOperation if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return b - } else { - b = append(b, val.(byte)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantOperationList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_FromDafny(input interface{}) types.CustomKeyStoreType { - return func() types.CustomKeyStoreType { - var u types.CustomKeyStoreType +func com_amazonaws_kms_GrantListEntry_Constraints_FromDafny(input interface{}) *types.GrantConstraints { + return func() *types.GrantConstraints { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.CustomKeyStoreType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.CustomKeyStoreType).Equals(inputEnum) { - break - } + return &types.GrantConstraints{ + EncryptionContextSubset: com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextSubset().UnwrapOr(nil)), + EncryptionContextEquals: com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextEquals().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_ListGrantsOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_CancelKeyDeletionInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListGrantsOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListKeyPoliciesInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -6131,57 +6249,69 @@ func com_amazonaws_kms_CancelKeyDeletionInput_KeyId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_DecryptInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_ListKeyPoliciesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListKeyPoliciesInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_CustomKeyStoresList_member_FromDafny(input interface{}) types.CustomKeyStoresListEntry { - return func() types.CustomKeyStoresListEntry { - - return types.CustomKeyStoresListEntry{ - CustomKeyStoreId: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreId().UnwrapOr(nil)), - CustomKeyStoreName: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreName().UnwrapOr(nil)), - CloudHsmClusterId: com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CloudHsmClusterId().UnwrapOr(nil)), - TrustAnchorCertificate: com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_TrustAnchorCertificate().UnwrapOr(nil)), - ConnectionState: com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_ConnectionState().UnwrapOr(nil)), - ConnectionErrorCode: com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_ConnectionErrorCode().UnwrapOr(nil)), - CreationDate: com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CreationDate().UnwrapOr(nil)), - CustomKeyStoreType: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreType().UnwrapOr(nil)), - XksProxyConfiguration: com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_XksProxyConfiguration().UnwrapOr(nil)), +func com_amazonaws_kms_ListKeyPoliciesOutput_PolicyNames_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_PolicyNameList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_DisconnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_PolicyNameList_member_FromDafny(input interface{}) string { + return func() string { var s string - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_ReEncryptInput_DestinationKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListKeyPoliciesOutput_NextMarker_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6191,76 +6321,89 @@ func com_amazonaws_kms_ReEncryptInput_DestinationKeyId_FromDafny(input interface } }() } -func com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input interface{}) types.ExpirationModelType { - return func() types.ExpirationModelType { - var u types.ExpirationModelType +func com_amazonaws_kms_ListKeyPoliciesOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return u + return b } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListKeyRotationsInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.ExpirationModelType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.ExpirationModelType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_kms_ListKeyRotationsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - b = input.(bool) - return &b + i = input.(int32) + return &i }() } -func com_amazonaws_kms_DeriveSharedSecretOutput_SharedSecret_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_ListKeyRotationsInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_GetParametersForImportInput_WrappingAlgorithm_FromDafny(input interface{}) types.AlgorithmSpec { - return func() types.AlgorithmSpec { - var u types.AlgorithmSpec - - inputEnum := input.(ComAmazonawsKmsTypes.AlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_AlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.AlgorithmSpec).Equals(inputEnum) { - break - } +func com_amazonaws_kms_ListKeyRotationsOutput_Rotations_FromDafny(input interface{}) []types.RotationsListEntry { + return func() []types.RotationsListEntry { + var fieldValue []types.RotationsListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_kms_RotationsList_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_kms_ReplicateKeyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_RotationsList_member_FromDafny(input interface{}) types.RotationsListEntry { + return func() types.RotationsListEntry { + + return types.RotationsListEntry{ + KeyId: com_amazonaws_kms_RotationsListEntry_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_KeyId().UnwrapOr(nil)), + RotationDate: com_amazonaws_kms_RotationsListEntry_RotationDate_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_RotationDate().UnwrapOr(nil)), + RotationType: com_amazonaws_kms_RotationsListEntry_RotationType_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_RotationType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_RotationsListEntry_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6270,23 +6413,53 @@ func com_amazonaws_kms_ReplicateKeyInput_KeyId_FromDafny(input interface{}) *str } }() } -func com_amazonaws_kms_ImportKeyMaterialInput_ImportToken_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_RotationsListEntry_RotationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + break } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) } + return &t } }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_RotationsListEntry_RotationType_FromDafny(input interface{}) types.RotationType { + return func() types.RotationType { + var u types.RotationType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.RotationType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_RotationType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.RotationType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ListKeyRotationsOutput_NextMarker_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6302,28 +6475,27 @@ func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_FromDafny(input } }() } -func com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_FromDafny(input interface{}) *types.MultiRegionKey { - return func() *types.MultiRegionKey { +func com_amazonaws_kms_ListKeyRotationsOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return nil - } - return &types.MultiRegionKey{ - Arn: com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Arn().UnwrapOr(nil)), - Region: com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Region().UnwrapOr(nil)), + return b } + b = input.(bool) + return b }() } -func com_amazonaws_kms_GenerateDataKeyInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool +func com_amazonaws_kms_ListKeysInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - b = input.(bool) - return &b + i = input.(int32) + return &i }() } -func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListKeysInput_Marker_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6339,35 +6511,32 @@ func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_FromDafn } }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { - return func() types.DataKeyPairSpec { - var u types.DataKeyPairSpec - - inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { - break - } +func com_amazonaws_kms_ListKeysOutput_Keys_FromDafny(input interface{}) []types.KeyListEntry { + return func() []types.KeyListEntry { + var fieldValue []types.KeyListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_kms_KeyList_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_kms_GenerateDataKeyInput_NumberOfBytes_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil +func com_amazonaws_kms_KeyList_member_FromDafny(input interface{}) types.KeyListEntry { + return func() types.KeyListEntry { + + return types.KeyListEntry{ + KeyId: com_amazonaws_kms_KeyListEntry_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyListEntry).Dtor_KeyId().UnwrapOr(nil)), + KeyArn: com_amazonaws_kms_KeyListEntry_KeyArn_FromDafny(input.(ComAmazonawsKmsTypes.KeyListEntry).Dtor_KeyArn().UnwrapOr(nil)), } - i = input.(int32) - return &i }() } -func com_amazonaws_kms_ExpiredImportTokenException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_KeyListEntry_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6383,7 +6552,7 @@ func com_amazonaws_kms_ExpiredImportTokenException_message_FromDafny(input inter } }() } -func com_amazonaws_kms_ListAliasesOutput_NextMarker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_KeyListEntry_KeyArn_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6399,38 +6568,37 @@ func com_amazonaws_kms_ListAliasesOutput_NextMarker_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_ListKeysOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t + }() +} +func com_amazonaws_kms_ListKeysOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b } + b = input.(bool) + return b }() } -func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListResourceTagsInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6440,7 +6608,17 @@ func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_FromDafny(inpu } }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ListResourceTagsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListResourceTagsInput_Marker_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6456,59 +6634,39 @@ func com_amazonaws_kms_UpdateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(inp } }() } -func com_amazonaws_kms_CreateKeyInput_Origin_FromDafny(input interface{}) types.OriginType { - return func() types.OriginType { - var u types.OriginType +func com_amazonaws_kms_ListResourceTagsOutput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.OriginType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_kms_ListKeysInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_kms_ListResourceTagsOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - i = input.(int32) - return &i - }() -} -func com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input interface{}) types.KeySpec { - return func() types.KeySpec { - var u types.KeySpec - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_ListKeyPoliciesOutput_Truncated_FromDafny(input interface{}) bool { +func com_amazonaws_kms_ListResourceTagsOutput_Truncated_FromDafny(input interface{}) bool { return func() bool { var b bool if input == nil { @@ -6518,7 +6676,21 @@ func com_amazonaws_kms_ListKeyPoliciesOutput_Truncated_FromDafny(input interface return b }() } -func com_amazonaws_kms_GetParametersForImportOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_PutKeyPolicyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_PutKeyPolicyInput_PolicyName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6534,59 +6706,47 @@ func com_amazonaws_kms_GetParametersForImportOutput_KeyId_FromDafny(input interf } }() } -func com_amazonaws_kms_GetPublicKeyOutput_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { - return func() types.CustomerMasterKeySpec { - var u types.CustomerMasterKeySpec - if input == nil { - return u - } +func com_amazonaws_kms_PutKeyPolicyInput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_ListKeyRotationsInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 +func com_amazonaws_kms_PutKeyPolicyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return nil + return b } - i = input.(int32) - return &i + b = input.(bool) + return b }() } -func com_amazonaws_kms_SignInput_MessageType_FromDafny(input interface{}) types.MessageType { - return func() types.MessageType { - var u types.MessageType +func com_amazonaws_kms_ReEncryptInput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.MessageType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.MessageType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input interface{}) map[string]string { +func com_amazonaws_kms_ReEncryptInput_SourceEncryptionContext_FromDafny(input interface{}) map[string]string { return func() map[string]string { var m map[string]string = make(map[string]string) if input == nil { @@ -6603,114 +6763,88 @@ func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input return m }() } -func com_amazonaws_kms_GenerateDataKeyOutput_Plaintext_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_ReEncryptInput_SourceKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) - } - } - }() -} -func com_amazonaws_kms_VerifyOutput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { - return func() types.SigningAlgorithmSpec { - var u types.SigningAlgorithmSpec - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { - break - } + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_AliasListEntry_CreationDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_ReEncryptInput_DestinationKeyId_FromDafny(input interface{}) *string { + return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_kms_GrantListEntry_GrantId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_ReEncryptInput_DestinationEncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } + return m }() } -func com_amazonaws_kms_XksKeyAlreadyInUseException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_ReEncryptInput_SourceEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_GenerateDataKeyPairOutput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { - return func() types.DataKeyPairSpec { - var u types.DataKeyPairSpec +func com_amazonaws_kms_ReEncryptInput_DestinationEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { break } } @@ -6718,29 +6852,39 @@ func com_amazonaws_kms_GenerateDataKeyPairOutput_KeyPairSpec_FromDafny(input int return u.Values()[index] }() } -func com_amazonaws_kms_KMSInvalidStateException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_ReEncryptInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_ImportKeyMaterialInput_EncryptedKeyMaterial_FromDafny(input interface{}) []byte { +func com_amazonaws_kms_ReEncryptInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_ReEncryptOutput_CiphertextBlob_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return b @@ -6750,28 +6894,23 @@ func com_amazonaws_kms_ImportKeyMaterialInput_EncryptedKeyMaterial_FromDafny(inp } }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { - return func() types.XksProxyConnectivityType { - var u types.XksProxyConnectivityType +func com_amazonaws_kms_ReEncryptOutput_SourceKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_GetPublicKeyOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ReEncryptOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6787,45 +6926,53 @@ func com_amazonaws_kms_GetPublicKeyOutput_KeyId_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_GenerateMacInput_Message_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_ReEncryptOutput_SourceEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec if input == nil { - return nil + return u } - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_GenerateRandomOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_ReEncryptOutput_DestinationEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_InvalidKeyUsageException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ReplicateKeyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6835,47 +6982,11 @@ func com_amazonaws_kms_InvalidKeyUsageException_message_FromDafny(input interfac } }() } -func com_amazonaws_kms_ReplicateKeyOutput_ReplicaKeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { - return func() *types.KeyMetadata { - if input == nil { - return nil - } - return &types.KeyMetadata{ - AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), - KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), - Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), - CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), - Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), - Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), - KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), - KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), - DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), - ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), - Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), - CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), - CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), - ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), - KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), - CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), - KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), - EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), - SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), - KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), - MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), - MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), - PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), - MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), - XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_DecryptInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ReplicateKeyInput_ReplicaRegion_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -6885,7 +6996,7 @@ func com_amazonaws_kms_DecryptInput_KeyId_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_ListGrantsInput_GranteePrincipal_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ReplicateKeyInput_Policy_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6901,27 +7012,17 @@ func com_amazonaws_kms_ListGrantsInput_GranteePrincipal_FromDafny(input interfac } }() } -func com_amazonaws_kms_ListGrantsInput_Limit_FromDafny(input interface{}) *int32 { - return func() *int32 { - var i int32 - if input == nil { - return nil - } - i = input.(int32) - return &i - }() -} -func com_amazonaws_kms_CreateGrantInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { +func com_amazonaws_kms_ReplicateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { + return func() bool { var b bool if input == nil { - return nil + return b } b = input.(bool) - return &b + return b }() } -func com_amazonaws_kms_CreateKeyInput_Description_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ReplicateKeyInput_Description_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -6937,62 +7038,57 @@ func com_amazonaws_kms_CreateKeyInput_Description_FromDafny(input interface{}) * } }() } -func com_amazonaws_kms_XksProxyInvalidConfigurationException_message_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_ReplicateKeyInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_VerifyMacInput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { - return func() types.MacAlgorithmSpec { - var u types.MacAlgorithmSpec - - inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { - break - } + break } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } - return u.Values()[index] + return fieldValue }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_FromDafny(input interface{}) types.ConnectionErrorCodeType { - return func() types.ConnectionErrorCodeType { - var u types.ConnectionErrorCodeType +func com_amazonaws_kms_ReplicateKeyOutput_ReplicaKeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { + return func() *types.KeyMetadata { if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.ConnectionErrorCodeType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionErrorCodeType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.ConnectionErrorCodeType).Equals(inputEnum) { - break - } - } + return &types.KeyMetadata{ + AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), + Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), + Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), + Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), + KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), + DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), + ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), + Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), + KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), + EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), + SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), + KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), + MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), + MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), + PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), + MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), + XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), } - return u.Values()[index] }() } -func com_amazonaws_kms_XksProxyConfigurationType_UriPath_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ReplicateKeyOutput_ReplicaPolicy_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7008,9 +7104,9 @@ func com_amazonaws_kms_XksProxyConfigurationType_UriPath_FromDafny(input interfa } }() } -func com_amazonaws_kms_GetPublicKeyInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_ReplicateKeyOutput_ReplicaTags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag if input == nil { return nil } @@ -7019,12 +7115,12 @@ func com_amazonaws_kms_GetPublicKeyInput_GrantTokens_FromDafny(input interface{} if !ok { break } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } return fieldValue }() } -func com_amazonaws_kms_PutKeyPolicyInput_PolicyName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_RetireGrantInput_GrantToken_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7040,7 +7136,7 @@ func com_amazonaws_kms_PutKeyPolicyInput_PolicyName_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_RetireGrantInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7056,7 +7152,7 @@ func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_FromDafny(inp } }() } -func com_amazonaws_kms_InvalidAliasNameException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_RetireGrantInput_GrantId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7072,56 +7168,69 @@ func com_amazonaws_kms_InvalidAliasNameException_message_FromDafny(input interfa } }() } -func com_amazonaws_kms_ListAliasesOutput_Truncated_FromDafny(input interface{}) bool { - return func() bool { +func com_amazonaws_kms_RetireGrantInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { var b bool if input == nil { - return b + return nil } b = input.(bool) - return b + return &b }() } -func com_amazonaws_kms_DeriveSharedSecretInput_KeyAgreementAlgorithm_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { - return func() types.KeyAgreementAlgorithmSpec { - var u types.KeyAgreementAlgorithmSpec +func com_amazonaws_kms_RevokeGrantInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_CreateKeyInput_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { - return func() types.KeyUsageType { - var u types.KeyUsageType +func com_amazonaws_kms_RevokeGrantInput_GrantId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RevokeGrantInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { - return u + return nil } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_RotateKeyOnDemandInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_RotateKeyOnDemandOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7137,32 +7246,37 @@ func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_FromDafny(input } }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_FromDafny(input interface{}) types.ConnectionStateType { - return func() types.ConnectionStateType { - var u types.ConnectionStateType - if input == nil { - return u - } +func com_amazonaws_kms_ScheduleKeyDeletionInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string - inputEnum := input.(ComAmazonawsKmsTypes.ConnectionStateType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionStateType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.ConnectionStateType).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ScheduleKeyDeletionInput_PendingWindowInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7172,7 +7286,7 @@ func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreName_FromDafny(in } }() } -func com_amazonaws_kms_ImportKeyMaterialInput_ValidTo_FromDafny(input interface{}) *time.Time { +func com_amazonaws_kms_ScheduleKeyDeletionOutput_DeletionDate_FromDafny(input interface{}) *time.Time { return func() *time.Time { var s string if input == nil { @@ -7197,13 +7311,42 @@ func com_amazonaws_kms_ImportKeyMaterialInput_ValidTo_FromDafny(input interface{ } }() } -func com_amazonaws_kms_VerifyMacOutput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyState_FromDafny(input interface{}) types.KeyState { + return func() types.KeyState { + var u types.KeyState + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyState) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyState).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionOutput_PendingWindowInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_SignInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7213,7 +7356,88 @@ func com_amazonaws_kms_VerifyMacOutput_KeyId_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_kms_InvalidGrantIdException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_SignInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_SignInput_MessageType_FromDafny(input interface{}) types.MessageType { + return func() types.MessageType { + var u types.MessageType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.MessageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MessageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_SignInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_SignInput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_SignInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_SignOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7229,7 +7453,7 @@ func com_amazonaws_kms_InvalidGrantIdException_message_FromDafny(input interface } }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PublicKey_FromDafny(input interface{}) []byte { +func com_amazonaws_kms_SignOutput_Signature_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -7245,29 +7469,32 @@ func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PublicKey_FromD } }() } -func com_amazonaws_kms_GenerateDataKeyPairOutput_PublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_SignOutput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return b - } else { - b = append(b, val.(byte)) + + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_ListGrantsInput_Marker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_TagResourceInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7277,31 +7504,21 @@ func com_amazonaws_kms_ListGrantsInput_Marker_FromDafny(input interface{}) *stri } }() } -func com_amazonaws_kms_RevokeGrantInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_kms_UpdateAliasInput_TargetKeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_TagResourceInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_Tag_TagValue_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UntagResourceInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -7315,45 +7532,39 @@ func com_amazonaws_kms_Tag_TagValue_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PrivateKeyCiphertextBlob_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func com_amazonaws_kms_UntagResourceInput_TagKeys_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b - } else { - b = append(b, val.(byte)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_TagKeyList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(input interface{}) *string { - return func() *string { +func com_amazonaws_kms_TagKeyList_member_FromDafny(input interface{}) string { + return func() string { var s string - if input == nil { - return nil - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return []string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_TrustAnchorCertificate_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateAliasInput_AliasName_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7363,13 +7574,11 @@ func com_amazonaws_kms_CreateCustomKeyStoreInput_TrustAnchorCertificate_FromDafn } }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateAliasInput_TargetKeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7379,13 +7588,11 @@ func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_KeyId_FromDafny(inp } }() } -func com_amazonaws_kms_GrantListEntry_RetiringPrincipal_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7395,7 +7602,7 @@ func com_amazonaws_kms_GrantListEntry_RetiringPrincipal_FromDafny(input interfac } }() } -func com_amazonaws_kms_SignOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateCustomKeyStoreInput_NewCustomKeyStoreName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7411,34 +7618,7 @@ func com_amazonaws_kms_SignOutput_KeyId_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_GetPublicKeyOutput_SigningAlgorithms_FromDafny(input interface{}) []types.SigningAlgorithmSpec { - return func() []types.SigningAlgorithmSpec { - var fieldValue []types.SigningAlgorithmSpec - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_kms_GenerateRandomInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { - return func() *types.RecipientInfo { - if input == nil { - return nil - } - return &types.RecipientInfo{ - KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), - AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_GrantListEntry_Name_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateCustomKeyStoreInput_KeyStorePassword_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7454,43 +7634,7 @@ func com_amazonaws_kms_GrantListEntry_Name_FromDafny(input interface{}) *string } }() } -func com_amazonaws_kms_DeriveSharedSecretInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { - return func() *types.RecipientInfo { - if input == nil { - return nil - } - return &types.RecipientInfo{ - KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), - AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_GetKeyRotationStatusOutput_NextRotationDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { - var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } else { - s = s + string(val.(dafny.Char)) - } - } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } - }() -} -func com_amazonaws_kms_DescribeCustomKeyStoresInput_Marker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7506,32 +7650,23 @@ func com_amazonaws_kms_DescribeCustomKeyStoresInput_Marker_FromDafny(input inter } }() } -func com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_kms_ListGrantsOutput_NextMarker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7547,21 +7682,7 @@ func com_amazonaws_kms_ListGrantsOutput_NextMarker_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_ListKeyPoliciesInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string - - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func com_amazonaws_kms_AlreadyExistsException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7577,47 +7698,31 @@ func com_amazonaws_kms_AlreadyExistsException_message_FromDafny(input interface{ } }() } -func com_amazonaws_kms_GenerateDataKeyPairInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { - return func() *types.RecipientInfo { - if input == nil { - return nil - } - return &types.RecipientInfo{ - KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), - AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_CreateGrantOutput_GrantId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(input interface{}) *types.XksProxyAuthenticationCredentialType { + return func() *types.XksProxyAuthenticationCredentialType { if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) - } + return &types.XksProxyAuthenticationCredentialType{ + AccessKeyId: com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_AccessKeyId()), + RawSecretAccessKey: com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_RawSecretAccessKey()), } }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { - return func() types.DataKeyPairSpec { - var u types.DataKeyPairSpec +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { + return func() types.XksProxyConnectivityType { + var u types.XksProxyConnectivityType if input == nil { return u } - inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ - if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { break } } @@ -7625,13 +7730,11 @@ func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyPairSpec_Fro return u.Values()[index] }() } -func com_amazonaws_kms_DryRunOperationException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdateKeyDescriptionInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7641,65 +7744,25 @@ func com_amazonaws_kms_DryRunOperationException_message_FromDafny(input interfac } }() } -func com_amazonaws_kms_DecryptInput_EncryptionContext_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) - if input == nil { - return nil - } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { - val, ok := i() - if !ok { - break - } - m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) - } - return m - }() -} -func com_amazonaws_kms_SignInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_UpdateKeyDescriptionInput_Description_FromDafny(input interface{}) *string { + return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_kms_CreateGrantInput_Name_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdatePrimaryRegionInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7709,13 +7772,11 @@ func com_amazonaws_kms_CreateGrantInput_Name_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_kms_GetKeyPolicyOutput_Policy_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UpdatePrimaryRegionInput_PrimaryRegion_FromDafny(input interface{}) *string { return func() *string { var s string - if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7725,7 +7786,7 @@ func com_amazonaws_kms_GetKeyPolicyOutput_Policy_FromDafny(input interface{}) *s } }() } -func com_amazonaws_kms_GetParametersForImportInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_VerifyInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -7739,39 +7800,44 @@ func com_amazonaws_kms_GetParametersForImportInput_KeyId_FromDafny(input interfa } }() } -func com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_VerifyInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return &[]string{s}[0] + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func com_amazonaws_kms_ListResourceTagsInput_Marker_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_VerifyInput_MessageType_FromDafny(input interface{}) types.MessageType { + return func() types.MessageType { + var u types.MessageType if input == nil { - return nil + return u } - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + + inputEnum := input.(ComAmazonawsKmsTypes.MessageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MessageType).Equals(inputEnum) { + break + } } } + return u.Values()[index] }() } -func com_amazonaws_kms_VerifyMacInput_Message_FromDafny(input interface{}) []byte { +func com_amazonaws_kms_VerifyInput_Signature_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -7787,36 +7853,57 @@ func com_amazonaws_kms_VerifyMacInput_Message_FromDafny(input interface{}) []byt } }() } -func com_amazonaws_kms_VerifyMacInput_KeyId_FromDafny(input interface{}) *string { - return func() *string { - var s string +func com_amazonaws_kms_VerifyInput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec - for i := dafny.Iterate(input); ; { + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_VerifyInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { val, ok := i() if !ok { - return &[]string{s}[0] - } else { - s = s + string(val.(dafny.Char)) + break } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } + return fieldValue }() } -func com_amazonaws_kms_GrantListEntry_Constraints_FromDafny(input interface{}) *types.GrantConstraints { - return func() *types.GrantConstraints { +func com_amazonaws_kms_VerifyInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool if input == nil { return nil } - return &types.GrantConstraints{ - EncryptionContextSubset: com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextSubset().UnwrapOr(nil)), - EncryptionContextEquals: com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextEquals().UnwrapOr(nil)), - } + b = input.(bool) + return &b }() } -func com_amazonaws_kms_ListGrantsInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_VerifyOutput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -7826,49 +7913,54 @@ func com_amazonaws_kms_ListGrantsInput_KeyId_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_kms_ListKeyRotationsOutput_Rotations_FromDafny(input interface{}) []types.RotationsListEntry { - return func() []types.RotationsListEntry { - var fieldValue []types.RotationsListEntry +func com_amazonaws_kms_VerifyOutput_SignatureValid_FromDafny(input interface{}) bool { + return func() bool { + var b bool if input == nil { - return nil - } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_kms_RotationsList_member_FromDafny(val)) + return b } - return fieldValue + b = input.(bool) + return b }() } -func com_amazonaws_kms_TagList_member_FromDafny(input interface{}) types.Tag { - return func() types.Tag { +func com_amazonaws_kms_VerifyOutput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec + if input == nil { + return u + } - return types.Tag{ - TagKey: com_amazonaws_kms_Tag_TagKey_FromDafny(input.(ComAmazonawsKmsTypes.Tag).Dtor_TagKey()), - TagValue: com_amazonaws_kms_Tag_TagValue_FromDafny(input.(ComAmazonawsKmsTypes.Tag).Dtor_TagValue()), + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } } + return u.Values()[index] }() } -func com_amazonaws_kms_EncryptInput_EncryptionContext_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_kms_VerifyMacInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - break + return b + } else { + b = append(b, val.(byte)) } - m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_kms_UpdatePrimaryRegionInput_PrimaryRegion_FromDafny(input interface{}) *string { +func com_amazonaws_kms_VerifyMacInput_KeyId_FromDafny(input interface{}) *string { return func() *string { var s string @@ -7882,21 +7974,41 @@ func com_amazonaws_kms_UpdatePrimaryRegionInput_PrimaryRegion_FromDafny(input in } }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_FromDafny(input interface{}) *types.XksProxyConfigurationType { - return func() *types.XksProxyConfigurationType { +func com_amazonaws_kms_VerifyMacInput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_VerifyMacInput_Mac_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte if input == nil { return nil } - return &types.XksProxyConfigurationType{ - Connectivity: com_amazonaws_kms_XksProxyConfigurationType_Connectivity_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_Connectivity().UnwrapOr(nil)), - AccessKeyId: com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_AccessKeyId().UnwrapOr(nil)), - UriEndpoint: com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_UriEndpoint().UnwrapOr(nil)), - UriPath: com_amazonaws_kms_XksProxyConfigurationType_UriPath_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_UriPath().UnwrapOr(nil)), - VpcEndpointServiceName: com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_VpcEndpointServiceName().UnwrapOr(nil)), - } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } }() } -func com_amazonaws_kms_DescribeKeyInput_GrantTokens_FromDafny(input interface{}) []string { +func com_amazonaws_kms_VerifyMacInput_GrantTokens_FromDafny(input interface{}) []string { return func() []string { var fieldValue []string if input == nil { @@ -7912,7 +8024,7 @@ func com_amazonaws_kms_DescribeKeyInput_GrantTokens_FromDafny(input interface{}) return fieldValue }() } -func com_amazonaws_kms_RetireGrantInput_DryRun_FromDafny(input interface{}) *bool { +func com_amazonaws_kms_VerifyMacInput_DryRun_FromDafny(input interface{}) *bool { return func() *bool { var b bool if input == nil { @@ -7922,23 +8034,54 @@ func com_amazonaws_kms_RetireGrantInput_DryRun_FromDafny(input interface{}) *boo return &b }() } -func com_amazonaws_kms_SignOutput_Signature_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_VerifyMacOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_XksKeyNotFoundException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_VerifyMacOutput_MacValid_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_VerifyMacOutput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_AlreadyExistsException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7954,7 +8097,7 @@ func com_amazonaws_kms_XksKeyNotFoundException_message_FromDafny(input interface } }() } -func com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CloudHsmClusterInUseException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7970,7 +8113,7 @@ func com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_FromDafny } }() } -func com_amazonaws_kms_KeyMetadata_Description_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -7986,82 +8129,39 @@ func com_amazonaws_kms_KeyMetadata_Description_FromDafny(input interface{}) *str } }() } -func com_amazonaws_kms_CreateKeyOutput_KeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { - return func() *types.KeyMetadata { - if input == nil { - return nil - } - return &types.KeyMetadata{ - AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), - KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), - Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), - CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), - Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), - Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), - KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), - KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), - DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), - ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), - Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), - CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), - CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), - ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), - KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), - CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), - KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), - EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), - SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), - KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), - MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), - MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), - PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), - MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), - XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_CloudHsmClusterNotActiveException_message_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } }() } -func com_amazonaws_kms_ListResourceTagsOutput_Tags_FromDafny(input interface{}) []types.Tag { - return func() []types.Tag { - var fieldValue []types.Tag +func com_amazonaws_kms_CloudHsmClusterNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_ReEncryptOutput_SourceKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8077,41 +8177,23 @@ func com_amazonaws_kms_ReEncryptOutput_SourceKeyId_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec - - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] - }() -} -func com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyPlaintext_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_ConflictException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_InvalidArnException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8127,17 +8209,7 @@ func com_amazonaws_kms_InvalidArnException_message_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8153,11 +8225,13 @@ func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreId_FromDafny(i } }() } -func com_amazonaws_kms_CreateAliasInput_AliasName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_CustomKeyStoreNameInUseException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8183,7 +8257,7 @@ func com_amazonaws_kms_CustomKeyStoreNotFoundException_message_FromDafny(input i } }() } -func com_amazonaws_kms_DecryptOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DependencyTimeoutException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8199,23 +8273,23 @@ func com_amazonaws_kms_DecryptOutput_KeyId_FromDafny(input interface{}) *string } }() } -func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_CiphertextBlob_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_DisabledException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_InvalidGrantTokenException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_DryRunOperationException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8231,7 +8305,7 @@ func com_amazonaws_kms_InvalidGrantTokenException_message_FromDafny(input interf } }() } -func com_amazonaws_kms_CancelKeyDeletionOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_ExpiredImportTokenException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8247,41 +8321,29 @@ func com_amazonaws_kms_CancelKeyDeletionOutput_KeyId_FromDafny(input interface{} } }() } -func com_amazonaws_kms_CreateGrantInput_Operations_FromDafny(input interface{}) []types.GrantOperation { - return func() []types.GrantOperation { - var fieldValue []types.GrantOperation - - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantOperationList_member_FromDafny(val)) - } - return fieldValue - }() -} -func com_amazonaws_kms_DeriveSharedSecretOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_IncorrectKeyException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_RevokeGrantInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_IncorrectKeyMaterialException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8291,7 +8353,7 @@ func com_amazonaws_kms_RevokeGrantInput_KeyId_FromDafny(input interface{}) *stri } }() } -func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_IncorrectTrustAnchorException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8307,37 +8369,29 @@ func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_messag } }() } -func com_amazonaws_kms_EncryptInput_DryRun_FromDafny(input interface{}) *bool { - return func() *bool { - var b bool - if input == nil { - return nil - } - b = input.(bool) - return &b - }() -} -func com_amazonaws_kms_VerifyMacInput_GrantTokens_FromDafny(input interface{}) []string { - return func() []string { - var fieldValue []string +func com_amazonaws_kms_InvalidAliasNameException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_InvalidArnException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8347,7 +8401,7 @@ func com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_ReplicateKeyOutput_ReplicaPolicy_FromDafny(input interface{}) *string { +func com_amazonaws_kms_InvalidCiphertextException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8363,11 +8417,13 @@ func com_amazonaws_kms_ReplicateKeyOutput_ReplicaPolicy_FromDafny(input interfac } }() } -func com_amazonaws_kms_SignInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_InvalidGrantIdException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8377,7 +8433,7 @@ func com_amazonaws_kms_SignInput_KeyId_FromDafny(input interface{}) *string { } }() } -func com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input interface{}) *string { +func com_amazonaws_kms_InvalidGrantTokenException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8393,7 +8449,7 @@ func com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input interface{}) *strin } }() } -func com_amazonaws_kms_IncorrectTrustAnchorException_message_FromDafny(input interface{}) *string { +func com_amazonaws_kms_InvalidImportTokenException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8409,7 +8465,7 @@ func com_amazonaws_kms_IncorrectTrustAnchorException_message_FromDafny(input int } }() } -func com_amazonaws_kms_GetKeyPolicyOutput_PolicyName_FromDafny(input interface{}) *string { +func com_amazonaws_kms_InvalidKeyUsageException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8425,11 +8481,13 @@ func com_amazonaws_kms_GetKeyPolicyOutput_PolicyName_FromDafny(input interface{} } }() } -func com_amazonaws_kms_PutKeyPolicyInput_Policy_FromDafny(input interface{}) *string { +func com_amazonaws_kms_InvalidMarkerException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8439,23 +8497,23 @@ func com_amazonaws_kms_PutKeyPolicyInput_Policy_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_GetParametersForImportOutput_PublicKey_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_KeyUnavailableException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_ListKeysOutput_NextMarker_FromDafny(input interface{}) *string { +func com_amazonaws_kms_KMSInternalException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8471,7 +8529,7 @@ func com_amazonaws_kms_ListKeysOutput_NextMarker_FromDafny(input interface{}) *s } }() } -func com_amazonaws_kms_EncryptOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_KMSInvalidMacException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8487,32 +8545,23 @@ func com_amazonaws_kms_EncryptOutput_KeyId_FromDafny(input interface{}) *string } }() } -func com_amazonaws_kms_GenerateDataKeyInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { - return func() *types.RecipientInfo { +func com_amazonaws_kms_KMSInvalidSignatureException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - return &types.RecipientInfo{ - KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), - AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), - } - }() -} -func com_amazonaws_kms_GrantTokenList_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return []string{s}[0] + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } }() } -func com_amazonaws_kms_RetireGrantInput_GrantId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_KMSInvalidStateException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8528,44 +8577,23 @@ func com_amazonaws_kms_RetireGrantInput_GrantId_FromDafny(input interface{}) *st } }() } -func com_amazonaws_kms_SignInput_Message_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte +func com_amazonaws_kms_LimitExceededException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - return b + return &[]string{s}[0] } else { - b = append(b, val.(byte)) - } - } - }() -} -func com_amazonaws_kms_VerifyMacOutput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { - return func() types.MacAlgorithmSpec { - var u types.MacAlgorithmSpec - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { - break - } + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input interface{}) *string { +func com_amazonaws_kms_MalformedPolicyDocumentException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8581,23 +8609,23 @@ func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input } }() } -func com_amazonaws_kms_GetPublicKeyOutput_KeyAgreementAlgorithms_FromDafny(input interface{}) []types.KeyAgreementAlgorithmSpec { - return func() []types.KeyAgreementAlgorithmSpec { - var fieldValue []types.KeyAgreementAlgorithmSpec +func com_amazonaws_kms_NotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(input interface{}) *string { +func com_amazonaws_kms_TagException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8613,11 +8641,13 @@ func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(i } }() } -func com_amazonaws_kms_PutKeyPolicyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_UnsupportedOperationException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8627,11 +8657,13 @@ func com_amazonaws_kms_PutKeyPolicyInput_KeyId_FromDafny(input interface{}) *str } }() } -func com_amazonaws_kms_GetKeyPolicyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksKeyAlreadyInUseException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8641,11 +8673,13 @@ func com_amazonaws_kms_GetKeyPolicyInput_KeyId_FromDafny(input interface{}) *str } }() } -func com_amazonaws_kms_EnableKeyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8655,7 +8689,7 @@ func com_amazonaws_kms_EnableKeyInput_KeyId_FromDafny(input interface{}) *string } }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksKeyNotFoundException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8671,28 +8705,29 @@ func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyId_FromDafny } }() } -func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_EncryptionContext_FromDafny(input interface{}) map[string]string { - return func() map[string]string { - var m map[string]string = make(map[string]string) +func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - - for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } - return m }() } -func com_amazonaws_kms_DescribeKeyInput_KeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyInvalidConfigurationException_message_FromDafny(input interface{}) *string { return func() *string { var s string - - for i := dafny.Iterate(input); ; { + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { return &[]string{s}[0] @@ -8702,69 +8737,39 @@ func com_amazonaws_kms_DescribeKeyInput_KeyId_FromDafny(input interface{}) *stri } }() } -func com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_FromDafny(input interface{}) []types.MultiRegionKey { - return func() []types.MultiRegionKey { - var fieldValue []types.MultiRegionKey +func com_amazonaws_kms_XksProxyInvalidResponseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_MultiRegionKeyList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_GetKeyRotationStatusOutput_OnDemandRotationStartDate_FromDafny(input interface{}) *time.Time { - return func() *time.Time { +func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_FromDafny(input interface{}) *string { + return func() *string { var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] } else { s = s + string(val.(dafny.Char)) } } - if len(s) == 0 { - panic("timestamp string is empty") - } else { - t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) - if err != nil { - panic(err) - } - return &t - } - }() -} -func com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_FromDafny(input interface{}) types.MultiRegionKeyType { - return func() types.MultiRegionKeyType { - var u types.MultiRegionKeyType - if input == nil { - return u - } - - inputEnum := input.(ComAmazonawsKmsTypes.MultiRegionKeyType) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MultiRegionKeyType_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.MultiRegionKeyType).Equals(inputEnum) { - break - } - } - } - return u.Values()[index] }() } -func com_amazonaws_kms_AliasListEntry_TargetKeyId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyUriInUseException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8780,44 +8785,39 @@ func com_amazonaws_kms_AliasListEntry_TargetKeyId_FromDafny(input interface{}) * } }() } -func com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input interface{}) []types.MacAlgorithmSpec { - return func() []types.MacAlgorithmSpec { - var fieldValue []types.MacAlgorithmSpec +func com_amazonaws_kms_XksProxyUriUnreachableException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { return nil } - for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { - break + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } - fieldValue = append(fieldValue, com_amazonaws_kms_MacAlgorithmSpecList_member_FromDafny(val)) } - return fieldValue }() } -func com_amazonaws_kms_ReEncryptOutput_SourceEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { - return func() types.EncryptionAlgorithmSpec { - var u types.EncryptionAlgorithmSpec +func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string if input == nil { - return u + return nil } - - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) } } - return u.Values()[index] }() } -func com_amazonaws_kms_RetireGrantInput_GrantToken_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { @@ -8833,7 +8833,7 @@ func com_amazonaws_kms_RetireGrantInput_GrantToken_FromDafny(input interface{}) } }() } -func com_amazonaws_kms_GenerateRandomInput_CustomKeyStoreId_FromDafny(input interface{}) *string { +func com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_FromDafny(input interface{}) *string { return func() *string { var s string if input == nil { diff --git a/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/KMSwrapped/shim.go b/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/KMSwrapped/shim.go new file mode 100644 index 000000000..8dcfb7a96 --- /dev/null +++ b/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/KMSwrapped/shim.go @@ -0,0 +1,486 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package KMSwrapped + +import ( + "context" + + "github.com/aws/aws-cryptographic-material-providers-library/kms/ComAmazonawsKmsTypes" + "github.com/aws/aws-cryptographic-material-providers-library/kms/comamazonawskmssmithygenerated" + "github.com/aws/aws-sdk-go-v2/service/kms" + "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" + "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" +) + +type Shim struct { + ComAmazonawsKmsTypes.IKMSClient + Client *kms.Client +} + +func (shim *Shim) CancelKeyDeletion(input ComAmazonawsKmsTypes.CancelKeyDeletionRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.CancelKeyDeletionInput_FromDafny(input) + var native_response, native_error = shim.Client.CancelKeyDeletion(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.CancelKeyDeletionOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ConnectCustomKeyStore(input ComAmazonawsKmsTypes.ConnectCustomKeyStoreRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ConnectCustomKeyStoreInput_FromDafny(input) + var native_response, native_error = shim.Client.ConnectCustomKeyStore(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ConnectCustomKeyStoreOutput_ToDafny(*native_response)) +} + +func (shim *Shim) CreateAlias(input ComAmazonawsKmsTypes.CreateAliasRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.CreateAliasInput_FromDafny(input) + var _, native_error = shim.Client.CreateAlias(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) CreateCustomKeyStore(input ComAmazonawsKmsTypes.CreateCustomKeyStoreRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.CreateCustomKeyStoreInput_FromDafny(input) + var native_response, native_error = shim.Client.CreateCustomKeyStore(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.CreateCustomKeyStoreOutput_ToDafny(*native_response)) +} + +func (shim *Shim) CreateGrant(input ComAmazonawsKmsTypes.CreateGrantRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.CreateGrantInput_FromDafny(input) + var native_response, native_error = shim.Client.CreateGrant(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.CreateGrantOutput_ToDafny(*native_response)) +} + +func (shim *Shim) CreateKey(input ComAmazonawsKmsTypes.CreateKeyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.CreateKeyInput_FromDafny(input) + var native_response, native_error = shim.Client.CreateKey(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.CreateKeyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) Decrypt(input ComAmazonawsKmsTypes.DecryptRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DecryptInput_FromDafny(input) + var native_response, native_error = shim.Client.Decrypt(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.DecryptOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DeleteAlias(input ComAmazonawsKmsTypes.DeleteAliasRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DeleteAliasInput_FromDafny(input) + var _, native_error = shim.Client.DeleteAlias(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) DeleteCustomKeyStore(input ComAmazonawsKmsTypes.DeleteCustomKeyStoreRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DeleteCustomKeyStoreInput_FromDafny(input) + var native_response, native_error = shim.Client.DeleteCustomKeyStore(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.DeleteCustomKeyStoreOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DeleteImportedKeyMaterial(input ComAmazonawsKmsTypes.DeleteImportedKeyMaterialRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DeleteImportedKeyMaterialInput_FromDafny(input) + var _, native_error = shim.Client.DeleteImportedKeyMaterial(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) DeriveSharedSecret(input ComAmazonawsKmsTypes.DeriveSharedSecretRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DeriveSharedSecretInput_FromDafny(input) + var native_response, native_error = shim.Client.DeriveSharedSecret(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.DeriveSharedSecretOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeCustomKeyStores(input ComAmazonawsKmsTypes.DescribeCustomKeyStoresRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DescribeCustomKeyStoresInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeCustomKeyStores(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.DescribeCustomKeyStoresOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DescribeKey(input ComAmazonawsKmsTypes.DescribeKeyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DescribeKeyInput_FromDafny(input) + var native_response, native_error = shim.Client.DescribeKey(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.DescribeKeyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) DisableKey(input ComAmazonawsKmsTypes.DisableKeyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DisableKeyInput_FromDafny(input) + var _, native_error = shim.Client.DisableKey(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) DisableKeyRotation(input ComAmazonawsKmsTypes.DisableKeyRotationRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DisableKeyRotationInput_FromDafny(input) + var _, native_error = shim.Client.DisableKeyRotation(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) DisconnectCustomKeyStore(input ComAmazonawsKmsTypes.DisconnectCustomKeyStoreRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.DisconnectCustomKeyStoreInput_FromDafny(input) + var native_response, native_error = shim.Client.DisconnectCustomKeyStore(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.DisconnectCustomKeyStoreOutput_ToDafny(*native_response)) +} + +func (shim *Shim) EnableKey(input ComAmazonawsKmsTypes.EnableKeyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.EnableKeyInput_FromDafny(input) + var _, native_error = shim.Client.EnableKey(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) EnableKeyRotation(input ComAmazonawsKmsTypes.EnableKeyRotationRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.EnableKeyRotationInput_FromDafny(input) + var _, native_error = shim.Client.EnableKeyRotation(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) Encrypt(input ComAmazonawsKmsTypes.EncryptRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.EncryptInput_FromDafny(input) + var native_response, native_error = shim.Client.Encrypt(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.EncryptOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GenerateDataKey(input ComAmazonawsKmsTypes.GenerateDataKeyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GenerateDataKeyInput_FromDafny(input) + var native_response, native_error = shim.Client.GenerateDataKey(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GenerateDataKeyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GenerateDataKeyPair(input ComAmazonawsKmsTypes.GenerateDataKeyPairRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GenerateDataKeyPairInput_FromDafny(input) + var native_response, native_error = shim.Client.GenerateDataKeyPair(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GenerateDataKeyPairOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GenerateDataKeyPairWithoutPlaintext(input ComAmazonawsKmsTypes.GenerateDataKeyPairWithoutPlaintextRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GenerateDataKeyPairWithoutPlaintextInput_FromDafny(input) + var native_response, native_error = shim.Client.GenerateDataKeyPairWithoutPlaintext(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GenerateDataKeyPairWithoutPlaintextOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GenerateDataKeyWithoutPlaintext(input ComAmazonawsKmsTypes.GenerateDataKeyWithoutPlaintextRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GenerateDataKeyWithoutPlaintextInput_FromDafny(input) + var native_response, native_error = shim.Client.GenerateDataKeyWithoutPlaintext(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GenerateDataKeyWithoutPlaintextOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GenerateMac(input ComAmazonawsKmsTypes.GenerateMacRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GenerateMacInput_FromDafny(input) + var native_response, native_error = shim.Client.GenerateMac(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GenerateMacOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GenerateRandom(input ComAmazonawsKmsTypes.GenerateRandomRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GenerateRandomInput_FromDafny(input) + var native_response, native_error = shim.Client.GenerateRandom(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GenerateRandomOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GetKeyPolicy(input ComAmazonawsKmsTypes.GetKeyPolicyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GetKeyPolicyInput_FromDafny(input) + var native_response, native_error = shim.Client.GetKeyPolicy(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GetKeyPolicyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GetKeyRotationStatus(input ComAmazonawsKmsTypes.GetKeyRotationStatusRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GetKeyRotationStatusInput_FromDafny(input) + var native_response, native_error = shim.Client.GetKeyRotationStatus(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GetKeyRotationStatusOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GetParametersForImport(input ComAmazonawsKmsTypes.GetParametersForImportRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GetParametersForImportInput_FromDafny(input) + var native_response, native_error = shim.Client.GetParametersForImport(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GetParametersForImportOutput_ToDafny(*native_response)) +} + +func (shim *Shim) GetPublicKey(input ComAmazonawsKmsTypes.GetPublicKeyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.GetPublicKeyInput_FromDafny(input) + var native_response, native_error = shim.Client.GetPublicKey(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.GetPublicKeyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ImportKeyMaterial(input ComAmazonawsKmsTypes.ImportKeyMaterialRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ImportKeyMaterialInput_FromDafny(input) + var native_response, native_error = shim.Client.ImportKeyMaterial(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ImportKeyMaterialOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListAliases(input ComAmazonawsKmsTypes.ListAliasesRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ListAliasesInput_FromDafny(input) + var native_response, native_error = shim.Client.ListAliases(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ListAliasesOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListGrants(input ComAmazonawsKmsTypes.ListGrantsRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ListGrantsInput_FromDafny(input) + var native_response, native_error = shim.Client.ListGrants(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ListGrantsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListKeyPolicies(input ComAmazonawsKmsTypes.ListKeyPoliciesRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ListKeyPoliciesInput_FromDafny(input) + var native_response, native_error = shim.Client.ListKeyPolicies(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ListKeyPoliciesOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListKeyRotations(input ComAmazonawsKmsTypes.ListKeyRotationsRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ListKeyRotationsInput_FromDafny(input) + var native_response, native_error = shim.Client.ListKeyRotations(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ListKeyRotationsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListKeys(input ComAmazonawsKmsTypes.ListKeysRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ListKeysInput_FromDafny(input) + var native_response, native_error = shim.Client.ListKeys(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ListKeysOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ListResourceTags(input ComAmazonawsKmsTypes.ListResourceTagsRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ListResourceTagsInput_FromDafny(input) + var native_response, native_error = shim.Client.ListResourceTags(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ListResourceTagsOutput_ToDafny(*native_response)) +} + +func (shim *Shim) PutKeyPolicy(input ComAmazonawsKmsTypes.PutKeyPolicyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.PutKeyPolicyInput_FromDafny(input) + var _, native_error = shim.Client.PutKeyPolicy(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) ReEncrypt(input ComAmazonawsKmsTypes.ReEncryptRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ReEncryptInput_FromDafny(input) + var native_response, native_error = shim.Client.ReEncrypt(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ReEncryptOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ReplicateKey(input ComAmazonawsKmsTypes.ReplicateKeyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ReplicateKeyInput_FromDafny(input) + var native_response, native_error = shim.Client.ReplicateKey(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ReplicateKeyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) RetireGrant(input ComAmazonawsKmsTypes.RetireGrantRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.RetireGrantInput_FromDafny(input) + var _, native_error = shim.Client.RetireGrant(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) RevokeGrant(input ComAmazonawsKmsTypes.RevokeGrantRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.RevokeGrantInput_FromDafny(input) + var _, native_error = shim.Client.RevokeGrant(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) RotateKeyOnDemand(input ComAmazonawsKmsTypes.RotateKeyOnDemandRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.RotateKeyOnDemandInput_FromDafny(input) + var native_response, native_error = shim.Client.RotateKeyOnDemand(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.RotateKeyOnDemandOutput_ToDafny(*native_response)) +} + +func (shim *Shim) ScheduleKeyDeletion(input ComAmazonawsKmsTypes.ScheduleKeyDeletionRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.ScheduleKeyDeletionInput_FromDafny(input) + var native_response, native_error = shim.Client.ScheduleKeyDeletion(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.ScheduleKeyDeletionOutput_ToDafny(*native_response)) +} + +func (shim *Shim) Sign(input ComAmazonawsKmsTypes.SignRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.SignInput_FromDafny(input) + var native_response, native_error = shim.Client.Sign(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.SignOutput_ToDafny(*native_response)) +} + +func (shim *Shim) TagResource(input ComAmazonawsKmsTypes.TagResourceRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.TagResourceInput_FromDafny(input) + var _, native_error = shim.Client.TagResource(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) UntagResource(input ComAmazonawsKmsTypes.UntagResourceRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.UntagResourceInput_FromDafny(input) + var _, native_error = shim.Client.UntagResource(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) UpdateAlias(input ComAmazonawsKmsTypes.UpdateAliasRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.UpdateAliasInput_FromDafny(input) + var _, native_error = shim.Client.UpdateAlias(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) UpdateCustomKeyStore(input ComAmazonawsKmsTypes.UpdateCustomKeyStoreRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.UpdateCustomKeyStoreInput_FromDafny(input) + var native_response, native_error = shim.Client.UpdateCustomKeyStore(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.UpdateCustomKeyStoreOutput_ToDafny(*native_response)) +} + +func (shim *Shim) UpdateKeyDescription(input ComAmazonawsKmsTypes.UpdateKeyDescriptionRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.UpdateKeyDescriptionInput_FromDafny(input) + var _, native_error = shim.Client.UpdateKeyDescription(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) UpdatePrimaryRegion(input ComAmazonawsKmsTypes.UpdatePrimaryRegionRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.UpdatePrimaryRegionInput_FromDafny(input) + var _, native_error = shim.Client.UpdatePrimaryRegion(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf()) +} + +func (shim *Shim) Verify(input ComAmazonawsKmsTypes.VerifyRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.VerifyInput_FromDafny(input) + var native_response, native_error = shim.Client.Verify(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.VerifyOutput_ToDafny(*native_response)) +} + +func (shim *Shim) VerifyMac(input ComAmazonawsKmsTypes.VerifyMacRequest) Wrappers.Result { + var native_request = comamazonawskmssmithygenerated.VerifyMacInput_FromDafny(input) + var native_response, native_error = shim.Client.VerifyMac(context.Background(), &native_request) + if native_error != nil { + return Wrappers.Companion_Result_.Create_Failure_(comamazonawskmssmithygenerated.Error_ToDafny(native_error)) + } + return Wrappers.Companion_Result_.Create_Success_(comamazonawskmssmithygenerated.VerifyMacOutput_ToDafny(*native_response)) +} diff --git a/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go b/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go new file mode 100644 index 000000000..cf01c187b --- /dev/null +++ b/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_dafny.go @@ -0,0 +1,6402 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comamazonawskmssmithygenerated + +import ( + "errors" + "time" + + "github.com/aws/aws-cryptographic-material-providers-library/kms/ComAmazonawsKmsTypes" + "github.com/aws/aws-sdk-go-v2/service/kms" + "github.com/aws/aws-sdk-go-v2/service/kms/types" + "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" + "github.com/dafny-lang/DafnyStandardLibGo/Wrappers" +) + +func CancelKeyDeletionInput_ToDafny(nativeInput kms.CancelKeyDeletionInput) ComAmazonawsKmsTypes.CancelKeyDeletionRequest { + + return func() ComAmazonawsKmsTypes.CancelKeyDeletionRequest { + + return ComAmazonawsKmsTypes.Companion_CancelKeyDeletionRequest_.Create_CancelKeyDeletionRequest_(com_amazonaws_kms_CancelKeyDeletionRequest_KeyId_ToDafny(nativeInput.KeyId)) + }() + +} + +func CancelKeyDeletionOutput_ToDafny(nativeOutput kms.CancelKeyDeletionOutput) ComAmazonawsKmsTypes.CancelKeyDeletionResponse { + + return func() ComAmazonawsKmsTypes.CancelKeyDeletionResponse { + + return ComAmazonawsKmsTypes.Companion_CancelKeyDeletionResponse_.Create_CancelKeyDeletionResponse_(com_amazonaws_kms_CancelKeyDeletionResponse_KeyId_ToDafny(nativeOutput.KeyId)) + }() + +} + +func ConnectCustomKeyStoreInput_ToDafny(nativeInput kms.ConnectCustomKeyStoreInput) ComAmazonawsKmsTypes.ConnectCustomKeyStoreRequest { + + return func() ComAmazonawsKmsTypes.ConnectCustomKeyStoreRequest { + + return ComAmazonawsKmsTypes.Companion_ConnectCustomKeyStoreRequest_.Create_ConnectCustomKeyStoreRequest_(com_amazonaws_kms_ConnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(nativeInput.CustomKeyStoreId)) + }() + +} + +func ConnectCustomKeyStoreOutput_ToDafny(nativeOutput kms.ConnectCustomKeyStoreOutput) ComAmazonawsKmsTypes.ConnectCustomKeyStoreResponse { + + return func() ComAmazonawsKmsTypes.ConnectCustomKeyStoreResponse { + + return ComAmazonawsKmsTypes.Companion_ConnectCustomKeyStoreResponse_.Create_ConnectCustomKeyStoreResponse_() + }() + +} + +func CreateAliasInput_ToDafny(nativeInput kms.CreateAliasInput) ComAmazonawsKmsTypes.CreateAliasRequest { + + return func() ComAmazonawsKmsTypes.CreateAliasRequest { + + return ComAmazonawsKmsTypes.Companion_CreateAliasRequest_.Create_CreateAliasRequest_(com_amazonaws_kms_CreateAliasRequest_AliasName_ToDafny(nativeInput.AliasName), com_amazonaws_kms_CreateAliasRequest_TargetKeyId_ToDafny(nativeInput.TargetKeyId)) + }() + +} + +func CreateCustomKeyStoreInput_ToDafny(nativeInput kms.CreateCustomKeyStoreInput) ComAmazonawsKmsTypes.CreateCustomKeyStoreRequest { + + return func() ComAmazonawsKmsTypes.CreateCustomKeyStoreRequest { + + return ComAmazonawsKmsTypes.Companion_CreateCustomKeyStoreRequest_.Create_CreateCustomKeyStoreRequest_(com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreName_ToDafny(nativeInput.CustomKeyStoreName), com_amazonaws_kms_CreateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(nativeInput.CloudHsmClusterId), com_amazonaws_kms_CreateCustomKeyStoreRequest_TrustAnchorCertificate_ToDafny(nativeInput.TrustAnchorCertificate), com_amazonaws_kms_CreateCustomKeyStoreRequest_KeyStorePassword_ToDafny(nativeInput.KeyStorePassword), com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreType_ToDafny(nativeInput.CustomKeyStoreType), com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(nativeInput.XksProxyUriEndpoint), com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(nativeInput.XksProxyUriPath), com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(nativeInput.XksProxyVpcEndpointServiceName), com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(nativeInput.XksProxyAuthenticationCredential), com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(nativeInput.XksProxyConnectivity)) + }() + +} + +func CreateCustomKeyStoreOutput_ToDafny(nativeOutput kms.CreateCustomKeyStoreOutput) ComAmazonawsKmsTypes.CreateCustomKeyStoreResponse { + + return func() ComAmazonawsKmsTypes.CreateCustomKeyStoreResponse { + + return ComAmazonawsKmsTypes.Companion_CreateCustomKeyStoreResponse_.Create_CreateCustomKeyStoreResponse_(com_amazonaws_kms_CreateCustomKeyStoreResponse_CustomKeyStoreId_ToDafny(nativeOutput.CustomKeyStoreId)) + }() + +} + +func CreateGrantInput_ToDafny(nativeInput kms.CreateGrantInput) ComAmazonawsKmsTypes.CreateGrantRequest { + + return func() ComAmazonawsKmsTypes.CreateGrantRequest { + + return ComAmazonawsKmsTypes.Companion_CreateGrantRequest_.Create_CreateGrantRequest_(com_amazonaws_kms_CreateGrantRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_CreateGrantRequest_GranteePrincipal_ToDafny(nativeInput.GranteePrincipal), com_amazonaws_kms_CreateGrantRequest_RetiringPrincipal_ToDafny(nativeInput.RetiringPrincipal), com_amazonaws_kms_CreateGrantRequest_Operations_ToDafny(nativeInput.Operations), com_amazonaws_kms_CreateGrantRequest_Constraints_ToDafny(nativeInput.Constraints), com_amazonaws_kms_CreateGrantRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_CreateGrantRequest_Name_ToDafny(nativeInput.Name), com_amazonaws_kms_CreateGrantRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func CreateGrantOutput_ToDafny(nativeOutput kms.CreateGrantOutput) ComAmazonawsKmsTypes.CreateGrantResponse { + + return func() ComAmazonawsKmsTypes.CreateGrantResponse { + + return ComAmazonawsKmsTypes.Companion_CreateGrantResponse_.Create_CreateGrantResponse_(com_amazonaws_kms_CreateGrantResponse_GrantToken_ToDafny(nativeOutput.GrantToken), com_amazonaws_kms_CreateGrantResponse_GrantId_ToDafny(nativeOutput.GrantId)) + }() + +} + +func CreateKeyInput_ToDafny(nativeInput kms.CreateKeyInput) ComAmazonawsKmsTypes.CreateKeyRequest { + + return func() ComAmazonawsKmsTypes.CreateKeyRequest { + + return ComAmazonawsKmsTypes.Companion_CreateKeyRequest_.Create_CreateKeyRequest_(com_amazonaws_kms_CreateKeyRequest_Policy_ToDafny(nativeInput.Policy), com_amazonaws_kms_CreateKeyRequest_Description_ToDafny(nativeInput.Description), com_amazonaws_kms_CreateKeyRequest_KeyUsage_ToDafny(nativeInput.KeyUsage), com_amazonaws_kms_CreateKeyRequest_CustomerMasterKeySpec_ToDafny(nativeInput.CustomerMasterKeySpec), com_amazonaws_kms_CreateKeyRequest_KeySpec_ToDafny(nativeInput.KeySpec), com_amazonaws_kms_CreateKeyRequest_Origin_ToDafny(nativeInput.Origin), com_amazonaws_kms_CreateKeyRequest_CustomKeyStoreId_ToDafny(nativeInput.CustomKeyStoreId), com_amazonaws_kms_CreateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(nativeInput.BypassPolicyLockoutSafetyCheck), com_amazonaws_kms_CreateKeyRequest_Tags_ToDafny(nativeInput.Tags), com_amazonaws_kms_CreateKeyRequest_MultiRegion_ToDafny(nativeInput.MultiRegion), com_amazonaws_kms_CreateKeyRequest_XksKeyId_ToDafny(nativeInput.XksKeyId)) + }() + +} + +func CreateKeyOutput_ToDafny(nativeOutput kms.CreateKeyOutput) ComAmazonawsKmsTypes.CreateKeyResponse { + + return func() ComAmazonawsKmsTypes.CreateKeyResponse { + + return ComAmazonawsKmsTypes.Companion_CreateKeyResponse_.Create_CreateKeyResponse_(com_amazonaws_kms_CreateKeyResponse_KeyMetadata_ToDafny(nativeOutput.KeyMetadata)) + }() + +} + +func DecryptInput_ToDafny(nativeInput kms.DecryptInput) ComAmazonawsKmsTypes.DecryptRequest { + + return func() ComAmazonawsKmsTypes.DecryptRequest { + + return ComAmazonawsKmsTypes.Companion_DecryptRequest_.Create_DecryptRequest_(com_amazonaws_kms_DecryptRequest_CiphertextBlob_ToDafny(nativeInput.CiphertextBlob), com_amazonaws_kms_DecryptRequest_EncryptionContext_ToDafny(nativeInput.EncryptionContext), com_amazonaws_kms_DecryptRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_DecryptRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_DecryptRequest_EncryptionAlgorithm_ToDafny(nativeInput.EncryptionAlgorithm), com_amazonaws_kms_DecryptRequest_Recipient_ToDafny(nativeInput.Recipient), com_amazonaws_kms_DecryptRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func DecryptOutput_ToDafny(nativeOutput kms.DecryptOutput) ComAmazonawsKmsTypes.DecryptResponse { + + return func() ComAmazonawsKmsTypes.DecryptResponse { + + return ComAmazonawsKmsTypes.Companion_DecryptResponse_.Create_DecryptResponse_(com_amazonaws_kms_DecryptResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_DecryptResponse_Plaintext_ToDafny(nativeOutput.Plaintext), com_amazonaws_kms_DecryptResponse_EncryptionAlgorithm_ToDafny(nativeOutput.EncryptionAlgorithm), com_amazonaws_kms_DecryptResponse_CiphertextForRecipient_ToDafny(nativeOutput.CiphertextForRecipient)) + }() + +} + +func DeleteAliasInput_ToDafny(nativeInput kms.DeleteAliasInput) ComAmazonawsKmsTypes.DeleteAliasRequest { + + return func() ComAmazonawsKmsTypes.DeleteAliasRequest { + + return ComAmazonawsKmsTypes.Companion_DeleteAliasRequest_.Create_DeleteAliasRequest_(com_amazonaws_kms_DeleteAliasRequest_AliasName_ToDafny(nativeInput.AliasName)) + }() + +} + +func DeleteCustomKeyStoreInput_ToDafny(nativeInput kms.DeleteCustomKeyStoreInput) ComAmazonawsKmsTypes.DeleteCustomKeyStoreRequest { + + return func() ComAmazonawsKmsTypes.DeleteCustomKeyStoreRequest { + + return ComAmazonawsKmsTypes.Companion_DeleteCustomKeyStoreRequest_.Create_DeleteCustomKeyStoreRequest_(com_amazonaws_kms_DeleteCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(nativeInput.CustomKeyStoreId)) + }() + +} + +func DeleteCustomKeyStoreOutput_ToDafny(nativeOutput kms.DeleteCustomKeyStoreOutput) ComAmazonawsKmsTypes.DeleteCustomKeyStoreResponse { + + return func() ComAmazonawsKmsTypes.DeleteCustomKeyStoreResponse { + + return ComAmazonawsKmsTypes.Companion_DeleteCustomKeyStoreResponse_.Create_DeleteCustomKeyStoreResponse_() + }() + +} + +func DeleteImportedKeyMaterialInput_ToDafny(nativeInput kms.DeleteImportedKeyMaterialInput) ComAmazonawsKmsTypes.DeleteImportedKeyMaterialRequest { + + return func() ComAmazonawsKmsTypes.DeleteImportedKeyMaterialRequest { + + return ComAmazonawsKmsTypes.Companion_DeleteImportedKeyMaterialRequest_.Create_DeleteImportedKeyMaterialRequest_(com_amazonaws_kms_DeleteImportedKeyMaterialRequest_KeyId_ToDafny(nativeInput.KeyId)) + }() + +} + +func DeriveSharedSecretInput_ToDafny(nativeInput kms.DeriveSharedSecretInput) ComAmazonawsKmsTypes.DeriveSharedSecretRequest { + + return func() ComAmazonawsKmsTypes.DeriveSharedSecretRequest { + + return ComAmazonawsKmsTypes.Companion_DeriveSharedSecretRequest_.Create_DeriveSharedSecretRequest_(com_amazonaws_kms_DeriveSharedSecretRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_DeriveSharedSecretRequest_KeyAgreementAlgorithm_ToDafny(nativeInput.KeyAgreementAlgorithm), com_amazonaws_kms_DeriveSharedSecretRequest_PublicKey_ToDafny(nativeInput.PublicKey), com_amazonaws_kms_DeriveSharedSecretRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_DeriveSharedSecretRequest_DryRun_ToDafny(nativeInput.DryRun), com_amazonaws_kms_DeriveSharedSecretRequest_Recipient_ToDafny(nativeInput.Recipient)) + }() + +} + +func DeriveSharedSecretOutput_ToDafny(nativeOutput kms.DeriveSharedSecretOutput) ComAmazonawsKmsTypes.DeriveSharedSecretResponse { + + return func() ComAmazonawsKmsTypes.DeriveSharedSecretResponse { + + return ComAmazonawsKmsTypes.Companion_DeriveSharedSecretResponse_.Create_DeriveSharedSecretResponse_(com_amazonaws_kms_DeriveSharedSecretResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_DeriveSharedSecretResponse_SharedSecret_ToDafny(nativeOutput.SharedSecret), com_amazonaws_kms_DeriveSharedSecretResponse_CiphertextForRecipient_ToDafny(nativeOutput.CiphertextForRecipient), com_amazonaws_kms_DeriveSharedSecretResponse_KeyAgreementAlgorithm_ToDafny(nativeOutput.KeyAgreementAlgorithm), com_amazonaws_kms_DeriveSharedSecretResponse_KeyOrigin_ToDafny(nativeOutput.KeyOrigin)) + }() + +} + +func DescribeCustomKeyStoresInput_ToDafny(nativeInput kms.DescribeCustomKeyStoresInput) ComAmazonawsKmsTypes.DescribeCustomKeyStoresRequest { + + return func() ComAmazonawsKmsTypes.DescribeCustomKeyStoresRequest { + + return ComAmazonawsKmsTypes.Companion_DescribeCustomKeyStoresRequest_.Create_DescribeCustomKeyStoresRequest_(com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreId_ToDafny(nativeInput.CustomKeyStoreId), com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreName_ToDafny(nativeInput.CustomKeyStoreName), com_amazonaws_kms_DescribeCustomKeyStoresRequest_Limit_ToDafny(nativeInput.Limit), com_amazonaws_kms_DescribeCustomKeyStoresRequest_Marker_ToDafny(nativeInput.Marker)) + }() + +} + +func DescribeCustomKeyStoresOutput_ToDafny(nativeOutput kms.DescribeCustomKeyStoresOutput) ComAmazonawsKmsTypes.DescribeCustomKeyStoresResponse { + + return func() ComAmazonawsKmsTypes.DescribeCustomKeyStoresResponse { + + return ComAmazonawsKmsTypes.Companion_DescribeCustomKeyStoresResponse_.Create_DescribeCustomKeyStoresResponse_(com_amazonaws_kms_DescribeCustomKeyStoresResponse_CustomKeyStores_ToDafny(nativeOutput.CustomKeyStores), com_amazonaws_kms_DescribeCustomKeyStoresResponse_NextMarker_ToDafny(nativeOutput.NextMarker), com_amazonaws_kms_DescribeCustomKeyStoresResponse_Truncated_ToDafny(nativeOutput.Truncated)) + }() + +} + +func DescribeKeyInput_ToDafny(nativeInput kms.DescribeKeyInput) ComAmazonawsKmsTypes.DescribeKeyRequest { + + return func() ComAmazonawsKmsTypes.DescribeKeyRequest { + + return ComAmazonawsKmsTypes.Companion_DescribeKeyRequest_.Create_DescribeKeyRequest_(com_amazonaws_kms_DescribeKeyRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_DescribeKeyRequest_GrantTokens_ToDafny(nativeInput.GrantTokens)) + }() + +} + +func DescribeKeyOutput_ToDafny(nativeOutput kms.DescribeKeyOutput) ComAmazonawsKmsTypes.DescribeKeyResponse { + + return func() ComAmazonawsKmsTypes.DescribeKeyResponse { + + return ComAmazonawsKmsTypes.Companion_DescribeKeyResponse_.Create_DescribeKeyResponse_(com_amazonaws_kms_DescribeKeyResponse_KeyMetadata_ToDafny(nativeOutput.KeyMetadata)) + }() + +} + +func DisableKeyInput_ToDafny(nativeInput kms.DisableKeyInput) ComAmazonawsKmsTypes.DisableKeyRequest { + + return func() ComAmazonawsKmsTypes.DisableKeyRequest { + + return ComAmazonawsKmsTypes.Companion_DisableKeyRequest_.Create_DisableKeyRequest_(com_amazonaws_kms_DisableKeyRequest_KeyId_ToDafny(nativeInput.KeyId)) + }() + +} + +func DisableKeyRotationInput_ToDafny(nativeInput kms.DisableKeyRotationInput) ComAmazonawsKmsTypes.DisableKeyRotationRequest { + + return func() ComAmazonawsKmsTypes.DisableKeyRotationRequest { + + return ComAmazonawsKmsTypes.Companion_DisableKeyRotationRequest_.Create_DisableKeyRotationRequest_(com_amazonaws_kms_DisableKeyRotationRequest_KeyId_ToDafny(nativeInput.KeyId)) + }() + +} + +func DisconnectCustomKeyStoreInput_ToDafny(nativeInput kms.DisconnectCustomKeyStoreInput) ComAmazonawsKmsTypes.DisconnectCustomKeyStoreRequest { + + return func() ComAmazonawsKmsTypes.DisconnectCustomKeyStoreRequest { + + return ComAmazonawsKmsTypes.Companion_DisconnectCustomKeyStoreRequest_.Create_DisconnectCustomKeyStoreRequest_(com_amazonaws_kms_DisconnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(nativeInput.CustomKeyStoreId)) + }() + +} + +func DisconnectCustomKeyStoreOutput_ToDafny(nativeOutput kms.DisconnectCustomKeyStoreOutput) ComAmazonawsKmsTypes.DisconnectCustomKeyStoreResponse { + + return func() ComAmazonawsKmsTypes.DisconnectCustomKeyStoreResponse { + + return ComAmazonawsKmsTypes.Companion_DisconnectCustomKeyStoreResponse_.Create_DisconnectCustomKeyStoreResponse_() + }() + +} + +func EnableKeyInput_ToDafny(nativeInput kms.EnableKeyInput) ComAmazonawsKmsTypes.EnableKeyRequest { + + return func() ComAmazonawsKmsTypes.EnableKeyRequest { + + return ComAmazonawsKmsTypes.Companion_EnableKeyRequest_.Create_EnableKeyRequest_(com_amazonaws_kms_EnableKeyRequest_KeyId_ToDafny(nativeInput.KeyId)) + }() + +} + +func EnableKeyRotationInput_ToDafny(nativeInput kms.EnableKeyRotationInput) ComAmazonawsKmsTypes.EnableKeyRotationRequest { + + return func() ComAmazonawsKmsTypes.EnableKeyRotationRequest { + + return ComAmazonawsKmsTypes.Companion_EnableKeyRotationRequest_.Create_EnableKeyRotationRequest_(com_amazonaws_kms_EnableKeyRotationRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_EnableKeyRotationRequest_RotationPeriodInDays_ToDafny(nativeInput.RotationPeriodInDays)) + }() + +} + +func EncryptInput_ToDafny(nativeInput kms.EncryptInput) ComAmazonawsKmsTypes.EncryptRequest { + + return func() ComAmazonawsKmsTypes.EncryptRequest { + + return ComAmazonawsKmsTypes.Companion_EncryptRequest_.Create_EncryptRequest_(com_amazonaws_kms_EncryptRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_EncryptRequest_Plaintext_ToDafny(nativeInput.Plaintext), com_amazonaws_kms_EncryptRequest_EncryptionContext_ToDafny(nativeInput.EncryptionContext), com_amazonaws_kms_EncryptRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_EncryptRequest_EncryptionAlgorithm_ToDafny(nativeInput.EncryptionAlgorithm), com_amazonaws_kms_EncryptRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func EncryptOutput_ToDafny(nativeOutput kms.EncryptOutput) ComAmazonawsKmsTypes.EncryptResponse { + + return func() ComAmazonawsKmsTypes.EncryptResponse { + + return ComAmazonawsKmsTypes.Companion_EncryptResponse_.Create_EncryptResponse_(com_amazonaws_kms_EncryptResponse_CiphertextBlob_ToDafny(nativeOutput.CiphertextBlob), com_amazonaws_kms_EncryptResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_EncryptResponse_EncryptionAlgorithm_ToDafny(nativeOutput.EncryptionAlgorithm)) + }() + +} + +func GenerateDataKeyInput_ToDafny(nativeInput kms.GenerateDataKeyInput) ComAmazonawsKmsTypes.GenerateDataKeyRequest { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyRequest { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyRequest_.Create_GenerateDataKeyRequest_(com_amazonaws_kms_GenerateDataKeyRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GenerateDataKeyRequest_EncryptionContext_ToDafny(nativeInput.EncryptionContext), com_amazonaws_kms_GenerateDataKeyRequest_NumberOfBytes_ToDafny(nativeInput.NumberOfBytes), com_amazonaws_kms_GenerateDataKeyRequest_KeySpec_ToDafny(nativeInput.KeySpec), com_amazonaws_kms_GenerateDataKeyRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_GenerateDataKeyRequest_Recipient_ToDafny(nativeInput.Recipient), com_amazonaws_kms_GenerateDataKeyRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func GenerateDataKeyOutput_ToDafny(nativeOutput kms.GenerateDataKeyOutput) ComAmazonawsKmsTypes.GenerateDataKeyResponse { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyResponse { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyResponse_.Create_GenerateDataKeyResponse_(com_amazonaws_kms_GenerateDataKeyResponse_CiphertextBlob_ToDafny(nativeOutput.CiphertextBlob), com_amazonaws_kms_GenerateDataKeyResponse_Plaintext_ToDafny(nativeOutput.Plaintext), com_amazonaws_kms_GenerateDataKeyResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_GenerateDataKeyResponse_CiphertextForRecipient_ToDafny(nativeOutput.CiphertextForRecipient)) + }() + +} + +func GenerateDataKeyPairInput_ToDafny(nativeInput kms.GenerateDataKeyPairInput) ComAmazonawsKmsTypes.GenerateDataKeyPairRequest { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyPairRequest { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyPairRequest_.Create_GenerateDataKeyPairRequest_(com_amazonaws_kms_GenerateDataKeyPairRequest_EncryptionContext_ToDafny(nativeInput.EncryptionContext), com_amazonaws_kms_GenerateDataKeyPairRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GenerateDataKeyPairRequest_KeyPairSpec_ToDafny(nativeInput.KeyPairSpec), com_amazonaws_kms_GenerateDataKeyPairRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_GenerateDataKeyPairRequest_Recipient_ToDafny(nativeInput.Recipient), com_amazonaws_kms_GenerateDataKeyPairRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func GenerateDataKeyPairOutput_ToDafny(nativeOutput kms.GenerateDataKeyPairOutput) ComAmazonawsKmsTypes.GenerateDataKeyPairResponse { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyPairResponse { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyPairResponse_.Create_GenerateDataKeyPairResponse_(com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyCiphertextBlob_ToDafny(nativeOutput.PrivateKeyCiphertextBlob), com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyPlaintext_ToDafny(nativeOutput.PrivateKeyPlaintext), com_amazonaws_kms_GenerateDataKeyPairResponse_PublicKey_ToDafny(nativeOutput.PublicKey), com_amazonaws_kms_GenerateDataKeyPairResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_GenerateDataKeyPairResponse_KeyPairSpec_ToDafny(nativeOutput.KeyPairSpec), com_amazonaws_kms_GenerateDataKeyPairResponse_CiphertextForRecipient_ToDafny(nativeOutput.CiphertextForRecipient)) + }() + +} + +func GenerateDataKeyPairWithoutPlaintextInput_ToDafny(nativeInput kms.GenerateDataKeyPairWithoutPlaintextInput) ComAmazonawsKmsTypes.GenerateDataKeyPairWithoutPlaintextRequest { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyPairWithoutPlaintextRequest { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyPairWithoutPlaintextRequest_.Create_GenerateDataKeyPairWithoutPlaintextRequest_(com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_EncryptionContext_ToDafny(nativeInput.EncryptionContext), com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyPairSpec_ToDafny(nativeInput.KeyPairSpec), com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func GenerateDataKeyPairWithoutPlaintextOutput_ToDafny(nativeOutput kms.GenerateDataKeyPairWithoutPlaintextOutput) ComAmazonawsKmsTypes.GenerateDataKeyPairWithoutPlaintextResponse { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyPairWithoutPlaintextResponse { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyPairWithoutPlaintextResponse_.Create_GenerateDataKeyPairWithoutPlaintextResponse_(com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PrivateKeyCiphertextBlob_ToDafny(nativeOutput.PrivateKeyCiphertextBlob), com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PublicKey_ToDafny(nativeOutput.PublicKey), com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyPairSpec_ToDafny(nativeOutput.KeyPairSpec)) + }() + +} + +func GenerateDataKeyWithoutPlaintextInput_ToDafny(nativeInput kms.GenerateDataKeyWithoutPlaintextInput) ComAmazonawsKmsTypes.GenerateDataKeyWithoutPlaintextRequest { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyWithoutPlaintextRequest { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyWithoutPlaintextRequest_.Create_GenerateDataKeyWithoutPlaintextRequest_(com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_EncryptionContext_ToDafny(nativeInput.EncryptionContext), com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeySpec_ToDafny(nativeInput.KeySpec), com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_NumberOfBytes_ToDafny(nativeInput.NumberOfBytes), com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func GenerateDataKeyWithoutPlaintextOutput_ToDafny(nativeOutput kms.GenerateDataKeyWithoutPlaintextOutput) ComAmazonawsKmsTypes.GenerateDataKeyWithoutPlaintextResponse { + + return func() ComAmazonawsKmsTypes.GenerateDataKeyWithoutPlaintextResponse { + + return ComAmazonawsKmsTypes.Companion_GenerateDataKeyWithoutPlaintextResponse_.Create_GenerateDataKeyWithoutPlaintextResponse_(com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_CiphertextBlob_ToDafny(nativeOutput.CiphertextBlob), com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_KeyId_ToDafny(nativeOutput.KeyId)) + }() + +} + +func GenerateMacInput_ToDafny(nativeInput kms.GenerateMacInput) ComAmazonawsKmsTypes.GenerateMacRequest { + + return func() ComAmazonawsKmsTypes.GenerateMacRequest { + + return ComAmazonawsKmsTypes.Companion_GenerateMacRequest_.Create_GenerateMacRequest_(com_amazonaws_kms_GenerateMacRequest_Message_ToDafny(nativeInput.Message), com_amazonaws_kms_GenerateMacRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GenerateMacRequest_MacAlgorithm_ToDafny(nativeInput.MacAlgorithm), com_amazonaws_kms_GenerateMacRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_GenerateMacRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func GenerateMacOutput_ToDafny(nativeOutput kms.GenerateMacOutput) ComAmazonawsKmsTypes.GenerateMacResponse { + + return func() ComAmazonawsKmsTypes.GenerateMacResponse { + + return ComAmazonawsKmsTypes.Companion_GenerateMacResponse_.Create_GenerateMacResponse_(com_amazonaws_kms_GenerateMacResponse_Mac_ToDafny(nativeOutput.Mac), com_amazonaws_kms_GenerateMacResponse_MacAlgorithm_ToDafny(nativeOutput.MacAlgorithm), com_amazonaws_kms_GenerateMacResponse_KeyId_ToDafny(nativeOutput.KeyId)) + }() + +} + +func GenerateRandomInput_ToDafny(nativeInput kms.GenerateRandomInput) ComAmazonawsKmsTypes.GenerateRandomRequest { + + return func() ComAmazonawsKmsTypes.GenerateRandomRequest { + + return ComAmazonawsKmsTypes.Companion_GenerateRandomRequest_.Create_GenerateRandomRequest_(com_amazonaws_kms_GenerateRandomRequest_NumberOfBytes_ToDafny(nativeInput.NumberOfBytes), com_amazonaws_kms_GenerateRandomRequest_CustomKeyStoreId_ToDafny(nativeInput.CustomKeyStoreId), com_amazonaws_kms_GenerateRandomRequest_Recipient_ToDafny(nativeInput.Recipient)) + }() + +} + +func GenerateRandomOutput_ToDafny(nativeOutput kms.GenerateRandomOutput) ComAmazonawsKmsTypes.GenerateRandomResponse { + + return func() ComAmazonawsKmsTypes.GenerateRandomResponse { + + return ComAmazonawsKmsTypes.Companion_GenerateRandomResponse_.Create_GenerateRandomResponse_(com_amazonaws_kms_GenerateRandomResponse_Plaintext_ToDafny(nativeOutput.Plaintext), com_amazonaws_kms_GenerateRandomResponse_CiphertextForRecipient_ToDafny(nativeOutput.CiphertextForRecipient)) + }() + +} + +func GetKeyPolicyInput_ToDafny(nativeInput kms.GetKeyPolicyInput) ComAmazonawsKmsTypes.GetKeyPolicyRequest { + + return func() ComAmazonawsKmsTypes.GetKeyPolicyRequest { + + return ComAmazonawsKmsTypes.Companion_GetKeyPolicyRequest_.Create_GetKeyPolicyRequest_(com_amazonaws_kms_GetKeyPolicyRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GetKeyPolicyRequest_PolicyName_ToDafny(nativeInput.PolicyName)) + }() + +} + +func GetKeyPolicyOutput_ToDafny(nativeOutput kms.GetKeyPolicyOutput) ComAmazonawsKmsTypes.GetKeyPolicyResponse { + + return func() ComAmazonawsKmsTypes.GetKeyPolicyResponse { + + return ComAmazonawsKmsTypes.Companion_GetKeyPolicyResponse_.Create_GetKeyPolicyResponse_(com_amazonaws_kms_GetKeyPolicyResponse_Policy_ToDafny(nativeOutput.Policy), com_amazonaws_kms_GetKeyPolicyResponse_PolicyName_ToDafny(nativeOutput.PolicyName)) + }() + +} + +func GetKeyRotationStatusInput_ToDafny(nativeInput kms.GetKeyRotationStatusInput) ComAmazonawsKmsTypes.GetKeyRotationStatusRequest { + + return func() ComAmazonawsKmsTypes.GetKeyRotationStatusRequest { + + return ComAmazonawsKmsTypes.Companion_GetKeyRotationStatusRequest_.Create_GetKeyRotationStatusRequest_(com_amazonaws_kms_GetKeyRotationStatusRequest_KeyId_ToDafny(nativeInput.KeyId)) + }() + +} + +func GetKeyRotationStatusOutput_ToDafny(nativeOutput kms.GetKeyRotationStatusOutput) ComAmazonawsKmsTypes.GetKeyRotationStatusResponse { + + return func() ComAmazonawsKmsTypes.GetKeyRotationStatusResponse { + + return ComAmazonawsKmsTypes.Companion_GetKeyRotationStatusResponse_.Create_GetKeyRotationStatusResponse_(com_amazonaws_kms_GetKeyRotationStatusResponse_KeyRotationEnabled_ToDafny(nativeOutput.KeyRotationEnabled), com_amazonaws_kms_GetKeyRotationStatusResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_GetKeyRotationStatusResponse_RotationPeriodInDays_ToDafny(nativeOutput.RotationPeriodInDays), com_amazonaws_kms_GetKeyRotationStatusResponse_NextRotationDate_ToDafny(nativeOutput.NextRotationDate), com_amazonaws_kms_GetKeyRotationStatusResponse_OnDemandRotationStartDate_ToDafny(nativeOutput.OnDemandRotationStartDate)) + }() + +} + +func GetParametersForImportInput_ToDafny(nativeInput kms.GetParametersForImportInput) ComAmazonawsKmsTypes.GetParametersForImportRequest { + + return func() ComAmazonawsKmsTypes.GetParametersForImportRequest { + + return ComAmazonawsKmsTypes.Companion_GetParametersForImportRequest_.Create_GetParametersForImportRequest_(com_amazonaws_kms_GetParametersForImportRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GetParametersForImportRequest_WrappingAlgorithm_ToDafny(nativeInput.WrappingAlgorithm), com_amazonaws_kms_GetParametersForImportRequest_WrappingKeySpec_ToDafny(nativeInput.WrappingKeySpec)) + }() + +} + +func GetParametersForImportOutput_ToDafny(nativeOutput kms.GetParametersForImportOutput) ComAmazonawsKmsTypes.GetParametersForImportResponse { + + return func() ComAmazonawsKmsTypes.GetParametersForImportResponse { + + return ComAmazonawsKmsTypes.Companion_GetParametersForImportResponse_.Create_GetParametersForImportResponse_(com_amazonaws_kms_GetParametersForImportResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_GetParametersForImportResponse_ImportToken_ToDafny(nativeOutput.ImportToken), com_amazonaws_kms_GetParametersForImportResponse_PublicKey_ToDafny(nativeOutput.PublicKey), com_amazonaws_kms_GetParametersForImportResponse_ParametersValidTo_ToDafny(nativeOutput.ParametersValidTo)) + }() + +} + +func GetPublicKeyInput_ToDafny(nativeInput kms.GetPublicKeyInput) ComAmazonawsKmsTypes.GetPublicKeyRequest { + + return func() ComAmazonawsKmsTypes.GetPublicKeyRequest { + + return ComAmazonawsKmsTypes.Companion_GetPublicKeyRequest_.Create_GetPublicKeyRequest_(com_amazonaws_kms_GetPublicKeyRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_GetPublicKeyRequest_GrantTokens_ToDafny(nativeInput.GrantTokens)) + }() + +} + +func GetPublicKeyOutput_ToDafny(nativeOutput kms.GetPublicKeyOutput) ComAmazonawsKmsTypes.GetPublicKeyResponse { + + return func() ComAmazonawsKmsTypes.GetPublicKeyResponse { + + return ComAmazonawsKmsTypes.Companion_GetPublicKeyResponse_.Create_GetPublicKeyResponse_(com_amazonaws_kms_GetPublicKeyResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_GetPublicKeyResponse_PublicKey_ToDafny(nativeOutput.PublicKey), com_amazonaws_kms_GetPublicKeyResponse_CustomerMasterKeySpec_ToDafny(nativeOutput.CustomerMasterKeySpec), com_amazonaws_kms_GetPublicKeyResponse_KeySpec_ToDafny(nativeOutput.KeySpec), com_amazonaws_kms_GetPublicKeyResponse_KeyUsage_ToDafny(nativeOutput.KeyUsage), com_amazonaws_kms_GetPublicKeyResponse_EncryptionAlgorithms_ToDafny(nativeOutput.EncryptionAlgorithms), com_amazonaws_kms_GetPublicKeyResponse_SigningAlgorithms_ToDafny(nativeOutput.SigningAlgorithms), com_amazonaws_kms_GetPublicKeyResponse_KeyAgreementAlgorithms_ToDafny(nativeOutput.KeyAgreementAlgorithms)) + }() + +} + +func ImportKeyMaterialInput_ToDafny(nativeInput kms.ImportKeyMaterialInput) ComAmazonawsKmsTypes.ImportKeyMaterialRequest { + + return func() ComAmazonawsKmsTypes.ImportKeyMaterialRequest { + + return ComAmazonawsKmsTypes.Companion_ImportKeyMaterialRequest_.Create_ImportKeyMaterialRequest_(com_amazonaws_kms_ImportKeyMaterialRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ImportKeyMaterialRequest_ImportToken_ToDafny(nativeInput.ImportToken), com_amazonaws_kms_ImportKeyMaterialRequest_EncryptedKeyMaterial_ToDafny(nativeInput.EncryptedKeyMaterial), com_amazonaws_kms_ImportKeyMaterialRequest_ValidTo_ToDafny(nativeInput.ValidTo), com_amazonaws_kms_ImportKeyMaterialRequest_ExpirationModel_ToDafny(nativeInput.ExpirationModel)) + }() + +} + +func ImportKeyMaterialOutput_ToDafny(nativeOutput kms.ImportKeyMaterialOutput) ComAmazonawsKmsTypes.ImportKeyMaterialResponse { + + return func() ComAmazonawsKmsTypes.ImportKeyMaterialResponse { + + return ComAmazonawsKmsTypes.Companion_ImportKeyMaterialResponse_.Create_ImportKeyMaterialResponse_() + }() + +} + +func ListAliasesInput_ToDafny(nativeInput kms.ListAliasesInput) ComAmazonawsKmsTypes.ListAliasesRequest { + + return func() ComAmazonawsKmsTypes.ListAliasesRequest { + + return ComAmazonawsKmsTypes.Companion_ListAliasesRequest_.Create_ListAliasesRequest_(com_amazonaws_kms_ListAliasesRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ListAliasesRequest_Limit_ToDafny(nativeInput.Limit), com_amazonaws_kms_ListAliasesRequest_Marker_ToDafny(nativeInput.Marker)) + }() + +} + +func ListAliasesOutput_ToDafny(nativeOutput kms.ListAliasesOutput) ComAmazonawsKmsTypes.ListAliasesResponse { + + return func() ComAmazonawsKmsTypes.ListAliasesResponse { + + return ComAmazonawsKmsTypes.Companion_ListAliasesResponse_.Create_ListAliasesResponse_(com_amazonaws_kms_ListAliasesResponse_Aliases_ToDafny(nativeOutput.Aliases), com_amazonaws_kms_ListAliasesResponse_NextMarker_ToDafny(nativeOutput.NextMarker), com_amazonaws_kms_ListAliasesResponse_Truncated_ToDafny(nativeOutput.Truncated)) + }() + +} + +func ListGrantsInput_ToDafny(nativeInput kms.ListGrantsInput) ComAmazonawsKmsTypes.ListGrantsRequest { + + return func() ComAmazonawsKmsTypes.ListGrantsRequest { + + return ComAmazonawsKmsTypes.Companion_ListGrantsRequest_.Create_ListGrantsRequest_(com_amazonaws_kms_ListGrantsRequest_Limit_ToDafny(nativeInput.Limit), com_amazonaws_kms_ListGrantsRequest_Marker_ToDafny(nativeInput.Marker), com_amazonaws_kms_ListGrantsRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ListGrantsRequest_GrantId_ToDafny(nativeInput.GrantId), com_amazonaws_kms_ListGrantsRequest_GranteePrincipal_ToDafny(nativeInput.GranteePrincipal)) + }() + +} + +func ListGrantsOutput_ToDafny(nativeOutput kms.ListGrantsOutput) ComAmazonawsKmsTypes.ListGrantsResponse { + + return func() ComAmazonawsKmsTypes.ListGrantsResponse { + + return ComAmazonawsKmsTypes.Companion_ListGrantsResponse_.Create_ListGrantsResponse_(com_amazonaws_kms_ListGrantsResponse_Grants_ToDafny(nativeOutput.Grants), com_amazonaws_kms_ListGrantsResponse_NextMarker_ToDafny(nativeOutput.NextMarker), com_amazonaws_kms_ListGrantsResponse_Truncated_ToDafny(nativeOutput.Truncated)) + }() + +} + +func ListKeyPoliciesInput_ToDafny(nativeInput kms.ListKeyPoliciesInput) ComAmazonawsKmsTypes.ListKeyPoliciesRequest { + + return func() ComAmazonawsKmsTypes.ListKeyPoliciesRequest { + + return ComAmazonawsKmsTypes.Companion_ListKeyPoliciesRequest_.Create_ListKeyPoliciesRequest_(com_amazonaws_kms_ListKeyPoliciesRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ListKeyPoliciesRequest_Limit_ToDafny(nativeInput.Limit), com_amazonaws_kms_ListKeyPoliciesRequest_Marker_ToDafny(nativeInput.Marker)) + }() + +} + +func ListKeyPoliciesOutput_ToDafny(nativeOutput kms.ListKeyPoliciesOutput) ComAmazonawsKmsTypes.ListKeyPoliciesResponse { + + return func() ComAmazonawsKmsTypes.ListKeyPoliciesResponse { + + return ComAmazonawsKmsTypes.Companion_ListKeyPoliciesResponse_.Create_ListKeyPoliciesResponse_(com_amazonaws_kms_ListKeyPoliciesResponse_PolicyNames_ToDafny(nativeOutput.PolicyNames), com_amazonaws_kms_ListKeyPoliciesResponse_NextMarker_ToDafny(nativeOutput.NextMarker), com_amazonaws_kms_ListKeyPoliciesResponse_Truncated_ToDafny(nativeOutput.Truncated)) + }() + +} + +func ListKeyRotationsInput_ToDafny(nativeInput kms.ListKeyRotationsInput) ComAmazonawsKmsTypes.ListKeyRotationsRequest { + + return func() ComAmazonawsKmsTypes.ListKeyRotationsRequest { + + return ComAmazonawsKmsTypes.Companion_ListKeyRotationsRequest_.Create_ListKeyRotationsRequest_(com_amazonaws_kms_ListKeyRotationsRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ListKeyRotationsRequest_Limit_ToDafny(nativeInput.Limit), com_amazonaws_kms_ListKeyRotationsRequest_Marker_ToDafny(nativeInput.Marker)) + }() + +} + +func ListKeyRotationsOutput_ToDafny(nativeOutput kms.ListKeyRotationsOutput) ComAmazonawsKmsTypes.ListKeyRotationsResponse { + + return func() ComAmazonawsKmsTypes.ListKeyRotationsResponse { + + return ComAmazonawsKmsTypes.Companion_ListKeyRotationsResponse_.Create_ListKeyRotationsResponse_(com_amazonaws_kms_ListKeyRotationsResponse_Rotations_ToDafny(nativeOutput.Rotations), com_amazonaws_kms_ListKeyRotationsResponse_NextMarker_ToDafny(nativeOutput.NextMarker), com_amazonaws_kms_ListKeyRotationsResponse_Truncated_ToDafny(nativeOutput.Truncated)) + }() + +} + +func ListKeysInput_ToDafny(nativeInput kms.ListKeysInput) ComAmazonawsKmsTypes.ListKeysRequest { + + return func() ComAmazonawsKmsTypes.ListKeysRequest { + + return ComAmazonawsKmsTypes.Companion_ListKeysRequest_.Create_ListKeysRequest_(com_amazonaws_kms_ListKeysRequest_Limit_ToDafny(nativeInput.Limit), com_amazonaws_kms_ListKeysRequest_Marker_ToDafny(nativeInput.Marker)) + }() + +} + +func ListKeysOutput_ToDafny(nativeOutput kms.ListKeysOutput) ComAmazonawsKmsTypes.ListKeysResponse { + + return func() ComAmazonawsKmsTypes.ListKeysResponse { + + return ComAmazonawsKmsTypes.Companion_ListKeysResponse_.Create_ListKeysResponse_(com_amazonaws_kms_ListKeysResponse_Keys_ToDafny(nativeOutput.Keys), com_amazonaws_kms_ListKeysResponse_NextMarker_ToDafny(nativeOutput.NextMarker), com_amazonaws_kms_ListKeysResponse_Truncated_ToDafny(nativeOutput.Truncated)) + }() + +} + +func ListResourceTagsInput_ToDafny(nativeInput kms.ListResourceTagsInput) ComAmazonawsKmsTypes.ListResourceTagsRequest { + + return func() ComAmazonawsKmsTypes.ListResourceTagsRequest { + + return ComAmazonawsKmsTypes.Companion_ListResourceTagsRequest_.Create_ListResourceTagsRequest_(com_amazonaws_kms_ListResourceTagsRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ListResourceTagsRequest_Limit_ToDafny(nativeInput.Limit), com_amazonaws_kms_ListResourceTagsRequest_Marker_ToDafny(nativeInput.Marker)) + }() + +} + +func ListResourceTagsOutput_ToDafny(nativeOutput kms.ListResourceTagsOutput) ComAmazonawsKmsTypes.ListResourceTagsResponse { + + return func() ComAmazonawsKmsTypes.ListResourceTagsResponse { + + return ComAmazonawsKmsTypes.Companion_ListResourceTagsResponse_.Create_ListResourceTagsResponse_(com_amazonaws_kms_ListResourceTagsResponse_Tags_ToDafny(nativeOutput.Tags), com_amazonaws_kms_ListResourceTagsResponse_NextMarker_ToDafny(nativeOutput.NextMarker), com_amazonaws_kms_ListResourceTagsResponse_Truncated_ToDafny(nativeOutput.Truncated)) + }() + +} + +func PutKeyPolicyInput_ToDafny(nativeInput kms.PutKeyPolicyInput) ComAmazonawsKmsTypes.PutKeyPolicyRequest { + + return func() ComAmazonawsKmsTypes.PutKeyPolicyRequest { + + return ComAmazonawsKmsTypes.Companion_PutKeyPolicyRequest_.Create_PutKeyPolicyRequest_(com_amazonaws_kms_PutKeyPolicyRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_PutKeyPolicyRequest_PolicyName_ToDafny(nativeInput.PolicyName), com_amazonaws_kms_PutKeyPolicyRequest_Policy_ToDafny(nativeInput.Policy), com_amazonaws_kms_PutKeyPolicyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(nativeInput.BypassPolicyLockoutSafetyCheck)) + }() + +} + +func ReEncryptInput_ToDafny(nativeInput kms.ReEncryptInput) ComAmazonawsKmsTypes.ReEncryptRequest { + + return func() ComAmazonawsKmsTypes.ReEncryptRequest { + + return ComAmazonawsKmsTypes.Companion_ReEncryptRequest_.Create_ReEncryptRequest_(com_amazonaws_kms_ReEncryptRequest_CiphertextBlob_ToDafny(nativeInput.CiphertextBlob), com_amazonaws_kms_ReEncryptRequest_SourceEncryptionContext_ToDafny(nativeInput.SourceEncryptionContext), com_amazonaws_kms_ReEncryptRequest_SourceKeyId_ToDafny(nativeInput.SourceKeyId), com_amazonaws_kms_ReEncryptRequest_DestinationKeyId_ToDafny(nativeInput.DestinationKeyId), com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionContext_ToDafny(nativeInput.DestinationEncryptionContext), com_amazonaws_kms_ReEncryptRequest_SourceEncryptionAlgorithm_ToDafny(nativeInput.SourceEncryptionAlgorithm), com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionAlgorithm_ToDafny(nativeInput.DestinationEncryptionAlgorithm), com_amazonaws_kms_ReEncryptRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_ReEncryptRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func ReEncryptOutput_ToDafny(nativeOutput kms.ReEncryptOutput) ComAmazonawsKmsTypes.ReEncryptResponse { + + return func() ComAmazonawsKmsTypes.ReEncryptResponse { + + return ComAmazonawsKmsTypes.Companion_ReEncryptResponse_.Create_ReEncryptResponse_(com_amazonaws_kms_ReEncryptResponse_CiphertextBlob_ToDafny(nativeOutput.CiphertextBlob), com_amazonaws_kms_ReEncryptResponse_SourceKeyId_ToDafny(nativeOutput.SourceKeyId), com_amazonaws_kms_ReEncryptResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_ReEncryptResponse_SourceEncryptionAlgorithm_ToDafny(nativeOutput.SourceEncryptionAlgorithm), com_amazonaws_kms_ReEncryptResponse_DestinationEncryptionAlgorithm_ToDafny(nativeOutput.DestinationEncryptionAlgorithm)) + }() + +} + +func ReplicateKeyInput_ToDafny(nativeInput kms.ReplicateKeyInput) ComAmazonawsKmsTypes.ReplicateKeyRequest { + + return func() ComAmazonawsKmsTypes.ReplicateKeyRequest { + + return ComAmazonawsKmsTypes.Companion_ReplicateKeyRequest_.Create_ReplicateKeyRequest_(com_amazonaws_kms_ReplicateKeyRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ReplicateKeyRequest_ReplicaRegion_ToDafny(nativeInput.ReplicaRegion), com_amazonaws_kms_ReplicateKeyRequest_Policy_ToDafny(nativeInput.Policy), com_amazonaws_kms_ReplicateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(nativeInput.BypassPolicyLockoutSafetyCheck), com_amazonaws_kms_ReplicateKeyRequest_Description_ToDafny(nativeInput.Description), com_amazonaws_kms_ReplicateKeyRequest_Tags_ToDafny(nativeInput.Tags)) + }() + +} + +func ReplicateKeyOutput_ToDafny(nativeOutput kms.ReplicateKeyOutput) ComAmazonawsKmsTypes.ReplicateKeyResponse { + + return func() ComAmazonawsKmsTypes.ReplicateKeyResponse { + + return ComAmazonawsKmsTypes.Companion_ReplicateKeyResponse_.Create_ReplicateKeyResponse_(com_amazonaws_kms_ReplicateKeyResponse_ReplicaKeyMetadata_ToDafny(nativeOutput.ReplicaKeyMetadata), com_amazonaws_kms_ReplicateKeyResponse_ReplicaPolicy_ToDafny(nativeOutput.ReplicaPolicy), com_amazonaws_kms_ReplicateKeyResponse_ReplicaTags_ToDafny(nativeOutput.ReplicaTags)) + }() + +} + +func RetireGrantInput_ToDafny(nativeInput kms.RetireGrantInput) ComAmazonawsKmsTypes.RetireGrantRequest { + + return func() ComAmazonawsKmsTypes.RetireGrantRequest { + + return ComAmazonawsKmsTypes.Companion_RetireGrantRequest_.Create_RetireGrantRequest_(com_amazonaws_kms_RetireGrantRequest_GrantToken_ToDafny(nativeInput.GrantToken), com_amazonaws_kms_RetireGrantRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_RetireGrantRequest_GrantId_ToDafny(nativeInput.GrantId), com_amazonaws_kms_RetireGrantRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func RevokeGrantInput_ToDafny(nativeInput kms.RevokeGrantInput) ComAmazonawsKmsTypes.RevokeGrantRequest { + + return func() ComAmazonawsKmsTypes.RevokeGrantRequest { + + return ComAmazonawsKmsTypes.Companion_RevokeGrantRequest_.Create_RevokeGrantRequest_(com_amazonaws_kms_RevokeGrantRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_RevokeGrantRequest_GrantId_ToDafny(nativeInput.GrantId), com_amazonaws_kms_RevokeGrantRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func RotateKeyOnDemandInput_ToDafny(nativeInput kms.RotateKeyOnDemandInput) ComAmazonawsKmsTypes.RotateKeyOnDemandRequest { + + return func() ComAmazonawsKmsTypes.RotateKeyOnDemandRequest { + + return ComAmazonawsKmsTypes.Companion_RotateKeyOnDemandRequest_.Create_RotateKeyOnDemandRequest_(com_amazonaws_kms_RotateKeyOnDemandRequest_KeyId_ToDafny(nativeInput.KeyId)) + }() + +} + +func RotateKeyOnDemandOutput_ToDafny(nativeOutput kms.RotateKeyOnDemandOutput) ComAmazonawsKmsTypes.RotateKeyOnDemandResponse { + + return func() ComAmazonawsKmsTypes.RotateKeyOnDemandResponse { + + return ComAmazonawsKmsTypes.Companion_RotateKeyOnDemandResponse_.Create_RotateKeyOnDemandResponse_(com_amazonaws_kms_RotateKeyOnDemandResponse_KeyId_ToDafny(nativeOutput.KeyId)) + }() + +} + +func ScheduleKeyDeletionInput_ToDafny(nativeInput kms.ScheduleKeyDeletionInput) ComAmazonawsKmsTypes.ScheduleKeyDeletionRequest { + + return func() ComAmazonawsKmsTypes.ScheduleKeyDeletionRequest { + + return ComAmazonawsKmsTypes.Companion_ScheduleKeyDeletionRequest_.Create_ScheduleKeyDeletionRequest_(com_amazonaws_kms_ScheduleKeyDeletionRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_ScheduleKeyDeletionRequest_PendingWindowInDays_ToDafny(nativeInput.PendingWindowInDays)) + }() + +} + +func ScheduleKeyDeletionOutput_ToDafny(nativeOutput kms.ScheduleKeyDeletionOutput) ComAmazonawsKmsTypes.ScheduleKeyDeletionResponse { + + return func() ComAmazonawsKmsTypes.ScheduleKeyDeletionResponse { + + return ComAmazonawsKmsTypes.Companion_ScheduleKeyDeletionResponse_.Create_ScheduleKeyDeletionResponse_(com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_ScheduleKeyDeletionResponse_DeletionDate_ToDafny(nativeOutput.DeletionDate), com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyState_ToDafny(nativeOutput.KeyState), com_amazonaws_kms_ScheduleKeyDeletionResponse_PendingWindowInDays_ToDafny(nativeOutput.PendingWindowInDays)) + }() + +} + +func SignInput_ToDafny(nativeInput kms.SignInput) ComAmazonawsKmsTypes.SignRequest { + + return func() ComAmazonawsKmsTypes.SignRequest { + + return ComAmazonawsKmsTypes.Companion_SignRequest_.Create_SignRequest_(com_amazonaws_kms_SignRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_SignRequest_Message_ToDafny(nativeInput.Message), com_amazonaws_kms_SignRequest_MessageType_ToDafny(nativeInput.MessageType), com_amazonaws_kms_SignRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_SignRequest_SigningAlgorithm_ToDafny(nativeInput.SigningAlgorithm), com_amazonaws_kms_SignRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func SignOutput_ToDafny(nativeOutput kms.SignOutput) ComAmazonawsKmsTypes.SignResponse { + + return func() ComAmazonawsKmsTypes.SignResponse { + + return ComAmazonawsKmsTypes.Companion_SignResponse_.Create_SignResponse_(com_amazonaws_kms_SignResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_SignResponse_Signature_ToDafny(nativeOutput.Signature), com_amazonaws_kms_SignResponse_SigningAlgorithm_ToDafny(nativeOutput.SigningAlgorithm)) + }() + +} + +func TagResourceInput_ToDafny(nativeInput kms.TagResourceInput) ComAmazonawsKmsTypes.TagResourceRequest { + + return func() ComAmazonawsKmsTypes.TagResourceRequest { + + return ComAmazonawsKmsTypes.Companion_TagResourceRequest_.Create_TagResourceRequest_(com_amazonaws_kms_TagResourceRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_TagResourceRequest_Tags_ToDafny(nativeInput.Tags)) + }() + +} + +func UntagResourceInput_ToDafny(nativeInput kms.UntagResourceInput) ComAmazonawsKmsTypes.UntagResourceRequest { + + return func() ComAmazonawsKmsTypes.UntagResourceRequest { + + return ComAmazonawsKmsTypes.Companion_UntagResourceRequest_.Create_UntagResourceRequest_(com_amazonaws_kms_UntagResourceRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_UntagResourceRequest_TagKeys_ToDafny(nativeInput.TagKeys)) + }() + +} + +func UpdateAliasInput_ToDafny(nativeInput kms.UpdateAliasInput) ComAmazonawsKmsTypes.UpdateAliasRequest { + + return func() ComAmazonawsKmsTypes.UpdateAliasRequest { + + return ComAmazonawsKmsTypes.Companion_UpdateAliasRequest_.Create_UpdateAliasRequest_(com_amazonaws_kms_UpdateAliasRequest_AliasName_ToDafny(nativeInput.AliasName), com_amazonaws_kms_UpdateAliasRequest_TargetKeyId_ToDafny(nativeInput.TargetKeyId)) + }() + +} + +func UpdateCustomKeyStoreInput_ToDafny(nativeInput kms.UpdateCustomKeyStoreInput) ComAmazonawsKmsTypes.UpdateCustomKeyStoreRequest { + + return func() ComAmazonawsKmsTypes.UpdateCustomKeyStoreRequest { + + return ComAmazonawsKmsTypes.Companion_UpdateCustomKeyStoreRequest_.Create_UpdateCustomKeyStoreRequest_(com_amazonaws_kms_UpdateCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(nativeInput.CustomKeyStoreId), com_amazonaws_kms_UpdateCustomKeyStoreRequest_NewCustomKeyStoreName_ToDafny(nativeInput.NewCustomKeyStoreName), com_amazonaws_kms_UpdateCustomKeyStoreRequest_KeyStorePassword_ToDafny(nativeInput.KeyStorePassword), com_amazonaws_kms_UpdateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(nativeInput.CloudHsmClusterId), com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(nativeInput.XksProxyUriEndpoint), com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(nativeInput.XksProxyUriPath), com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(nativeInput.XksProxyVpcEndpointServiceName), com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(nativeInput.XksProxyAuthenticationCredential), com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(nativeInput.XksProxyConnectivity)) + }() + +} + +func UpdateCustomKeyStoreOutput_ToDafny(nativeOutput kms.UpdateCustomKeyStoreOutput) ComAmazonawsKmsTypes.UpdateCustomKeyStoreResponse { + + return func() ComAmazonawsKmsTypes.UpdateCustomKeyStoreResponse { + + return ComAmazonawsKmsTypes.Companion_UpdateCustomKeyStoreResponse_.Create_UpdateCustomKeyStoreResponse_() + }() + +} + +func UpdateKeyDescriptionInput_ToDafny(nativeInput kms.UpdateKeyDescriptionInput) ComAmazonawsKmsTypes.UpdateKeyDescriptionRequest { + + return func() ComAmazonawsKmsTypes.UpdateKeyDescriptionRequest { + + return ComAmazonawsKmsTypes.Companion_UpdateKeyDescriptionRequest_.Create_UpdateKeyDescriptionRequest_(com_amazonaws_kms_UpdateKeyDescriptionRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_UpdateKeyDescriptionRequest_Description_ToDafny(nativeInput.Description)) + }() + +} + +func UpdatePrimaryRegionInput_ToDafny(nativeInput kms.UpdatePrimaryRegionInput) ComAmazonawsKmsTypes.UpdatePrimaryRegionRequest { + + return func() ComAmazonawsKmsTypes.UpdatePrimaryRegionRequest { + + return ComAmazonawsKmsTypes.Companion_UpdatePrimaryRegionRequest_.Create_UpdatePrimaryRegionRequest_(com_amazonaws_kms_UpdatePrimaryRegionRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_UpdatePrimaryRegionRequest_PrimaryRegion_ToDafny(nativeInput.PrimaryRegion)) + }() + +} + +func VerifyInput_ToDafny(nativeInput kms.VerifyInput) ComAmazonawsKmsTypes.VerifyRequest { + + return func() ComAmazonawsKmsTypes.VerifyRequest { + + return ComAmazonawsKmsTypes.Companion_VerifyRequest_.Create_VerifyRequest_(com_amazonaws_kms_VerifyRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_VerifyRequest_Message_ToDafny(nativeInput.Message), com_amazonaws_kms_VerifyRequest_MessageType_ToDafny(nativeInput.MessageType), com_amazonaws_kms_VerifyRequest_Signature_ToDafny(nativeInput.Signature), com_amazonaws_kms_VerifyRequest_SigningAlgorithm_ToDafny(nativeInput.SigningAlgorithm), com_amazonaws_kms_VerifyRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_VerifyRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func VerifyOutput_ToDafny(nativeOutput kms.VerifyOutput) ComAmazonawsKmsTypes.VerifyResponse { + + return func() ComAmazonawsKmsTypes.VerifyResponse { + + return ComAmazonawsKmsTypes.Companion_VerifyResponse_.Create_VerifyResponse_(com_amazonaws_kms_VerifyResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_VerifyResponse_SignatureValid_ToDafny(nativeOutput.SignatureValid), com_amazonaws_kms_VerifyResponse_SigningAlgorithm_ToDafny(nativeOutput.SigningAlgorithm)) + }() + +} + +func VerifyMacInput_ToDafny(nativeInput kms.VerifyMacInput) ComAmazonawsKmsTypes.VerifyMacRequest { + + return func() ComAmazonawsKmsTypes.VerifyMacRequest { + + return ComAmazonawsKmsTypes.Companion_VerifyMacRequest_.Create_VerifyMacRequest_(com_amazonaws_kms_VerifyMacRequest_Message_ToDafny(nativeInput.Message), com_amazonaws_kms_VerifyMacRequest_KeyId_ToDafny(nativeInput.KeyId), com_amazonaws_kms_VerifyMacRequest_MacAlgorithm_ToDafny(nativeInput.MacAlgorithm), com_amazonaws_kms_VerifyMacRequest_Mac_ToDafny(nativeInput.Mac), com_amazonaws_kms_VerifyMacRequest_GrantTokens_ToDafny(nativeInput.GrantTokens), com_amazonaws_kms_VerifyMacRequest_DryRun_ToDafny(nativeInput.DryRun)) + }() + +} + +func VerifyMacOutput_ToDafny(nativeOutput kms.VerifyMacOutput) ComAmazonawsKmsTypes.VerifyMacResponse { + + return func() ComAmazonawsKmsTypes.VerifyMacResponse { + + return ComAmazonawsKmsTypes.Companion_VerifyMacResponse_.Create_VerifyMacResponse_(com_amazonaws_kms_VerifyMacResponse_KeyId_ToDafny(nativeOutput.KeyId), com_amazonaws_kms_VerifyMacResponse_MacValid_ToDafny(nativeOutput.MacValid), com_amazonaws_kms_VerifyMacResponse_MacAlgorithm_ToDafny(nativeOutput.MacAlgorithm)) + }() + +} + +func AlreadyExistsException_ToDafny(nativeInput types.AlreadyExistsException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_AlreadyExistsException_(com_amazonaws_kms_AlreadyExistsException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CloudHsmClusterInUseException_ToDafny(nativeInput types.CloudHsmClusterInUseException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterInUseException_(com_amazonaws_kms_CloudHsmClusterInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CloudHsmClusterInvalidConfigurationException_ToDafny(nativeInput types.CloudHsmClusterInvalidConfigurationException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterInvalidConfigurationException_(com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CloudHsmClusterNotActiveException_ToDafny(nativeInput types.CloudHsmClusterNotActiveException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotActiveException_(com_amazonaws_kms_CloudHsmClusterNotActiveException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CloudHsmClusterNotFoundException_ToDafny(nativeInput types.CloudHsmClusterNotFoundException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotFoundException_(com_amazonaws_kms_CloudHsmClusterNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CloudHsmClusterNotRelatedException_ToDafny(nativeInput types.CloudHsmClusterNotRelatedException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CloudHsmClusterNotRelatedException_(com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ConflictException_ToDafny(nativeInput types.ConflictException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_ConflictException_(com_amazonaws_kms_ConflictException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CustomKeyStoreHasCMKsException_ToDafny(nativeInput types.CustomKeyStoreHasCMKsException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreHasCMKsException_(com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CustomKeyStoreInvalidStateException_ToDafny(nativeInput types.CustomKeyStoreInvalidStateException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreInvalidStateException_(com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CustomKeyStoreNameInUseException_ToDafny(nativeInput types.CustomKeyStoreNameInUseException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreNameInUseException_(com_amazonaws_kms_CustomKeyStoreNameInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func CustomKeyStoreNotFoundException_ToDafny(nativeInput types.CustomKeyStoreNotFoundException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_CustomKeyStoreNotFoundException_(com_amazonaws_kms_CustomKeyStoreNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func DependencyTimeoutException_ToDafny(nativeInput types.DependencyTimeoutException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_DependencyTimeoutException_(com_amazonaws_kms_DependencyTimeoutException_message_ToDafny(nativeInput.Message)) + }() + +} + +func DisabledException_ToDafny(nativeInput types.DisabledException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_DisabledException_(com_amazonaws_kms_DisabledException_message_ToDafny(nativeInput.Message)) + }() + +} + +func DryRunOperationException_ToDafny(nativeInput types.DryRunOperationException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_DryRunOperationException_(com_amazonaws_kms_DryRunOperationException_message_ToDafny(nativeInput.Message)) + }() + +} + +func ExpiredImportTokenException_ToDafny(nativeInput types.ExpiredImportTokenException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_ExpiredImportTokenException_(com_amazonaws_kms_ExpiredImportTokenException_message_ToDafny(nativeInput.Message)) + }() + +} + +func IncorrectKeyException_ToDafny(nativeInput types.IncorrectKeyException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectKeyException_(com_amazonaws_kms_IncorrectKeyException_message_ToDafny(nativeInput.Message)) + }() + +} + +func IncorrectKeyMaterialException_ToDafny(nativeInput types.IncorrectKeyMaterialException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectKeyMaterialException_(com_amazonaws_kms_IncorrectKeyMaterialException_message_ToDafny(nativeInput.Message)) + }() + +} + +func IncorrectTrustAnchorException_ToDafny(nativeInput types.IncorrectTrustAnchorException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_IncorrectTrustAnchorException_(com_amazonaws_kms_IncorrectTrustAnchorException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidAliasNameException_ToDafny(nativeInput types.InvalidAliasNameException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidAliasNameException_(com_amazonaws_kms_InvalidAliasNameException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidArnException_ToDafny(nativeInput types.InvalidArnException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidArnException_(com_amazonaws_kms_InvalidArnException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidCiphertextException_ToDafny(nativeInput types.InvalidCiphertextException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidCiphertextException_(com_amazonaws_kms_InvalidCiphertextException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidGrantIdException_ToDafny(nativeInput types.InvalidGrantIdException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidGrantIdException_(com_amazonaws_kms_InvalidGrantIdException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidGrantTokenException_ToDafny(nativeInput types.InvalidGrantTokenException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidGrantTokenException_(com_amazonaws_kms_InvalidGrantTokenException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidImportTokenException_ToDafny(nativeInput types.InvalidImportTokenException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidImportTokenException_(com_amazonaws_kms_InvalidImportTokenException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidKeyUsageException_ToDafny(nativeInput types.InvalidKeyUsageException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidKeyUsageException_(com_amazonaws_kms_InvalidKeyUsageException_message_ToDafny(nativeInput.Message)) + }() + +} + +func InvalidMarkerException_ToDafny(nativeInput types.InvalidMarkerException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_InvalidMarkerException_(com_amazonaws_kms_InvalidMarkerException_message_ToDafny(nativeInput.Message)) + }() + +} + +func KeyUnavailableException_ToDafny(nativeInput types.KeyUnavailableException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_KeyUnavailableException_(com_amazonaws_kms_KeyUnavailableException_message_ToDafny(nativeInput.Message)) + }() + +} + +func KMSInternalException_ToDafny(nativeInput types.KMSInternalException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInternalException_(com_amazonaws_kms_KMSInternalException_message_ToDafny(nativeInput.Message)) + }() + +} + +func KMSInvalidMacException_ToDafny(nativeInput types.KMSInvalidMacException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidMacException_(com_amazonaws_kms_KMSInvalidMacException_message_ToDafny(nativeInput.Message)) + }() + +} + +func KMSInvalidSignatureException_ToDafny(nativeInput types.KMSInvalidSignatureException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidSignatureException_(com_amazonaws_kms_KMSInvalidSignatureException_message_ToDafny(nativeInput.Message)) + }() + +} + +func KMSInvalidStateException_ToDafny(nativeInput types.KMSInvalidStateException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_KMSInvalidStateException_(com_amazonaws_kms_KMSInvalidStateException_message_ToDafny(nativeInput.Message)) + }() + +} + +func LimitExceededException_ToDafny(nativeInput types.LimitExceededException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_LimitExceededException_(com_amazonaws_kms_LimitExceededException_message_ToDafny(nativeInput.Message)) + }() + +} + +func MalformedPolicyDocumentException_ToDafny(nativeInput types.MalformedPolicyDocumentException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_MalformedPolicyDocumentException_(com_amazonaws_kms_MalformedPolicyDocumentException_message_ToDafny(nativeInput.Message)) + }() + +} + +func NotFoundException_ToDafny(nativeInput types.NotFoundException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_NotFoundException_(com_amazonaws_kms_NotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func TagException_ToDafny(nativeInput types.TagException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_TagException_(com_amazonaws_kms_TagException_message_ToDafny(nativeInput.Message)) + }() + +} + +func UnsupportedOperationException_ToDafny(nativeInput types.UnsupportedOperationException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_UnsupportedOperationException_(com_amazonaws_kms_UnsupportedOperationException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksKeyAlreadyInUseException_ToDafny(nativeInput types.XksKeyAlreadyInUseException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyAlreadyInUseException_(com_amazonaws_kms_XksKeyAlreadyInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksKeyInvalidConfigurationException_ToDafny(nativeInput types.XksKeyInvalidConfigurationException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyInvalidConfigurationException_(com_amazonaws_kms_XksKeyInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksKeyNotFoundException_ToDafny(nativeInput types.XksKeyNotFoundException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksKeyNotFoundException_(com_amazonaws_kms_XksKeyNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyIncorrectAuthenticationCredentialException_ToDafny(nativeInput types.XksProxyIncorrectAuthenticationCredentialException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyIncorrectAuthenticationCredentialException_(com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyInvalidConfigurationException_ToDafny(nativeInput types.XksProxyInvalidConfigurationException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyInvalidConfigurationException_(com_amazonaws_kms_XksProxyInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyInvalidResponseException_ToDafny(nativeInput types.XksProxyInvalidResponseException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyInvalidResponseException_(com_amazonaws_kms_XksProxyInvalidResponseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyUriEndpointInUseException_ToDafny(nativeInput types.XksProxyUriEndpointInUseException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriEndpointInUseException_(com_amazonaws_kms_XksProxyUriEndpointInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyUriInUseException_ToDafny(nativeInput types.XksProxyUriInUseException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriInUseException_(com_amazonaws_kms_XksProxyUriInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyUriUnreachableException_ToDafny(nativeInput types.XksProxyUriUnreachableException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyUriUnreachableException_(com_amazonaws_kms_XksProxyUriUnreachableException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyVpcEndpointServiceInUseException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceInUseException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceInUseException_(com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyVpcEndpointServiceInvalidConfigurationException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceInvalidConfigurationException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceInvalidConfigurationException_(com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_ToDafny(nativeInput.Message)) + }() + +} + +func XksProxyVpcEndpointServiceNotFoundException_ToDafny(nativeInput types.XksProxyVpcEndpointServiceNotFoundException) ComAmazonawsKmsTypes.Error { + return func() ComAmazonawsKmsTypes.Error { + + return ComAmazonawsKmsTypes.Companion_Error_.Create_XksProxyVpcEndpointServiceNotFoundException_(com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_ToDafny(nativeInput.Message)) + }() + +} + +func OpaqueError_Input_ToDafny(nativeInput error) ComAmazonawsKmsTypes.Error { + return ComAmazonawsKmsTypes.Companion_Error_.Create_OpaqueWithText_(nativeInput, dafny.SeqOfChars([]dafny.Char(nativeInput.Error())...)) +} + +func Error_ToDafny(err error) ComAmazonawsKmsTypes.Error { + // Service Errors + var AlreadyExistsException *types.AlreadyExistsException + if errors.As(err, &AlreadyExistsException) { + return AlreadyExistsException_ToDafny(*AlreadyExistsException) + } + + var CloudHsmClusterInUseException *types.CloudHsmClusterInUseException + if errors.As(err, &CloudHsmClusterInUseException) { + return CloudHsmClusterInUseException_ToDafny(*CloudHsmClusterInUseException) + } + + var CloudHsmClusterInvalidConfigurationException *types.CloudHsmClusterInvalidConfigurationException + if errors.As(err, &CloudHsmClusterInvalidConfigurationException) { + return CloudHsmClusterInvalidConfigurationException_ToDafny(*CloudHsmClusterInvalidConfigurationException) + } + + var CloudHsmClusterNotActiveException *types.CloudHsmClusterNotActiveException + if errors.As(err, &CloudHsmClusterNotActiveException) { + return CloudHsmClusterNotActiveException_ToDafny(*CloudHsmClusterNotActiveException) + } + + var CloudHsmClusterNotFoundException *types.CloudHsmClusterNotFoundException + if errors.As(err, &CloudHsmClusterNotFoundException) { + return CloudHsmClusterNotFoundException_ToDafny(*CloudHsmClusterNotFoundException) + } + + var CloudHsmClusterNotRelatedException *types.CloudHsmClusterNotRelatedException + if errors.As(err, &CloudHsmClusterNotRelatedException) { + return CloudHsmClusterNotRelatedException_ToDafny(*CloudHsmClusterNotRelatedException) + } + + var ConflictException *types.ConflictException + if errors.As(err, &ConflictException) { + return ConflictException_ToDafny(*ConflictException) + } + + var CustomKeyStoreHasCMKsException *types.CustomKeyStoreHasCMKsException + if errors.As(err, &CustomKeyStoreHasCMKsException) { + return CustomKeyStoreHasCMKsException_ToDafny(*CustomKeyStoreHasCMKsException) + } + + var CustomKeyStoreInvalidStateException *types.CustomKeyStoreInvalidStateException + if errors.As(err, &CustomKeyStoreInvalidStateException) { + return CustomKeyStoreInvalidStateException_ToDafny(*CustomKeyStoreInvalidStateException) + } + + var CustomKeyStoreNameInUseException *types.CustomKeyStoreNameInUseException + if errors.As(err, &CustomKeyStoreNameInUseException) { + return CustomKeyStoreNameInUseException_ToDafny(*CustomKeyStoreNameInUseException) + } + + var CustomKeyStoreNotFoundException *types.CustomKeyStoreNotFoundException + if errors.As(err, &CustomKeyStoreNotFoundException) { + return CustomKeyStoreNotFoundException_ToDafny(*CustomKeyStoreNotFoundException) + } + + var DependencyTimeoutException *types.DependencyTimeoutException + if errors.As(err, &DependencyTimeoutException) { + return DependencyTimeoutException_ToDafny(*DependencyTimeoutException) + } + + var DisabledException *types.DisabledException + if errors.As(err, &DisabledException) { + return DisabledException_ToDafny(*DisabledException) + } + + var DryRunOperationException *types.DryRunOperationException + if errors.As(err, &DryRunOperationException) { + return DryRunOperationException_ToDafny(*DryRunOperationException) + } + + var ExpiredImportTokenException *types.ExpiredImportTokenException + if errors.As(err, &ExpiredImportTokenException) { + return ExpiredImportTokenException_ToDafny(*ExpiredImportTokenException) + } + + var IncorrectKeyException *types.IncorrectKeyException + if errors.As(err, &IncorrectKeyException) { + return IncorrectKeyException_ToDafny(*IncorrectKeyException) + } + + var IncorrectKeyMaterialException *types.IncorrectKeyMaterialException + if errors.As(err, &IncorrectKeyMaterialException) { + return IncorrectKeyMaterialException_ToDafny(*IncorrectKeyMaterialException) + } + + var IncorrectTrustAnchorException *types.IncorrectTrustAnchorException + if errors.As(err, &IncorrectTrustAnchorException) { + return IncorrectTrustAnchorException_ToDafny(*IncorrectTrustAnchorException) + } + + var InvalidAliasNameException *types.InvalidAliasNameException + if errors.As(err, &InvalidAliasNameException) { + return InvalidAliasNameException_ToDafny(*InvalidAliasNameException) + } + + var InvalidArnException *types.InvalidArnException + if errors.As(err, &InvalidArnException) { + return InvalidArnException_ToDafny(*InvalidArnException) + } + + var InvalidCiphertextException *types.InvalidCiphertextException + if errors.As(err, &InvalidCiphertextException) { + return InvalidCiphertextException_ToDafny(*InvalidCiphertextException) + } + + var InvalidGrantIdException *types.InvalidGrantIdException + if errors.As(err, &InvalidGrantIdException) { + return InvalidGrantIdException_ToDafny(*InvalidGrantIdException) + } + + var InvalidGrantTokenException *types.InvalidGrantTokenException + if errors.As(err, &InvalidGrantTokenException) { + return InvalidGrantTokenException_ToDafny(*InvalidGrantTokenException) + } + + var InvalidImportTokenException *types.InvalidImportTokenException + if errors.As(err, &InvalidImportTokenException) { + return InvalidImportTokenException_ToDafny(*InvalidImportTokenException) + } + + var InvalidKeyUsageException *types.InvalidKeyUsageException + if errors.As(err, &InvalidKeyUsageException) { + return InvalidKeyUsageException_ToDafny(*InvalidKeyUsageException) + } + + var InvalidMarkerException *types.InvalidMarkerException + if errors.As(err, &InvalidMarkerException) { + return InvalidMarkerException_ToDafny(*InvalidMarkerException) + } + + var KeyUnavailableException *types.KeyUnavailableException + if errors.As(err, &KeyUnavailableException) { + return KeyUnavailableException_ToDafny(*KeyUnavailableException) + } + + var KMSInternalException *types.KMSInternalException + if errors.As(err, &KMSInternalException) { + return KMSInternalException_ToDafny(*KMSInternalException) + } + + var KMSInvalidMacException *types.KMSInvalidMacException + if errors.As(err, &KMSInvalidMacException) { + return KMSInvalidMacException_ToDafny(*KMSInvalidMacException) + } + + var KMSInvalidSignatureException *types.KMSInvalidSignatureException + if errors.As(err, &KMSInvalidSignatureException) { + return KMSInvalidSignatureException_ToDafny(*KMSInvalidSignatureException) + } + + var KMSInvalidStateException *types.KMSInvalidStateException + if errors.As(err, &KMSInvalidStateException) { + return KMSInvalidStateException_ToDafny(*KMSInvalidStateException) + } + + var LimitExceededException *types.LimitExceededException + if errors.As(err, &LimitExceededException) { + return LimitExceededException_ToDafny(*LimitExceededException) + } + + var MalformedPolicyDocumentException *types.MalformedPolicyDocumentException + if errors.As(err, &MalformedPolicyDocumentException) { + return MalformedPolicyDocumentException_ToDafny(*MalformedPolicyDocumentException) + } + + var NotFoundException *types.NotFoundException + if errors.As(err, &NotFoundException) { + return NotFoundException_ToDafny(*NotFoundException) + } + + var TagException *types.TagException + if errors.As(err, &TagException) { + return TagException_ToDafny(*TagException) + } + + var UnsupportedOperationException *types.UnsupportedOperationException + if errors.As(err, &UnsupportedOperationException) { + return UnsupportedOperationException_ToDafny(*UnsupportedOperationException) + } + + var XksKeyAlreadyInUseException *types.XksKeyAlreadyInUseException + if errors.As(err, &XksKeyAlreadyInUseException) { + return XksKeyAlreadyInUseException_ToDafny(*XksKeyAlreadyInUseException) + } + + var XksKeyInvalidConfigurationException *types.XksKeyInvalidConfigurationException + if errors.As(err, &XksKeyInvalidConfigurationException) { + return XksKeyInvalidConfigurationException_ToDafny(*XksKeyInvalidConfigurationException) + } + + var XksKeyNotFoundException *types.XksKeyNotFoundException + if errors.As(err, &XksKeyNotFoundException) { + return XksKeyNotFoundException_ToDafny(*XksKeyNotFoundException) + } + + var XksProxyIncorrectAuthenticationCredentialException *types.XksProxyIncorrectAuthenticationCredentialException + if errors.As(err, &XksProxyIncorrectAuthenticationCredentialException) { + return XksProxyIncorrectAuthenticationCredentialException_ToDafny(*XksProxyIncorrectAuthenticationCredentialException) + } + + var XksProxyInvalidConfigurationException *types.XksProxyInvalidConfigurationException + if errors.As(err, &XksProxyInvalidConfigurationException) { + return XksProxyInvalidConfigurationException_ToDafny(*XksProxyInvalidConfigurationException) + } + + var XksProxyInvalidResponseException *types.XksProxyInvalidResponseException + if errors.As(err, &XksProxyInvalidResponseException) { + return XksProxyInvalidResponseException_ToDafny(*XksProxyInvalidResponseException) + } + + var XksProxyUriEndpointInUseException *types.XksProxyUriEndpointInUseException + if errors.As(err, &XksProxyUriEndpointInUseException) { + return XksProxyUriEndpointInUseException_ToDafny(*XksProxyUriEndpointInUseException) + } + + var XksProxyUriInUseException *types.XksProxyUriInUseException + if errors.As(err, &XksProxyUriInUseException) { + return XksProxyUriInUseException_ToDafny(*XksProxyUriInUseException) + } + + var XksProxyUriUnreachableException *types.XksProxyUriUnreachableException + if errors.As(err, &XksProxyUriUnreachableException) { + return XksProxyUriUnreachableException_ToDafny(*XksProxyUriUnreachableException) + } + + var XksProxyVpcEndpointServiceInUseException *types.XksProxyVpcEndpointServiceInUseException + if errors.As(err, &XksProxyVpcEndpointServiceInUseException) { + return XksProxyVpcEndpointServiceInUseException_ToDafny(*XksProxyVpcEndpointServiceInUseException) + } + + var XksProxyVpcEndpointServiceInvalidConfigurationException *types.XksProxyVpcEndpointServiceInvalidConfigurationException + if errors.As(err, &XksProxyVpcEndpointServiceInvalidConfigurationException) { + return XksProxyVpcEndpointServiceInvalidConfigurationException_ToDafny(*XksProxyVpcEndpointServiceInvalidConfigurationException) + } + + var XksProxyVpcEndpointServiceNotFoundException *types.XksProxyVpcEndpointServiceNotFoundException + if errors.As(err, &XksProxyVpcEndpointServiceNotFoundException) { + return XksProxyVpcEndpointServiceNotFoundException_ToDafny(*XksProxyVpcEndpointServiceNotFoundException) + } + + return OpaqueError_Input_ToDafny(err) +} + +func com_amazonaws_kms_CancelKeyDeletionRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CancelKeyDeletionResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ConnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateAliasRequest_TargetKeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_TrustAnchorCertificate_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_KeyStorePassword_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_CustomKeyStoreType_ToDafny(input types.CustomKeyStoreType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomKeyStoreType)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(input *types.XksProxyAuthenticationCredentialType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyAuthenticationCredentialType_.Create_XksProxyAuthenticationCredentialType_(com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_ToDafny(input.RawSecretAccessKey))) + }() +} + +func com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) + }() +} + +func com_amazonaws_kms_CreateCustomKeyStoreResponse_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_GranteePrincipal_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_RetiringPrincipal_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_Operations_ToDafny(input []types.GrantOperation) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantOperationList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_kms_GrantOperationList_member_ToDafny(input types.GrantOperation) ComAmazonawsKmsTypes.GrantOperation { + return func() ComAmazonawsKmsTypes.GrantOperation { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_GrantOperation_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.GrantOperation) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_Constraints_ToDafny(input *types.GrantConstraints) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_GrantConstraints_.Create_GrantConstraints_(com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input.EncryptionContextSubset), com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input.EncryptionContextEquals))) + }() +} + +func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_EncryptionContextType_key_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_EncryptionContextType_value_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GrantTokenList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_Name_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_CreateGrantResponse_GrantToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateGrantResponse_GrantId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_Policy_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_Description_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_Origin_ToDafny(input types.OriginType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_Tags_ToDafny(input []types.Tag) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_TagList_member_ToDafny(input types.Tag) ComAmazonawsKmsTypes.Tag { + return func() ComAmazonawsKmsTypes.Tag { + + return ComAmazonawsKmsTypes.Companion_Tag_.Create_Tag_(com_amazonaws_kms_Tag_TagKey_ToDafny(input.TagKey), com_amazonaws_kms_Tag_TagValue_ToDafny(input.TagValue)) + }() +} + +func com_amazonaws_kms_Tag_TagKey_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_Tag_TagValue_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_MultiRegion_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_CreateKeyRequest_XksKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CreateKeyResponse_KeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) + }() +} + +func com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_KeyMetadata_Description_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) + }() +} + +func com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input types.KeyState) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyState)) + }() +} + +func com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input types.OriginType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) + }() +} + +func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input types.ExpirationModelType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ExpirationModelType)) + }() +} + +func com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input types.KeyManagerType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyManagerType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyManagerType)) + }() +} + +func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) + }() +} + +func com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) + }() +} + +func com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input []types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(input types.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + }() +} + +func com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input []types.SigningAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { + return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + }() +} + +func com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input []types.KeyAgreementAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(input types.KeyAgreementAlgorithmSpec) ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { + return func() ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) + }() +} + +func com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input *types.MultiRegionConfiguration) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_MultiRegionConfiguration_.Create_MultiRegionConfiguration_(com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_ToDafny(input.MultiRegionKeyType), com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_ToDafny(input.PrimaryKey), com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_ToDafny(input.ReplicaKeys))) + }() +} + +func com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_ToDafny(input types.MultiRegionKeyType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MultiRegionKeyType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MultiRegionKeyType)) + }() +} + +func com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_ToDafny(input *types.MultiRegionKey) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_MultiRegionKey_.Create_MultiRegionKey_(com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input.Arn), com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input.Region))) + }() +} + +func com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_ToDafny(input []types.MultiRegionKey) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_MultiRegionKeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_MultiRegionKeyList_member_ToDafny(input types.MultiRegionKey) ComAmazonawsKmsTypes.MultiRegionKey { + return func() ComAmazonawsKmsTypes.MultiRegionKey { + + return ComAmazonawsKmsTypes.Companion_MultiRegionKey_.Create_MultiRegionKey_(com_amazonaws_kms_MultiRegionKey_Arn_ToDafny(input.Arn), com_amazonaws_kms_MultiRegionKey_Region_ToDafny(input.Region)) + }() +} + +func com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input []types.MacAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_MacAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_MacAlgorithmSpecList_member_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { + return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + }() +} + +func com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input *types.XksKeyConfigurationType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksKeyConfigurationType_.Create_XksKeyConfigurationType_(com_amazonaws_kms_XksKeyConfigurationType_Id_ToDafny(input.Id))) + }() +} + +func com_amazonaws_kms_XksKeyConfigurationType_Id_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DecryptRequest_CiphertextBlob_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_DecryptRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_DecryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_DecryptRequest_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DecryptRequest_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_DecryptRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + }() +} + +func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input types.KeyEncryptionMechanism) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyEncryptionMechanism_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyEncryptionMechanism)) + }() +} + +func com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_DecryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_DecryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DecryptResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_DecryptResponse_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_DecryptResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_DeleteAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DeleteCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DeleteImportedKeyMaterialRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretRequest_KeyAgreementAlgorithm_ToDafny(input types.KeyAgreementAlgorithmSpec) ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { + return func() ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretRequest_PublicKey_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretResponse_SharedSecret_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretResponse_KeyAgreementAlgorithm_ToDafny(input types.KeyAgreementAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_DeriveSharedSecretResponse_KeyOrigin_ToDafny(input types.OriginType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.OriginType)) + }() +} + +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_CustomKeyStoreName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_DescribeCustomKeyStoresRequest_Marker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DescribeCustomKeyStoresResponse_CustomKeyStores_ToDafny(input []types.CustomKeyStoresListEntry) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_CustomKeyStoresList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresList_member_ToDafny(input types.CustomKeyStoresListEntry) ComAmazonawsKmsTypes.CustomKeyStoresListEntry { + return func() ComAmazonawsKmsTypes.CustomKeyStoresListEntry { + + return ComAmazonawsKmsTypes.Companion_CustomKeyStoresListEntry_.Create_CustomKeyStoresListEntry_(com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_ToDafny(input.CustomKeyStoreName), com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_ToDafny(input.TrustAnchorCertificate), com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_ToDafny(input.ConnectionState), com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_ToDafny(input.ConnectionErrorCode), com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_ToDafny(input.CustomKeyStoreType), com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_ToDafny(input.XksProxyConfiguration)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_ToDafny(input types.ConnectionStateType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionStateType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ConnectionStateType)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_ToDafny(input types.ConnectionErrorCodeType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionErrorCodeType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ConnectionErrorCodeType)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_ToDafny(input types.CustomKeyStoreType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomKeyStoreType)) + }() +} + +func com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_ToDafny(input *types.XksProxyConfigurationType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyConfigurationType_.Create_XksProxyConfigurationType_(com_amazonaws_kms_XksProxyConfigurationType_Connectivity_ToDafny(input.Connectivity), com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_ToDafny(input.UriEndpoint), com_amazonaws_kms_XksProxyConfigurationType_UriPath_ToDafny(input.UriPath), com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_ToDafny(input.VpcEndpointServiceName))) + }() +} + +func com_amazonaws_kms_XksProxyConfigurationType_Connectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) + }() +} + +func com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyConfigurationType_UriPath_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DescribeCustomKeyStoresResponse_NextMarker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DescribeCustomKeyStoresResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_DescribeKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DescribeKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_DescribeKeyResponse_KeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) + }() +} + +func com_amazonaws_kms_DisableKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DisableKeyRotationRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_DisconnectCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_EnableKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_EnableKeyRotationRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_EnableKeyRotationRequest_RotationPeriodInDays_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_EncryptRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_EncryptRequest_Plaintext_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_EncryptRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_EncryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_EncryptRequest_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_EncryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_EncryptResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_EncryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_EncryptResponse_EncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_KeySpec_ToDafny(input types.DataKeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeySpec)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + }() +} + +func com_amazonaws_kms_GenerateDataKeyRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateDataKeyResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairRequest_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) ComAmazonawsKmsTypes.DataKeyPairSpec { + return func() ComAmazonawsKmsTypes.DataKeyPairSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.DataKeyPairSpec) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyCiphertextBlob_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairResponse_PrivateKeyPlaintext_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairResponse_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeyPairSpec)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) ComAmazonawsKmsTypes.DataKeyPairSpec { + return func() ComAmazonawsKmsTypes.DataKeyPairSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.DataKeyPairSpec) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PrivateKeyCiphertextBlob_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse_KeyPairSpec_ToDafny(input types.DataKeyPairSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeyPairSpec)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_EncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_KeySpec_ToDafny(input types.DataKeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.DataKeySpec)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GenerateMacRequest_Message_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_GenerateMacRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GenerateMacRequest_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { + return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + }() +} + +func com_amazonaws_kms_GenerateMacRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GenerateMacRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateMacResponse_Mac_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateMacResponse_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_GenerateMacResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GenerateRandomRequest_NumberOfBytes_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GenerateRandomRequest_CustomKeyStoreId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GenerateRandomRequest_Recipient_ToDafny(input *types.RecipientInfo) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_RecipientInfo_.Create_RecipientInfo_(com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_ToDafny(input.KeyEncryptionAlgorithm), com_amazonaws_kms_RecipientInfo_AttestationDocument_ToDafny(input.AttestationDocument))) + }() +} + +func com_amazonaws_kms_GenerateRandomResponse_Plaintext_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GenerateRandomResponse_CiphertextForRecipient_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GetKeyPolicyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GetKeyPolicyRequest_PolicyName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GetKeyPolicyResponse_Policy_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GetKeyPolicyResponse_PolicyName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GetKeyRotationStatusRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GetKeyRotationStatusResponse_KeyRotationEnabled_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_GetKeyRotationStatusResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GetKeyRotationStatusResponse_RotationPeriodInDays_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_GetKeyRotationStatusResponse_NextRotationDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_GetKeyRotationStatusResponse_OnDemandRotationStartDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_GetParametersForImportRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GetParametersForImportRequest_WrappingAlgorithm_ToDafny(input types.AlgorithmSpec) ComAmazonawsKmsTypes.AlgorithmSpec { + return func() ComAmazonawsKmsTypes.AlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_AlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.AlgorithmSpec) + }() +} + +func com_amazonaws_kms_GetParametersForImportRequest_WrappingKeySpec_ToDafny(input types.WrappingKeySpec) ComAmazonawsKmsTypes.WrappingKeySpec { + return func() ComAmazonawsKmsTypes.WrappingKeySpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_WrappingKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.WrappingKeySpec) + }() +} + +func com_amazonaws_kms_GetParametersForImportResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GetParametersForImportResponse_ImportToken_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GetParametersForImportResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GetParametersForImportResponse_ParametersValidTo_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_GetPublicKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_GetPublicKeyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_PublicKey_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_CustomerMasterKeySpec_ToDafny(input types.CustomerMasterKeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_KeySpec_ToDafny(input types.KeySpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeySpec)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_KeyUsage_ToDafny(input types.KeyUsageType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyUsageType)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_EncryptionAlgorithms_ToDafny(input []types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_EncryptionAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_SigningAlgorithms_ToDafny(input []types.SigningAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_SigningAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GetPublicKeyResponse_KeyAgreementAlgorithms_ToDafny(input []types.KeyAgreementAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_ImportKeyMaterialRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ImportKeyMaterialRequest_ImportToken_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_ImportKeyMaterialRequest_EncryptedKeyMaterial_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_ImportKeyMaterialRequest_ValidTo_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_ImportKeyMaterialRequest_ExpirationModel_ToDafny(input types.ExpirationModelType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.ExpirationModelType)) + }() +} + +func com_amazonaws_kms_ListAliasesRequest_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListAliasesRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ListAliasesRequest_Marker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListAliasesResponse_Aliases_ToDafny(input []types.AliasListEntry) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_AliasList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_AliasList_member_ToDafny(input types.AliasListEntry) ComAmazonawsKmsTypes.AliasListEntry { + return func() ComAmazonawsKmsTypes.AliasListEntry { + + return ComAmazonawsKmsTypes.Companion_AliasListEntry_.Create_AliasListEntry_(com_amazonaws_kms_AliasListEntry_AliasName_ToDafny(input.AliasName), com_amazonaws_kms_AliasListEntry_AliasArn_ToDafny(input.AliasArn), com_amazonaws_kms_AliasListEntry_TargetKeyId_ToDafny(input.TargetKeyId), com_amazonaws_kms_AliasListEntry_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_AliasListEntry_LastUpdatedDate_ToDafny(input.LastUpdatedDate)) + }() +} + +func com_amazonaws_kms_AliasListEntry_AliasName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_AliasListEntry_AliasArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_AliasListEntry_TargetKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_AliasListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_AliasListEntry_LastUpdatedDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_ListAliasesResponse_NextMarker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListAliasesResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListGrantsRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ListGrantsRequest_Marker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListGrantsRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ListGrantsRequest_GrantId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListGrantsRequest_GranteePrincipal_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListGrantsResponse_Grants_ToDafny(input []types.GrantListEntry) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GrantList_member_ToDafny(input types.GrantListEntry) ComAmazonawsKmsTypes.GrantListEntry { + return func() ComAmazonawsKmsTypes.GrantListEntry { + + return ComAmazonawsKmsTypes.Companion_GrantListEntry_.Create_GrantListEntry_(com_amazonaws_kms_GrantListEntry_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_GrantListEntry_GrantId_ToDafny(input.GrantId), com_amazonaws_kms_GrantListEntry_Name_ToDafny(input.Name), com_amazonaws_kms_GrantListEntry_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_GrantListEntry_GranteePrincipal_ToDafny(input.GranteePrincipal), com_amazonaws_kms_GrantListEntry_RetiringPrincipal_ToDafny(input.RetiringPrincipal), com_amazonaws_kms_GrantListEntry_IssuingAccount_ToDafny(input.IssuingAccount), com_amazonaws_kms_GrantListEntry_Operations_ToDafny(input.Operations), com_amazonaws_kms_GrantListEntry_Constraints_ToDafny(input.Constraints)) + }() +} + +func com_amazonaws_kms_GrantListEntry_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_GrantId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_Name_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_CreationDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_GranteePrincipal_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_RetiringPrincipal_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_IssuingAccount_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_Operations_ToDafny(input []types.GrantOperation) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantOperationList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_GrantListEntry_Constraints_ToDafny(input *types.GrantConstraints) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_GrantConstraints_.Create_GrantConstraints_(com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_ToDafny(input.EncryptionContextSubset), com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_ToDafny(input.EncryptionContextEquals))) + }() +} + +func com_amazonaws_kms_ListGrantsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListGrantsResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesRequest_Marker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesResponse_PolicyNames_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_PolicyNameList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_PolicyNameList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesResponse_NextMarker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListKeyPoliciesResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListKeyRotationsRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ListKeyRotationsRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ListKeyRotationsRequest_Marker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListKeyRotationsResponse_Rotations_ToDafny(input []types.RotationsListEntry) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_RotationsList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_RotationsList_member_ToDafny(input types.RotationsListEntry) ComAmazonawsKmsTypes.RotationsListEntry { + return func() ComAmazonawsKmsTypes.RotationsListEntry { + + return ComAmazonawsKmsTypes.Companion_RotationsListEntry_.Create_RotationsListEntry_(com_amazonaws_kms_RotationsListEntry_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_RotationsListEntry_RotationDate_ToDafny(input.RotationDate), com_amazonaws_kms_RotationsListEntry_RotationType_ToDafny(input.RotationType)) + }() +} + +func com_amazonaws_kms_RotationsListEntry_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_RotationsListEntry_RotationDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_RotationsListEntry_RotationType_ToDafny(input types.RotationType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_RotationType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.RotationType)) + }() +} + +func com_amazonaws_kms_ListKeyRotationsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListKeyRotationsResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListKeysRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ListKeysRequest_Marker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListKeysResponse_Keys_ToDafny(input []types.KeyListEntry) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_KeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_KeyList_member_ToDafny(input types.KeyListEntry) ComAmazonawsKmsTypes.KeyListEntry { + return func() ComAmazonawsKmsTypes.KeyListEntry { + + return ComAmazonawsKmsTypes.Companion_KeyListEntry_.Create_KeyListEntry_(com_amazonaws_kms_KeyListEntry_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyListEntry_KeyArn_ToDafny(input.KeyArn)) + }() +} + +func com_amazonaws_kms_KeyListEntry_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyListEntry_KeyArn_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListKeysResponse_NextMarker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListKeysResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ListResourceTagsRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ListResourceTagsRequest_Limit_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ListResourceTagsRequest_Marker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListResourceTagsResponse_Tags_ToDafny(input []types.Tag) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_ListResourceTagsResponse_NextMarker_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ListResourceTagsResponse_Truncated_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_PutKeyPolicyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_PutKeyPolicyRequest_PolicyName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_PutKeyPolicyRequest_Policy_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_PutKeyPolicyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_CiphertextBlob_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_SourceEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_SourceKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_DestinationKeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionContext_ToDafny(input map[string]string) Wrappers.Option { + return func() Wrappers.Option { + + fieldValue := dafny.NewMapBuilder() + for key, val := range input { + fieldValue.Add(com_amazonaws_kms_EncryptionContextType_key_ToDafny(key), com_amazonaws_kms_EncryptionContextType_value_ToDafny(val)) + } + return Wrappers.Companion_Option_.Create_Some_(fieldValue.ToMap()) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_SourceEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_DestinationEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_ReEncryptRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ReEncryptResponse_CiphertextBlob_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_ReEncryptResponse_SourceKeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ReEncryptResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ReEncryptResponse_SourceEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_ReEncryptResponse_DestinationEncryptionAlgorithm_ToDafny(input types.EncryptionAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_ReplicaRegion_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_Policy_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_BypassPolicyLockoutSafetyCheck_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_Description_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ReplicateKeyRequest_Tags_ToDafny(input []types.Tag) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_ReplicateKeyResponse_ReplicaKeyMetadata_ToDafny(input *types.KeyMetadata) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_KeyMetadata_.Create_KeyMetadata_(com_amazonaws_kms_KeyMetadata_AWSAccountId_ToDafny(input.AWSAccountId), com_amazonaws_kms_KeyMetadata_KeyId_ToDafny(input.KeyId), com_amazonaws_kms_KeyMetadata_Arn_ToDafny(input.Arn), com_amazonaws_kms_KeyMetadata_CreationDate_ToDafny(input.CreationDate), com_amazonaws_kms_KeyMetadata_Enabled_ToDafny(input.Enabled), com_amazonaws_kms_KeyMetadata_Description_ToDafny(input.Description), com_amazonaws_kms_KeyMetadata_KeyUsage_ToDafny(input.KeyUsage), com_amazonaws_kms_KeyMetadata_KeyState_ToDafny(input.KeyState), com_amazonaws_kms_KeyMetadata_DeletionDate_ToDafny(input.DeletionDate), com_amazonaws_kms_KeyMetadata_ValidTo_ToDafny(input.ValidTo), com_amazonaws_kms_KeyMetadata_Origin_ToDafny(input.Origin), com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_ToDafny(input.CustomKeyStoreId), com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_ToDafny(input.CloudHsmClusterId), com_amazonaws_kms_KeyMetadata_ExpirationModel_ToDafny(input.ExpirationModel), com_amazonaws_kms_KeyMetadata_KeyManager_ToDafny(input.KeyManager), com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_ToDafny(input.CustomerMasterKeySpec), com_amazonaws_kms_KeyMetadata_KeySpec_ToDafny(input.KeySpec), com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_ToDafny(input.EncryptionAlgorithms), com_amazonaws_kms_KeyMetadata_SigningAlgorithms_ToDafny(input.SigningAlgorithms), com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_ToDafny(input.KeyAgreementAlgorithms), com_amazonaws_kms_KeyMetadata_MultiRegion_ToDafny(input.MultiRegion), com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_ToDafny(input.MultiRegionConfiguration), com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_ToDafny(input.PendingDeletionWindowInDays), com_amazonaws_kms_KeyMetadata_MacAlgorithms_ToDafny(input.MacAlgorithms), com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_ToDafny(input.XksKeyConfiguration))) + }() +} + +func com_amazonaws_kms_ReplicateKeyResponse_ReplicaPolicy_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ReplicateKeyResponse_ReplicaTags_ToDafny(input []types.Tag) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_RetireGrantRequest_GrantToken_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_RetireGrantRequest_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_RetireGrantRequest_GrantId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_RetireGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_RevokeGrantRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_RevokeGrantRequest_GrantId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_RevokeGrantRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_RotateKeyOnDemandRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_RotateKeyOnDemandResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ScheduleKeyDeletionRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_ScheduleKeyDeletionRequest_PendingWindowInDays_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ScheduleKeyDeletionResponse_DeletionDate_ToDafny(input *time.Time) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + formattedTime := input.Format("2006-01-02T15:04:05.999999Z") + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(formattedTime)...)) + }() +} + +func com_amazonaws_kms_ScheduleKeyDeletionResponse_KeyState_ToDafny(input types.KeyState) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.KeyState)) + }() +} + +func com_amazonaws_kms_ScheduleKeyDeletionResponse_PendingWindowInDays_ToDafny(input *int32) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_SignRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_SignRequest_Message_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_SignRequest_MessageType_ToDafny(input types.MessageType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MessageType)) + }() +} + +func com_amazonaws_kms_SignRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_SignRequest_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { + return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + }() +} + +func com_amazonaws_kms_SignRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_SignResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_SignResponse_Signature_ToDafny(input []byte) Wrappers.Option { + return func() Wrappers.Option { + var v []interface{} + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + for _, e := range input { + v = append(v, e) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(v...)) + }() +} + +func com_amazonaws_kms_SignResponse_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_TagResourceRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_TagResourceRequest_Tags_ToDafny(input []types.Tag) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_kms_UntagResourceRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UntagResourceRequest_TagKeys_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_TagKeyList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) + }() +} + +func com_amazonaws_kms_TagKeyList_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func com_amazonaws_kms_UpdateAliasRequest_AliasName_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UpdateAliasRequest_TargetKeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_CustomKeyStoreId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_NewCustomKeyStoreName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_KeyStorePassword_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_CloudHsmClusterId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriEndpoint_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyUriPath_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyVpcEndpointServiceName_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyAuthenticationCredential_ToDafny(input *types.XksProxyAuthenticationCredentialType) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(ComAmazonawsKmsTypes.Companion_XksProxyAuthenticationCredentialType_.Create_XksProxyAuthenticationCredentialType_(com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_ToDafny(input.AccessKeyId), com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_ToDafny(input.RawSecretAccessKey))) + }() +} + +func com_amazonaws_kms_UpdateCustomKeyStoreRequest_XksProxyConnectivity_ToDafny(input types.XksProxyConnectivityType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType)) + }() +} + +func com_amazonaws_kms_UpdateKeyDescriptionRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UpdateKeyDescriptionRequest_Description_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UpdatePrimaryRegionRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_UpdatePrimaryRegionRequest_PrimaryRegion_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_VerifyRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_VerifyRequest_Message_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_VerifyRequest_MessageType_ToDafny(input types.MessageType) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MessageType)) + }() +} + +func com_amazonaws_kms_VerifyRequest_Signature_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_VerifyRequest_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) ComAmazonawsKmsTypes.SigningAlgorithmSpec { + return func() ComAmazonawsKmsTypes.SigningAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + }() +} + +func com_amazonaws_kms_VerifyRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_VerifyRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_VerifyResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_VerifyResponse_SignatureValid_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_VerifyResponse_SigningAlgorithm_ToDafny(input types.SigningAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_VerifyMacRequest_Message_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_VerifyMacRequest_KeyId_ToDafny(input *string) dafny.Sequence { + return func() dafny.Sequence { + if input == nil { + return nil + } + return dafny.SeqOfChars([]dafny.Char(*input)...) + }() +} + +func com_amazonaws_kms_VerifyMacRequest_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) ComAmazonawsKmsTypes.MacAlgorithmSpec { + return func() ComAmazonawsKmsTypes.MacAlgorithmSpec { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + }() +} + +func com_amazonaws_kms_VerifyMacRequest_Mac_ToDafny(input []byte) dafny.Sequence { + return func() dafny.Sequence { + var v []interface{} + if input == nil { + return nil + } + for _, e := range input { + v = append(v, e) + } + return dafny.SeqOf(v...) + }() +} + +func com_amazonaws_kms_VerifyMacRequest_GrantTokens_ToDafny(input []string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := com_amazonaws_kms_GrantTokenList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOf(fieldValue...)) + }() +} + +func com_amazonaws_kms_VerifyMacRequest_DryRun_ToDafny(input *bool) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(*input) + }() +} + +func com_amazonaws_kms_VerifyMacResponse_KeyId_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_VerifyMacResponse_MacValid_ToDafny(input bool) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(input) + }() +} + +func com_amazonaws_kms_VerifyMacResponse_MacAlgorithm_ToDafny(input types.MacAlgorithmSpec) Wrappers.Option { + return func() Wrappers.Option { + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return Wrappers.Companion_Option_.Create_Some_(enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec)) + }() +} + +func com_amazonaws_kms_AlreadyExistsException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CloudHsmClusterInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CloudHsmClusterNotActiveException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CloudHsmClusterNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ConflictException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoreNameInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_CustomKeyStoreNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DependencyTimeoutException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DisabledException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_DryRunOperationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_ExpiredImportTokenException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_IncorrectKeyException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_IncorrectKeyMaterialException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_IncorrectTrustAnchorException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidAliasNameException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidArnException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidCiphertextException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidGrantIdException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidGrantTokenException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidImportTokenException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidKeyUsageException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_InvalidMarkerException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KeyUnavailableException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KMSInternalException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KMSInvalidMacException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KMSInvalidSignatureException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_KMSInvalidStateException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_LimitExceededException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_MalformedPolicyDocumentException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_NotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_TagException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_UnsupportedOperationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksKeyAlreadyInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksKeyNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyInvalidResponseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyUriInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyUriUnreachableException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} + +func com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_ToDafny(input *string) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + return Wrappers.Companion_Option_.Create_Some_(dafny.SeqOfChars([]dafny.Char(*input)...)) + }() +} diff --git a/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_native.go b/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_native.go new file mode 100644 index 000000000..9064975e2 --- /dev/null +++ b/ComAmazonawsKms/runtimes/go/TestsFromDafny-go/comamazonawskmssmithygenerated/to_native.go @@ -0,0 +1,8851 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comamazonawskmssmithygenerated + +import ( + "time" + + "github.com/aws/aws-cryptographic-material-providers-library/kms/ComAmazonawsKmsTypes" + "github.com/aws/aws-sdk-go-v2/service/kms" + "github.com/aws/aws-sdk-go-v2/service/kms/types" + "github.com/aws/smithy-go" + "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" +) + +func CancelKeyDeletionInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.CancelKeyDeletionRequest) kms.CancelKeyDeletionInput { + + return func() kms.CancelKeyDeletionInput { + + return kms.CancelKeyDeletionInput{ + KeyId: com_amazonaws_kms_CancelKeyDeletionInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + } + }() + +} + +func CancelKeyDeletionOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.CancelKeyDeletionResponse) kms.CancelKeyDeletionOutput { + + return func() kms.CancelKeyDeletionOutput { + + return kms.CancelKeyDeletionOutput{ + KeyId: com_amazonaws_kms_CancelKeyDeletionOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + } + }() + +} + +func ConnectCustomKeyStoreInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ConnectCustomKeyStoreRequest) kms.ConnectCustomKeyStoreInput { + + return func() kms.ConnectCustomKeyStoreInput { + + return kms.ConnectCustomKeyStoreInput{ + CustomKeyStoreId: com_amazonaws_kms_ConnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(dafnyInput.Dtor_CustomKeyStoreId()), + } + }() + +} + +func ConnectCustomKeyStoreOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ConnectCustomKeyStoreResponse) kms.ConnectCustomKeyStoreOutput { + + return func() kms.ConnectCustomKeyStoreOutput { + + return kms.ConnectCustomKeyStoreOutput{} + }() + +} + +func CreateAliasInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.CreateAliasRequest) kms.CreateAliasInput { + + return func() kms.CreateAliasInput { + + return kms.CreateAliasInput{ + AliasName: com_amazonaws_kms_CreateAliasInput_AliasName_FromDafny(dafnyInput.Dtor_AliasName()), + TargetKeyId: com_amazonaws_kms_CreateAliasInput_TargetKeyId_FromDafny(dafnyInput.Dtor_TargetKeyId()), + } + }() + +} + +func CreateCustomKeyStoreInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.CreateCustomKeyStoreRequest) kms.CreateCustomKeyStoreInput { + + return func() kms.CreateCustomKeyStoreInput { + + return kms.CreateCustomKeyStoreInput{ + CustomKeyStoreName: com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreName_FromDafny(dafnyInput.Dtor_CustomKeyStoreName()), + CloudHsmClusterId: com_amazonaws_kms_CreateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(dafnyInput.Dtor_CloudHsmClusterId().UnwrapOr(nil)), + TrustAnchorCertificate: com_amazonaws_kms_CreateCustomKeyStoreInput_TrustAnchorCertificate_FromDafny(dafnyInput.Dtor_TrustAnchorCertificate().UnwrapOr(nil)), + KeyStorePassword: com_amazonaws_kms_CreateCustomKeyStoreInput_KeyStorePassword_FromDafny(dafnyInput.Dtor_KeyStorePassword().UnwrapOr(nil)), + CustomKeyStoreType: com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreType_FromDafny(dafnyInput.Dtor_CustomKeyStoreType().UnwrapOr(nil)), + XksProxyUriEndpoint: com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(dafnyInput.Dtor_XksProxyUriEndpoint().UnwrapOr(nil)), + XksProxyUriPath: com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriPath_FromDafny(dafnyInput.Dtor_XksProxyUriPath().UnwrapOr(nil)), + XksProxyVpcEndpointServiceName: com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(dafnyInput.Dtor_XksProxyVpcEndpointServiceName().UnwrapOr(nil)), + XksProxyAuthenticationCredential: com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(dafnyInput.Dtor_XksProxyAuthenticationCredential().UnwrapOr(nil)), + XksProxyConnectivity: com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(dafnyInput.Dtor_XksProxyConnectivity().UnwrapOr(nil)), + } + }() + +} + +func CreateCustomKeyStoreOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.CreateCustomKeyStoreResponse) kms.CreateCustomKeyStoreOutput { + + return func() kms.CreateCustomKeyStoreOutput { + + return kms.CreateCustomKeyStoreOutput{ + CustomKeyStoreId: com_amazonaws_kms_CreateCustomKeyStoreOutput_CustomKeyStoreId_FromDafny(dafnyOutput.Dtor_CustomKeyStoreId().UnwrapOr(nil)), + } + }() + +} + +func CreateGrantInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.CreateGrantRequest) kms.CreateGrantInput { + + return func() kms.CreateGrantInput { + + return kms.CreateGrantInput{ + KeyId: com_amazonaws_kms_CreateGrantInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + GranteePrincipal: com_amazonaws_kms_CreateGrantInput_GranteePrincipal_FromDafny(dafnyInput.Dtor_GranteePrincipal()), + RetiringPrincipal: com_amazonaws_kms_CreateGrantInput_RetiringPrincipal_FromDafny(dafnyInput.Dtor_RetiringPrincipal().UnwrapOr(nil)), + Operations: com_amazonaws_kms_CreateGrantInput_Operations_FromDafny(dafnyInput.Dtor_Operations()), + Constraints: com_amazonaws_kms_CreateGrantInput_Constraints_FromDafny(dafnyInput.Dtor_Constraints().UnwrapOr(nil)), + GrantTokens: com_amazonaws_kms_CreateGrantInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + Name: com_amazonaws_kms_CreateGrantInput_Name_FromDafny(dafnyInput.Dtor_Name().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_CreateGrantInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func CreateGrantOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.CreateGrantResponse) kms.CreateGrantOutput { + + return func() kms.CreateGrantOutput { + + return kms.CreateGrantOutput{ + GrantToken: com_amazonaws_kms_CreateGrantOutput_GrantToken_FromDafny(dafnyOutput.Dtor_GrantToken().UnwrapOr(nil)), + GrantId: com_amazonaws_kms_CreateGrantOutput_GrantId_FromDafny(dafnyOutput.Dtor_GrantId().UnwrapOr(nil)), + } + }() + +} + +func CreateKeyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.CreateKeyRequest) kms.CreateKeyInput { + + return func() kms.CreateKeyInput { + + return kms.CreateKeyInput{ + Policy: com_amazonaws_kms_CreateKeyInput_Policy_FromDafny(dafnyInput.Dtor_Policy().UnwrapOr(nil)), + Description: com_amazonaws_kms_CreateKeyInput_Description_FromDafny(dafnyInput.Dtor_Description().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_CreateKeyInput_KeyUsage_FromDafny(dafnyInput.Dtor_KeyUsage().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_CreateKeyInput_CustomerMasterKeySpec_FromDafny(dafnyInput.Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_CreateKeyInput_KeySpec_FromDafny(dafnyInput.Dtor_KeySpec().UnwrapOr(nil)), + Origin: com_amazonaws_kms_CreateKeyInput_Origin_FromDafny(dafnyInput.Dtor_Origin().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_CreateKeyInput_CustomKeyStoreId_FromDafny(dafnyInput.Dtor_CustomKeyStoreId().UnwrapOr(nil)), + BypassPolicyLockoutSafetyCheck: com_amazonaws_kms_CreateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(dafnyInput.Dtor_BypassPolicyLockoutSafetyCheck().UnwrapOr(nil)), + Tags: com_amazonaws_kms_CreateKeyInput_Tags_FromDafny(dafnyInput.Dtor_Tags().UnwrapOr(nil)), + MultiRegion: com_amazonaws_kms_CreateKeyInput_MultiRegion_FromDafny(dafnyInput.Dtor_MultiRegion().UnwrapOr(nil)), + XksKeyId: com_amazonaws_kms_CreateKeyInput_XksKeyId_FromDafny(dafnyInput.Dtor_XksKeyId().UnwrapOr(nil)), + } + }() + +} + +func CreateKeyOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.CreateKeyResponse) kms.CreateKeyOutput { + + return func() kms.CreateKeyOutput { + + return kms.CreateKeyOutput{ + KeyMetadata: com_amazonaws_kms_CreateKeyOutput_KeyMetadata_FromDafny(dafnyOutput.Dtor_KeyMetadata().UnwrapOr(nil)), + } + }() + +} + +func DecryptInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DecryptRequest) kms.DecryptInput { + + return func() kms.DecryptInput { + + return kms.DecryptInput{ + CiphertextBlob: com_amazonaws_kms_DecryptInput_CiphertextBlob_FromDafny(dafnyInput.Dtor_CiphertextBlob()), + EncryptionContext: com_amazonaws_kms_DecryptInput_EncryptionContext_FromDafny(dafnyInput.Dtor_EncryptionContext().UnwrapOr(nil)), + GrantTokens: com_amazonaws_kms_DecryptInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_DecryptInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId().UnwrapOr(nil)), + EncryptionAlgorithm: com_amazonaws_kms_DecryptInput_EncryptionAlgorithm_FromDafny(dafnyInput.Dtor_EncryptionAlgorithm().UnwrapOr(nil)), + Recipient: com_amazonaws_kms_DecryptInput_Recipient_FromDafny(dafnyInput.Dtor_Recipient().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_DecryptInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func DecryptOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.DecryptResponse) kms.DecryptOutput { + + return func() kms.DecryptOutput { + + return kms.DecryptOutput{ + KeyId: com_amazonaws_kms_DecryptOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + Plaintext: com_amazonaws_kms_DecryptOutput_Plaintext_FromDafny(dafnyOutput.Dtor_Plaintext().UnwrapOr(nil)), + EncryptionAlgorithm: com_amazonaws_kms_DecryptOutput_EncryptionAlgorithm_FromDafny(dafnyOutput.Dtor_EncryptionAlgorithm().UnwrapOr(nil)), + CiphertextForRecipient: com_amazonaws_kms_DecryptOutput_CiphertextForRecipient_FromDafny(dafnyOutput.Dtor_CiphertextForRecipient().UnwrapOr(nil)), + } + }() + +} + +func DeleteAliasInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DeleteAliasRequest) kms.DeleteAliasInput { + + return func() kms.DeleteAliasInput { + + return kms.DeleteAliasInput{ + AliasName: com_amazonaws_kms_DeleteAliasInput_AliasName_FromDafny(dafnyInput.Dtor_AliasName()), + } + }() + +} + +func DeleteCustomKeyStoreInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DeleteCustomKeyStoreRequest) kms.DeleteCustomKeyStoreInput { + + return func() kms.DeleteCustomKeyStoreInput { + + return kms.DeleteCustomKeyStoreInput{ + CustomKeyStoreId: com_amazonaws_kms_DeleteCustomKeyStoreInput_CustomKeyStoreId_FromDafny(dafnyInput.Dtor_CustomKeyStoreId()), + } + }() + +} + +func DeleteCustomKeyStoreOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.DeleteCustomKeyStoreResponse) kms.DeleteCustomKeyStoreOutput { + + return func() kms.DeleteCustomKeyStoreOutput { + + return kms.DeleteCustomKeyStoreOutput{} + }() + +} + +func DeleteImportedKeyMaterialInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DeleteImportedKeyMaterialRequest) kms.DeleteImportedKeyMaterialInput { + + return func() kms.DeleteImportedKeyMaterialInput { + + return kms.DeleteImportedKeyMaterialInput{ + KeyId: com_amazonaws_kms_DeleteImportedKeyMaterialInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + } + }() + +} + +func DeriveSharedSecretInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DeriveSharedSecretRequest) kms.DeriveSharedSecretInput { + + return func() kms.DeriveSharedSecretInput { + + return kms.DeriveSharedSecretInput{ + KeyId: com_amazonaws_kms_DeriveSharedSecretInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + KeyAgreementAlgorithm: com_amazonaws_kms_DeriveSharedSecretInput_KeyAgreementAlgorithm_FromDafny(dafnyInput.Dtor_KeyAgreementAlgorithm()), + PublicKey: com_amazonaws_kms_DeriveSharedSecretInput_PublicKey_FromDafny(dafnyInput.Dtor_PublicKey()), + GrantTokens: com_amazonaws_kms_DeriveSharedSecretInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_DeriveSharedSecretInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + Recipient: com_amazonaws_kms_DeriveSharedSecretInput_Recipient_FromDafny(dafnyInput.Dtor_Recipient().UnwrapOr(nil)), + } + }() + +} + +func DeriveSharedSecretOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.DeriveSharedSecretResponse) kms.DeriveSharedSecretOutput { + + return func() kms.DeriveSharedSecretOutput { + + return kms.DeriveSharedSecretOutput{ + KeyId: com_amazonaws_kms_DeriveSharedSecretOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + SharedSecret: com_amazonaws_kms_DeriveSharedSecretOutput_SharedSecret_FromDafny(dafnyOutput.Dtor_SharedSecret().UnwrapOr(nil)), + CiphertextForRecipient: com_amazonaws_kms_DeriveSharedSecretOutput_CiphertextForRecipient_FromDafny(dafnyOutput.Dtor_CiphertextForRecipient().UnwrapOr(nil)), + KeyAgreementAlgorithm: com_amazonaws_kms_DeriveSharedSecretOutput_KeyAgreementAlgorithm_FromDafny(dafnyOutput.Dtor_KeyAgreementAlgorithm().UnwrapOr(nil)), + KeyOrigin: com_amazonaws_kms_DeriveSharedSecretOutput_KeyOrigin_FromDafny(dafnyOutput.Dtor_KeyOrigin().UnwrapOr(nil)), + } + }() + +} + +func DescribeCustomKeyStoresInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DescribeCustomKeyStoresRequest) kms.DescribeCustomKeyStoresInput { + + return func() kms.DescribeCustomKeyStoresInput { + + return kms.DescribeCustomKeyStoresInput{ + CustomKeyStoreId: com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreId_FromDafny(dafnyInput.Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CustomKeyStoreName: com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreName_FromDafny(dafnyInput.Dtor_CustomKeyStoreName().UnwrapOr(nil)), + Limit: com_amazonaws_kms_DescribeCustomKeyStoresInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Marker: com_amazonaws_kms_DescribeCustomKeyStoresInput_Marker_FromDafny(dafnyInput.Dtor_Marker().UnwrapOr(nil)), + } + }() + +} + +func DescribeCustomKeyStoresOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.DescribeCustomKeyStoresResponse) kms.DescribeCustomKeyStoresOutput { + + return func() kms.DescribeCustomKeyStoresOutput { + + return kms.DescribeCustomKeyStoresOutput{ + CustomKeyStores: com_amazonaws_kms_DescribeCustomKeyStoresOutput_CustomKeyStores_FromDafny(dafnyOutput.Dtor_CustomKeyStores().UnwrapOr(nil)), + NextMarker: com_amazonaws_kms_DescribeCustomKeyStoresOutput_NextMarker_FromDafny(dafnyOutput.Dtor_NextMarker().UnwrapOr(nil)), + Truncated: com_amazonaws_kms_DescribeCustomKeyStoresOutput_Truncated_FromDafny(dafnyOutput.Dtor_Truncated().UnwrapOr(nil)), + } + }() + +} + +func DescribeKeyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DescribeKeyRequest) kms.DescribeKeyInput { + + return func() kms.DescribeKeyInput { + + return kms.DescribeKeyInput{ + KeyId: com_amazonaws_kms_DescribeKeyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + GrantTokens: com_amazonaws_kms_DescribeKeyInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + } + }() + +} + +func DescribeKeyOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.DescribeKeyResponse) kms.DescribeKeyOutput { + + return func() kms.DescribeKeyOutput { + + return kms.DescribeKeyOutput{ + KeyMetadata: com_amazonaws_kms_DescribeKeyOutput_KeyMetadata_FromDafny(dafnyOutput.Dtor_KeyMetadata().UnwrapOr(nil)), + } + }() + +} + +func DisableKeyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DisableKeyRequest) kms.DisableKeyInput { + + return func() kms.DisableKeyInput { + + return kms.DisableKeyInput{ + KeyId: com_amazonaws_kms_DisableKeyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + } + }() + +} + +func DisableKeyRotationInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DisableKeyRotationRequest) kms.DisableKeyRotationInput { + + return func() kms.DisableKeyRotationInput { + + return kms.DisableKeyRotationInput{ + KeyId: com_amazonaws_kms_DisableKeyRotationInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + } + }() + +} + +func DisconnectCustomKeyStoreInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.DisconnectCustomKeyStoreRequest) kms.DisconnectCustomKeyStoreInput { + + return func() kms.DisconnectCustomKeyStoreInput { + + return kms.DisconnectCustomKeyStoreInput{ + CustomKeyStoreId: com_amazonaws_kms_DisconnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(dafnyInput.Dtor_CustomKeyStoreId()), + } + }() + +} + +func DisconnectCustomKeyStoreOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.DisconnectCustomKeyStoreResponse) kms.DisconnectCustomKeyStoreOutput { + + return func() kms.DisconnectCustomKeyStoreOutput { + + return kms.DisconnectCustomKeyStoreOutput{} + }() + +} + +func EnableKeyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.EnableKeyRequest) kms.EnableKeyInput { + + return func() kms.EnableKeyInput { + + return kms.EnableKeyInput{ + KeyId: com_amazonaws_kms_EnableKeyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + } + }() + +} + +func EnableKeyRotationInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.EnableKeyRotationRequest) kms.EnableKeyRotationInput { + + return func() kms.EnableKeyRotationInput { + + return kms.EnableKeyRotationInput{ + KeyId: com_amazonaws_kms_EnableKeyRotationInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + RotationPeriodInDays: com_amazonaws_kms_EnableKeyRotationInput_RotationPeriodInDays_FromDafny(dafnyInput.Dtor_RotationPeriodInDays().UnwrapOr(nil)), + } + }() + +} + +func EncryptInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.EncryptRequest) kms.EncryptInput { + + return func() kms.EncryptInput { + + return kms.EncryptInput{ + KeyId: com_amazonaws_kms_EncryptInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Plaintext: com_amazonaws_kms_EncryptInput_Plaintext_FromDafny(dafnyInput.Dtor_Plaintext()), + EncryptionContext: com_amazonaws_kms_EncryptInput_EncryptionContext_FromDafny(dafnyInput.Dtor_EncryptionContext().UnwrapOr(nil)), + GrantTokens: com_amazonaws_kms_EncryptInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + EncryptionAlgorithm: com_amazonaws_kms_EncryptInput_EncryptionAlgorithm_FromDafny(dafnyInput.Dtor_EncryptionAlgorithm().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_EncryptInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func EncryptOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.EncryptResponse) kms.EncryptOutput { + + return func() kms.EncryptOutput { + + return kms.EncryptOutput{ + CiphertextBlob: com_amazonaws_kms_EncryptOutput_CiphertextBlob_FromDafny(dafnyOutput.Dtor_CiphertextBlob().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_EncryptOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + EncryptionAlgorithm: com_amazonaws_kms_EncryptOutput_EncryptionAlgorithm_FromDafny(dafnyOutput.Dtor_EncryptionAlgorithm().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GenerateDataKeyRequest) kms.GenerateDataKeyInput { + + return func() kms.GenerateDataKeyInput { + + return kms.GenerateDataKeyInput{ + KeyId: com_amazonaws_kms_GenerateDataKeyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + EncryptionContext: com_amazonaws_kms_GenerateDataKeyInput_EncryptionContext_FromDafny(dafnyInput.Dtor_EncryptionContext().UnwrapOr(nil)), + NumberOfBytes: com_amazonaws_kms_GenerateDataKeyInput_NumberOfBytes_FromDafny(dafnyInput.Dtor_NumberOfBytes().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_GenerateDataKeyInput_KeySpec_FromDafny(dafnyInput.Dtor_KeySpec().UnwrapOr(nil)), + GrantTokens: com_amazonaws_kms_GenerateDataKeyInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + Recipient: com_amazonaws_kms_GenerateDataKeyInput_Recipient_FromDafny(dafnyInput.Dtor_Recipient().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_GenerateDataKeyInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GenerateDataKeyResponse) kms.GenerateDataKeyOutput { + + return func() kms.GenerateDataKeyOutput { + + return kms.GenerateDataKeyOutput{ + CiphertextBlob: com_amazonaws_kms_GenerateDataKeyOutput_CiphertextBlob_FromDafny(dafnyOutput.Dtor_CiphertextBlob().UnwrapOr(nil)), + Plaintext: com_amazonaws_kms_GenerateDataKeyOutput_Plaintext_FromDafny(dafnyOutput.Dtor_Plaintext().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GenerateDataKeyOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + CiphertextForRecipient: com_amazonaws_kms_GenerateDataKeyOutput_CiphertextForRecipient_FromDafny(dafnyOutput.Dtor_CiphertextForRecipient().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyPairInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GenerateDataKeyPairRequest) kms.GenerateDataKeyPairInput { + + return func() kms.GenerateDataKeyPairInput { + + return kms.GenerateDataKeyPairInput{ + EncryptionContext: com_amazonaws_kms_GenerateDataKeyPairInput_EncryptionContext_FromDafny(dafnyInput.Dtor_EncryptionContext().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GenerateDataKeyPairInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + KeyPairSpec: com_amazonaws_kms_GenerateDataKeyPairInput_KeyPairSpec_FromDafny(dafnyInput.Dtor_KeyPairSpec()), + GrantTokens: com_amazonaws_kms_GenerateDataKeyPairInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + Recipient: com_amazonaws_kms_GenerateDataKeyPairInput_Recipient_FromDafny(dafnyInput.Dtor_Recipient().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_GenerateDataKeyPairInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyPairOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GenerateDataKeyPairResponse) kms.GenerateDataKeyPairOutput { + + return func() kms.GenerateDataKeyPairOutput { + + return kms.GenerateDataKeyPairOutput{ + PrivateKeyCiphertextBlob: com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyCiphertextBlob_FromDafny(dafnyOutput.Dtor_PrivateKeyCiphertextBlob().UnwrapOr(nil)), + PrivateKeyPlaintext: com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyPlaintext_FromDafny(dafnyOutput.Dtor_PrivateKeyPlaintext().UnwrapOr(nil)), + PublicKey: com_amazonaws_kms_GenerateDataKeyPairOutput_PublicKey_FromDafny(dafnyOutput.Dtor_PublicKey().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GenerateDataKeyPairOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + KeyPairSpec: com_amazonaws_kms_GenerateDataKeyPairOutput_KeyPairSpec_FromDafny(dafnyOutput.Dtor_KeyPairSpec().UnwrapOr(nil)), + CiphertextForRecipient: com_amazonaws_kms_GenerateDataKeyPairOutput_CiphertextForRecipient_FromDafny(dafnyOutput.Dtor_CiphertextForRecipient().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyPairWithoutPlaintextInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GenerateDataKeyPairWithoutPlaintextRequest) kms.GenerateDataKeyPairWithoutPlaintextInput { + + return func() kms.GenerateDataKeyPairWithoutPlaintextInput { + + return kms.GenerateDataKeyPairWithoutPlaintextInput{ + EncryptionContext: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_EncryptionContext_FromDafny(dafnyInput.Dtor_EncryptionContext().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + KeyPairSpec: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyPairSpec_FromDafny(dafnyInput.Dtor_KeyPairSpec()), + GrantTokens: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyPairWithoutPlaintextOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GenerateDataKeyPairWithoutPlaintextResponse) kms.GenerateDataKeyPairWithoutPlaintextOutput { + + return func() kms.GenerateDataKeyPairWithoutPlaintextOutput { + + return kms.GenerateDataKeyPairWithoutPlaintextOutput{ + PrivateKeyCiphertextBlob: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PrivateKeyCiphertextBlob_FromDafny(dafnyOutput.Dtor_PrivateKeyCiphertextBlob().UnwrapOr(nil)), + PublicKey: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PublicKey_FromDafny(dafnyOutput.Dtor_PublicKey().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + KeyPairSpec: com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyPairSpec_FromDafny(dafnyOutput.Dtor_KeyPairSpec().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyWithoutPlaintextInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GenerateDataKeyWithoutPlaintextRequest) kms.GenerateDataKeyWithoutPlaintextInput { + + return func() kms.GenerateDataKeyWithoutPlaintextInput { + + return kms.GenerateDataKeyWithoutPlaintextInput{ + KeyId: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + EncryptionContext: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_EncryptionContext_FromDafny(dafnyInput.Dtor_EncryptionContext().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeySpec_FromDafny(dafnyInput.Dtor_KeySpec().UnwrapOr(nil)), + NumberOfBytes: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_NumberOfBytes_FromDafny(dafnyInput.Dtor_NumberOfBytes().UnwrapOr(nil)), + GrantTokens: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func GenerateDataKeyWithoutPlaintextOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GenerateDataKeyWithoutPlaintextResponse) kms.GenerateDataKeyWithoutPlaintextOutput { + + return func() kms.GenerateDataKeyWithoutPlaintextOutput { + + return kms.GenerateDataKeyWithoutPlaintextOutput{ + CiphertextBlob: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_CiphertextBlob_FromDafny(dafnyOutput.Dtor_CiphertextBlob().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + } + }() + +} + +func GenerateMacInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GenerateMacRequest) kms.GenerateMacInput { + + return func() kms.GenerateMacInput { + + return kms.GenerateMacInput{ + Message: com_amazonaws_kms_GenerateMacInput_Message_FromDafny(dafnyInput.Dtor_Message()), + KeyId: com_amazonaws_kms_GenerateMacInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + MacAlgorithm: com_amazonaws_kms_GenerateMacInput_MacAlgorithm_FromDafny(dafnyInput.Dtor_MacAlgorithm()), + GrantTokens: com_amazonaws_kms_GenerateMacInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_GenerateMacInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func GenerateMacOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GenerateMacResponse) kms.GenerateMacOutput { + + return func() kms.GenerateMacOutput { + + return kms.GenerateMacOutput{ + Mac: com_amazonaws_kms_GenerateMacOutput_Mac_FromDafny(dafnyOutput.Dtor_Mac().UnwrapOr(nil)), + MacAlgorithm: com_amazonaws_kms_GenerateMacOutput_MacAlgorithm_FromDafny(dafnyOutput.Dtor_MacAlgorithm().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GenerateMacOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + } + }() + +} + +func GenerateRandomInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GenerateRandomRequest) kms.GenerateRandomInput { + + return func() kms.GenerateRandomInput { + + return kms.GenerateRandomInput{ + NumberOfBytes: com_amazonaws_kms_GenerateRandomInput_NumberOfBytes_FromDafny(dafnyInput.Dtor_NumberOfBytes().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_GenerateRandomInput_CustomKeyStoreId_FromDafny(dafnyInput.Dtor_CustomKeyStoreId().UnwrapOr(nil)), + Recipient: com_amazonaws_kms_GenerateRandomInput_Recipient_FromDafny(dafnyInput.Dtor_Recipient().UnwrapOr(nil)), + } + }() + +} + +func GenerateRandomOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GenerateRandomResponse) kms.GenerateRandomOutput { + + return func() kms.GenerateRandomOutput { + + return kms.GenerateRandomOutput{ + Plaintext: com_amazonaws_kms_GenerateRandomOutput_Plaintext_FromDafny(dafnyOutput.Dtor_Plaintext().UnwrapOr(nil)), + CiphertextForRecipient: com_amazonaws_kms_GenerateRandomOutput_CiphertextForRecipient_FromDafny(dafnyOutput.Dtor_CiphertextForRecipient().UnwrapOr(nil)), + } + }() + +} + +func GetKeyPolicyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GetKeyPolicyRequest) kms.GetKeyPolicyInput { + + return func() kms.GetKeyPolicyInput { + + return kms.GetKeyPolicyInput{ + KeyId: com_amazonaws_kms_GetKeyPolicyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + PolicyName: com_amazonaws_kms_GetKeyPolicyInput_PolicyName_FromDafny(dafnyInput.Dtor_PolicyName().UnwrapOr(nil)), + } + }() + +} + +func GetKeyPolicyOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GetKeyPolicyResponse) kms.GetKeyPolicyOutput { + + return func() kms.GetKeyPolicyOutput { + + return kms.GetKeyPolicyOutput{ + Policy: com_amazonaws_kms_GetKeyPolicyOutput_Policy_FromDafny(dafnyOutput.Dtor_Policy().UnwrapOr(nil)), + PolicyName: com_amazonaws_kms_GetKeyPolicyOutput_PolicyName_FromDafny(dafnyOutput.Dtor_PolicyName().UnwrapOr(nil)), + } + }() + +} + +func GetKeyRotationStatusInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GetKeyRotationStatusRequest) kms.GetKeyRotationStatusInput { + + return func() kms.GetKeyRotationStatusInput { + + return kms.GetKeyRotationStatusInput{ + KeyId: com_amazonaws_kms_GetKeyRotationStatusInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + } + }() + +} + +func GetKeyRotationStatusOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GetKeyRotationStatusResponse) kms.GetKeyRotationStatusOutput { + + return func() kms.GetKeyRotationStatusOutput { + + return kms.GetKeyRotationStatusOutput{ + KeyRotationEnabled: com_amazonaws_kms_GetKeyRotationStatusOutput_KeyRotationEnabled_FromDafny(dafnyOutput.Dtor_KeyRotationEnabled().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_GetKeyRotationStatusOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + RotationPeriodInDays: com_amazonaws_kms_GetKeyRotationStatusOutput_RotationPeriodInDays_FromDafny(dafnyOutput.Dtor_RotationPeriodInDays().UnwrapOr(nil)), + NextRotationDate: com_amazonaws_kms_GetKeyRotationStatusOutput_NextRotationDate_FromDafny(dafnyOutput.Dtor_NextRotationDate().UnwrapOr(nil)), + OnDemandRotationStartDate: com_amazonaws_kms_GetKeyRotationStatusOutput_OnDemandRotationStartDate_FromDafny(dafnyOutput.Dtor_OnDemandRotationStartDate().UnwrapOr(nil)), + } + }() + +} + +func GetParametersForImportInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GetParametersForImportRequest) kms.GetParametersForImportInput { + + return func() kms.GetParametersForImportInput { + + return kms.GetParametersForImportInput{ + KeyId: com_amazonaws_kms_GetParametersForImportInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + WrappingAlgorithm: com_amazonaws_kms_GetParametersForImportInput_WrappingAlgorithm_FromDafny(dafnyInput.Dtor_WrappingAlgorithm()), + WrappingKeySpec: com_amazonaws_kms_GetParametersForImportInput_WrappingKeySpec_FromDafny(dafnyInput.Dtor_WrappingKeySpec()), + } + }() + +} + +func GetParametersForImportOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GetParametersForImportResponse) kms.GetParametersForImportOutput { + + return func() kms.GetParametersForImportOutput { + + return kms.GetParametersForImportOutput{ + KeyId: com_amazonaws_kms_GetParametersForImportOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + ImportToken: com_amazonaws_kms_GetParametersForImportOutput_ImportToken_FromDafny(dafnyOutput.Dtor_ImportToken().UnwrapOr(nil)), + PublicKey: com_amazonaws_kms_GetParametersForImportOutput_PublicKey_FromDafny(dafnyOutput.Dtor_PublicKey().UnwrapOr(nil)), + ParametersValidTo: com_amazonaws_kms_GetParametersForImportOutput_ParametersValidTo_FromDafny(dafnyOutput.Dtor_ParametersValidTo().UnwrapOr(nil)), + } + }() + +} + +func GetPublicKeyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.GetPublicKeyRequest) kms.GetPublicKeyInput { + + return func() kms.GetPublicKeyInput { + + return kms.GetPublicKeyInput{ + KeyId: com_amazonaws_kms_GetPublicKeyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + GrantTokens: com_amazonaws_kms_GetPublicKeyInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + } + }() + +} + +func GetPublicKeyOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.GetPublicKeyResponse) kms.GetPublicKeyOutput { + + return func() kms.GetPublicKeyOutput { + + return kms.GetPublicKeyOutput{ + KeyId: com_amazonaws_kms_GetPublicKeyOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + PublicKey: com_amazonaws_kms_GetPublicKeyOutput_PublicKey_FromDafny(dafnyOutput.Dtor_PublicKey().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_GetPublicKeyOutput_CustomerMasterKeySpec_FromDafny(dafnyOutput.Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_GetPublicKeyOutput_KeySpec_FromDafny(dafnyOutput.Dtor_KeySpec().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_GetPublicKeyOutput_KeyUsage_FromDafny(dafnyOutput.Dtor_KeyUsage().UnwrapOr(nil)), + EncryptionAlgorithms: com_amazonaws_kms_GetPublicKeyOutput_EncryptionAlgorithms_FromDafny(dafnyOutput.Dtor_EncryptionAlgorithms().UnwrapOr(nil)), + SigningAlgorithms: com_amazonaws_kms_GetPublicKeyOutput_SigningAlgorithms_FromDafny(dafnyOutput.Dtor_SigningAlgorithms().UnwrapOr(nil)), + KeyAgreementAlgorithms: com_amazonaws_kms_GetPublicKeyOutput_KeyAgreementAlgorithms_FromDafny(dafnyOutput.Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), + } + }() + +} + +func ImportKeyMaterialInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ImportKeyMaterialRequest) kms.ImportKeyMaterialInput { + + return func() kms.ImportKeyMaterialInput { + + return kms.ImportKeyMaterialInput{ + KeyId: com_amazonaws_kms_ImportKeyMaterialInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + ImportToken: com_amazonaws_kms_ImportKeyMaterialInput_ImportToken_FromDafny(dafnyInput.Dtor_ImportToken()), + EncryptedKeyMaterial: com_amazonaws_kms_ImportKeyMaterialInput_EncryptedKeyMaterial_FromDafny(dafnyInput.Dtor_EncryptedKeyMaterial()), + ValidTo: com_amazonaws_kms_ImportKeyMaterialInput_ValidTo_FromDafny(dafnyInput.Dtor_ValidTo().UnwrapOr(nil)), + ExpirationModel: com_amazonaws_kms_ImportKeyMaterialInput_ExpirationModel_FromDafny(dafnyInput.Dtor_ExpirationModel().UnwrapOr(nil)), + } + }() + +} + +func ImportKeyMaterialOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ImportKeyMaterialResponse) kms.ImportKeyMaterialOutput { + + return func() kms.ImportKeyMaterialOutput { + + return kms.ImportKeyMaterialOutput{} + }() + +} + +func ListAliasesInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ListAliasesRequest) kms.ListAliasesInput { + + return func() kms.ListAliasesInput { + + return kms.ListAliasesInput{ + KeyId: com_amazonaws_kms_ListAliasesInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId().UnwrapOr(nil)), + Limit: com_amazonaws_kms_ListAliasesInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Marker: com_amazonaws_kms_ListAliasesInput_Marker_FromDafny(dafnyInput.Dtor_Marker().UnwrapOr(nil)), + } + }() + +} + +func ListAliasesOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ListAliasesResponse) kms.ListAliasesOutput { + + return func() kms.ListAliasesOutput { + + return kms.ListAliasesOutput{ + Aliases: com_amazonaws_kms_ListAliasesOutput_Aliases_FromDafny(dafnyOutput.Dtor_Aliases().UnwrapOr(nil)), + NextMarker: com_amazonaws_kms_ListAliasesOutput_NextMarker_FromDafny(dafnyOutput.Dtor_NextMarker().UnwrapOr(nil)), + Truncated: com_amazonaws_kms_ListAliasesOutput_Truncated_FromDafny(dafnyOutput.Dtor_Truncated().UnwrapOr(nil)), + } + }() + +} + +func ListGrantsInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ListGrantsRequest) kms.ListGrantsInput { + + return func() kms.ListGrantsInput { + + return kms.ListGrantsInput{ + Limit: com_amazonaws_kms_ListGrantsInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Marker: com_amazonaws_kms_ListGrantsInput_Marker_FromDafny(dafnyInput.Dtor_Marker().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_ListGrantsInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + GrantId: com_amazonaws_kms_ListGrantsInput_GrantId_FromDafny(dafnyInput.Dtor_GrantId().UnwrapOr(nil)), + GranteePrincipal: com_amazonaws_kms_ListGrantsInput_GranteePrincipal_FromDafny(dafnyInput.Dtor_GranteePrincipal().UnwrapOr(nil)), + } + }() + +} + +func ListGrantsOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ListGrantsResponse) kms.ListGrantsOutput { + + return func() kms.ListGrantsOutput { + + return kms.ListGrantsOutput{ + Grants: com_amazonaws_kms_ListGrantsOutput_Grants_FromDafny(dafnyOutput.Dtor_Grants().UnwrapOr(nil)), + NextMarker: com_amazonaws_kms_ListGrantsOutput_NextMarker_FromDafny(dafnyOutput.Dtor_NextMarker().UnwrapOr(nil)), + Truncated: com_amazonaws_kms_ListGrantsOutput_Truncated_FromDafny(dafnyOutput.Dtor_Truncated().UnwrapOr(nil)), + } + }() + +} + +func ListKeyPoliciesInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ListKeyPoliciesRequest) kms.ListKeyPoliciesInput { + + return func() kms.ListKeyPoliciesInput { + + return kms.ListKeyPoliciesInput{ + KeyId: com_amazonaws_kms_ListKeyPoliciesInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Limit: com_amazonaws_kms_ListKeyPoliciesInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Marker: com_amazonaws_kms_ListKeyPoliciesInput_Marker_FromDafny(dafnyInput.Dtor_Marker().UnwrapOr(nil)), + } + }() + +} + +func ListKeyPoliciesOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ListKeyPoliciesResponse) kms.ListKeyPoliciesOutput { + + return func() kms.ListKeyPoliciesOutput { + + return kms.ListKeyPoliciesOutput{ + PolicyNames: com_amazonaws_kms_ListKeyPoliciesOutput_PolicyNames_FromDafny(dafnyOutput.Dtor_PolicyNames().UnwrapOr(nil)), + NextMarker: com_amazonaws_kms_ListKeyPoliciesOutput_NextMarker_FromDafny(dafnyOutput.Dtor_NextMarker().UnwrapOr(nil)), + Truncated: com_amazonaws_kms_ListKeyPoliciesOutput_Truncated_FromDafny(dafnyOutput.Dtor_Truncated().UnwrapOr(nil)), + } + }() + +} + +func ListKeyRotationsInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ListKeyRotationsRequest) kms.ListKeyRotationsInput { + + return func() kms.ListKeyRotationsInput { + + return kms.ListKeyRotationsInput{ + KeyId: com_amazonaws_kms_ListKeyRotationsInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Limit: com_amazonaws_kms_ListKeyRotationsInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Marker: com_amazonaws_kms_ListKeyRotationsInput_Marker_FromDafny(dafnyInput.Dtor_Marker().UnwrapOr(nil)), + } + }() + +} + +func ListKeyRotationsOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ListKeyRotationsResponse) kms.ListKeyRotationsOutput { + + return func() kms.ListKeyRotationsOutput { + + return kms.ListKeyRotationsOutput{ + Rotations: com_amazonaws_kms_ListKeyRotationsOutput_Rotations_FromDafny(dafnyOutput.Dtor_Rotations().UnwrapOr(nil)), + NextMarker: com_amazonaws_kms_ListKeyRotationsOutput_NextMarker_FromDafny(dafnyOutput.Dtor_NextMarker().UnwrapOr(nil)), + Truncated: com_amazonaws_kms_ListKeyRotationsOutput_Truncated_FromDafny(dafnyOutput.Dtor_Truncated().UnwrapOr(nil)), + } + }() + +} + +func ListKeysInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ListKeysRequest) kms.ListKeysInput { + + return func() kms.ListKeysInput { + + return kms.ListKeysInput{ + Limit: com_amazonaws_kms_ListKeysInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Marker: com_amazonaws_kms_ListKeysInput_Marker_FromDafny(dafnyInput.Dtor_Marker().UnwrapOr(nil)), + } + }() + +} + +func ListKeysOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ListKeysResponse) kms.ListKeysOutput { + + return func() kms.ListKeysOutput { + + return kms.ListKeysOutput{ + Keys: com_amazonaws_kms_ListKeysOutput_Keys_FromDafny(dafnyOutput.Dtor_Keys().UnwrapOr(nil)), + NextMarker: com_amazonaws_kms_ListKeysOutput_NextMarker_FromDafny(dafnyOutput.Dtor_NextMarker().UnwrapOr(nil)), + Truncated: com_amazonaws_kms_ListKeysOutput_Truncated_FromDafny(dafnyOutput.Dtor_Truncated().UnwrapOr(nil)), + } + }() + +} + +func ListResourceTagsInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ListResourceTagsRequest) kms.ListResourceTagsInput { + + return func() kms.ListResourceTagsInput { + + return kms.ListResourceTagsInput{ + KeyId: com_amazonaws_kms_ListResourceTagsInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Limit: com_amazonaws_kms_ListResourceTagsInput_Limit_FromDafny(dafnyInput.Dtor_Limit().UnwrapOr(nil)), + Marker: com_amazonaws_kms_ListResourceTagsInput_Marker_FromDafny(dafnyInput.Dtor_Marker().UnwrapOr(nil)), + } + }() + +} + +func ListResourceTagsOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ListResourceTagsResponse) kms.ListResourceTagsOutput { + + return func() kms.ListResourceTagsOutput { + + return kms.ListResourceTagsOutput{ + Tags: com_amazonaws_kms_ListResourceTagsOutput_Tags_FromDafny(dafnyOutput.Dtor_Tags().UnwrapOr(nil)), + NextMarker: com_amazonaws_kms_ListResourceTagsOutput_NextMarker_FromDafny(dafnyOutput.Dtor_NextMarker().UnwrapOr(nil)), + Truncated: com_amazonaws_kms_ListResourceTagsOutput_Truncated_FromDafny(dafnyOutput.Dtor_Truncated().UnwrapOr(nil)), + } + }() + +} + +func PutKeyPolicyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.PutKeyPolicyRequest) kms.PutKeyPolicyInput { + + return func() kms.PutKeyPolicyInput { + + return kms.PutKeyPolicyInput{ + KeyId: com_amazonaws_kms_PutKeyPolicyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + PolicyName: com_amazonaws_kms_PutKeyPolicyInput_PolicyName_FromDafny(dafnyInput.Dtor_PolicyName().UnwrapOr(nil)), + Policy: com_amazonaws_kms_PutKeyPolicyInput_Policy_FromDafny(dafnyInput.Dtor_Policy()), + BypassPolicyLockoutSafetyCheck: com_amazonaws_kms_PutKeyPolicyInput_BypassPolicyLockoutSafetyCheck_FromDafny(dafnyInput.Dtor_BypassPolicyLockoutSafetyCheck().UnwrapOr(nil)), + } + }() + +} + +func ReEncryptInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ReEncryptRequest) kms.ReEncryptInput { + + return func() kms.ReEncryptInput { + + return kms.ReEncryptInput{ + CiphertextBlob: com_amazonaws_kms_ReEncryptInput_CiphertextBlob_FromDafny(dafnyInput.Dtor_CiphertextBlob()), + SourceEncryptionContext: com_amazonaws_kms_ReEncryptInput_SourceEncryptionContext_FromDafny(dafnyInput.Dtor_SourceEncryptionContext().UnwrapOr(nil)), + SourceKeyId: com_amazonaws_kms_ReEncryptInput_SourceKeyId_FromDafny(dafnyInput.Dtor_SourceKeyId().UnwrapOr(nil)), + DestinationKeyId: com_amazonaws_kms_ReEncryptInput_DestinationKeyId_FromDafny(dafnyInput.Dtor_DestinationKeyId()), + DestinationEncryptionContext: com_amazonaws_kms_ReEncryptInput_DestinationEncryptionContext_FromDafny(dafnyInput.Dtor_DestinationEncryptionContext().UnwrapOr(nil)), + SourceEncryptionAlgorithm: com_amazonaws_kms_ReEncryptInput_SourceEncryptionAlgorithm_FromDafny(dafnyInput.Dtor_SourceEncryptionAlgorithm().UnwrapOr(nil)), + DestinationEncryptionAlgorithm: com_amazonaws_kms_ReEncryptInput_DestinationEncryptionAlgorithm_FromDafny(dafnyInput.Dtor_DestinationEncryptionAlgorithm().UnwrapOr(nil)), + GrantTokens: com_amazonaws_kms_ReEncryptInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_ReEncryptInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func ReEncryptOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ReEncryptResponse) kms.ReEncryptOutput { + + return func() kms.ReEncryptOutput { + + return kms.ReEncryptOutput{ + CiphertextBlob: com_amazonaws_kms_ReEncryptOutput_CiphertextBlob_FromDafny(dafnyOutput.Dtor_CiphertextBlob().UnwrapOr(nil)), + SourceKeyId: com_amazonaws_kms_ReEncryptOutput_SourceKeyId_FromDafny(dafnyOutput.Dtor_SourceKeyId().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_ReEncryptOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + SourceEncryptionAlgorithm: com_amazonaws_kms_ReEncryptOutput_SourceEncryptionAlgorithm_FromDafny(dafnyOutput.Dtor_SourceEncryptionAlgorithm().UnwrapOr(nil)), + DestinationEncryptionAlgorithm: com_amazonaws_kms_ReEncryptOutput_DestinationEncryptionAlgorithm_FromDafny(dafnyOutput.Dtor_DestinationEncryptionAlgorithm().UnwrapOr(nil)), + } + }() + +} + +func ReplicateKeyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ReplicateKeyRequest) kms.ReplicateKeyInput { + + return func() kms.ReplicateKeyInput { + + return kms.ReplicateKeyInput{ + KeyId: com_amazonaws_kms_ReplicateKeyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + ReplicaRegion: com_amazonaws_kms_ReplicateKeyInput_ReplicaRegion_FromDafny(dafnyInput.Dtor_ReplicaRegion()), + Policy: com_amazonaws_kms_ReplicateKeyInput_Policy_FromDafny(dafnyInput.Dtor_Policy().UnwrapOr(nil)), + BypassPolicyLockoutSafetyCheck: com_amazonaws_kms_ReplicateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(dafnyInput.Dtor_BypassPolicyLockoutSafetyCheck().UnwrapOr(nil)), + Description: com_amazonaws_kms_ReplicateKeyInput_Description_FromDafny(dafnyInput.Dtor_Description().UnwrapOr(nil)), + Tags: com_amazonaws_kms_ReplicateKeyInput_Tags_FromDafny(dafnyInput.Dtor_Tags().UnwrapOr(nil)), + } + }() + +} + +func ReplicateKeyOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ReplicateKeyResponse) kms.ReplicateKeyOutput { + + return func() kms.ReplicateKeyOutput { + + return kms.ReplicateKeyOutput{ + ReplicaKeyMetadata: com_amazonaws_kms_ReplicateKeyOutput_ReplicaKeyMetadata_FromDafny(dafnyOutput.Dtor_ReplicaKeyMetadata().UnwrapOr(nil)), + ReplicaPolicy: com_amazonaws_kms_ReplicateKeyOutput_ReplicaPolicy_FromDafny(dafnyOutput.Dtor_ReplicaPolicy().UnwrapOr(nil)), + ReplicaTags: com_amazonaws_kms_ReplicateKeyOutput_ReplicaTags_FromDafny(dafnyOutput.Dtor_ReplicaTags().UnwrapOr(nil)), + } + }() + +} + +func RetireGrantInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.RetireGrantRequest) kms.RetireGrantInput { + + return func() kms.RetireGrantInput { + + return kms.RetireGrantInput{ + GrantToken: com_amazonaws_kms_RetireGrantInput_GrantToken_FromDafny(dafnyInput.Dtor_GrantToken().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_RetireGrantInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId().UnwrapOr(nil)), + GrantId: com_amazonaws_kms_RetireGrantInput_GrantId_FromDafny(dafnyInput.Dtor_GrantId().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_RetireGrantInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func RevokeGrantInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.RevokeGrantRequest) kms.RevokeGrantInput { + + return func() kms.RevokeGrantInput { + + return kms.RevokeGrantInput{ + KeyId: com_amazonaws_kms_RevokeGrantInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + GrantId: com_amazonaws_kms_RevokeGrantInput_GrantId_FromDafny(dafnyInput.Dtor_GrantId()), + DryRun: com_amazonaws_kms_RevokeGrantInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func RotateKeyOnDemandInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.RotateKeyOnDemandRequest) kms.RotateKeyOnDemandInput { + + return func() kms.RotateKeyOnDemandInput { + + return kms.RotateKeyOnDemandInput{ + KeyId: com_amazonaws_kms_RotateKeyOnDemandInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + } + }() + +} + +func RotateKeyOnDemandOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.RotateKeyOnDemandResponse) kms.RotateKeyOnDemandOutput { + + return func() kms.RotateKeyOnDemandOutput { + + return kms.RotateKeyOnDemandOutput{ + KeyId: com_amazonaws_kms_RotateKeyOnDemandOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + } + }() + +} + +func ScheduleKeyDeletionInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.ScheduleKeyDeletionRequest) kms.ScheduleKeyDeletionInput { + + return func() kms.ScheduleKeyDeletionInput { + + return kms.ScheduleKeyDeletionInput{ + KeyId: com_amazonaws_kms_ScheduleKeyDeletionInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + PendingWindowInDays: com_amazonaws_kms_ScheduleKeyDeletionInput_PendingWindowInDays_FromDafny(dafnyInput.Dtor_PendingWindowInDays().UnwrapOr(nil)), + } + }() + +} + +func ScheduleKeyDeletionOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.ScheduleKeyDeletionResponse) kms.ScheduleKeyDeletionOutput { + + return func() kms.ScheduleKeyDeletionOutput { + + return kms.ScheduleKeyDeletionOutput{ + KeyId: com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + DeletionDate: com_amazonaws_kms_ScheduleKeyDeletionOutput_DeletionDate_FromDafny(dafnyOutput.Dtor_DeletionDate().UnwrapOr(nil)), + KeyState: com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyState_FromDafny(dafnyOutput.Dtor_KeyState().UnwrapOr(nil)), + PendingWindowInDays: com_amazonaws_kms_ScheduleKeyDeletionOutput_PendingWindowInDays_FromDafny(dafnyOutput.Dtor_PendingWindowInDays().UnwrapOr(nil)), + } + }() + +} + +func SignInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.SignRequest) kms.SignInput { + + return func() kms.SignInput { + + return kms.SignInput{ + KeyId: com_amazonaws_kms_SignInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Message: com_amazonaws_kms_SignInput_Message_FromDafny(dafnyInput.Dtor_Message()), + MessageType: com_amazonaws_kms_SignInput_MessageType_FromDafny(dafnyInput.Dtor_MessageType().UnwrapOr(nil)), + GrantTokens: com_amazonaws_kms_SignInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + SigningAlgorithm: com_amazonaws_kms_SignInput_SigningAlgorithm_FromDafny(dafnyInput.Dtor_SigningAlgorithm()), + DryRun: com_amazonaws_kms_SignInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func SignOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.SignResponse) kms.SignOutput { + + return func() kms.SignOutput { + + return kms.SignOutput{ + KeyId: com_amazonaws_kms_SignOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + Signature: com_amazonaws_kms_SignOutput_Signature_FromDafny(dafnyOutput.Dtor_Signature().UnwrapOr(nil)), + SigningAlgorithm: com_amazonaws_kms_SignOutput_SigningAlgorithm_FromDafny(dafnyOutput.Dtor_SigningAlgorithm().UnwrapOr(nil)), + } + }() + +} + +func TagResourceInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.TagResourceRequest) kms.TagResourceInput { + + return func() kms.TagResourceInput { + + return kms.TagResourceInput{ + KeyId: com_amazonaws_kms_TagResourceInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Tags: com_amazonaws_kms_TagResourceInput_Tags_FromDafny(dafnyInput.Dtor_Tags()), + } + }() + +} + +func UntagResourceInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.UntagResourceRequest) kms.UntagResourceInput { + + return func() kms.UntagResourceInput { + + return kms.UntagResourceInput{ + KeyId: com_amazonaws_kms_UntagResourceInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + TagKeys: com_amazonaws_kms_UntagResourceInput_TagKeys_FromDafny(dafnyInput.Dtor_TagKeys()), + } + }() + +} + +func UpdateAliasInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.UpdateAliasRequest) kms.UpdateAliasInput { + + return func() kms.UpdateAliasInput { + + return kms.UpdateAliasInput{ + AliasName: com_amazonaws_kms_UpdateAliasInput_AliasName_FromDafny(dafnyInput.Dtor_AliasName()), + TargetKeyId: com_amazonaws_kms_UpdateAliasInput_TargetKeyId_FromDafny(dafnyInput.Dtor_TargetKeyId()), + } + }() + +} + +func UpdateCustomKeyStoreInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.UpdateCustomKeyStoreRequest) kms.UpdateCustomKeyStoreInput { + + return func() kms.UpdateCustomKeyStoreInput { + + return kms.UpdateCustomKeyStoreInput{ + CustomKeyStoreId: com_amazonaws_kms_UpdateCustomKeyStoreInput_CustomKeyStoreId_FromDafny(dafnyInput.Dtor_CustomKeyStoreId()), + NewCustomKeyStoreName: com_amazonaws_kms_UpdateCustomKeyStoreInput_NewCustomKeyStoreName_FromDafny(dafnyInput.Dtor_NewCustomKeyStoreName().UnwrapOr(nil)), + KeyStorePassword: com_amazonaws_kms_UpdateCustomKeyStoreInput_KeyStorePassword_FromDafny(dafnyInput.Dtor_KeyStorePassword().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_UpdateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(dafnyInput.Dtor_CloudHsmClusterId().UnwrapOr(nil)), + XksProxyUriEndpoint: com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(dafnyInput.Dtor_XksProxyUriEndpoint().UnwrapOr(nil)), + XksProxyUriPath: com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriPath_FromDafny(dafnyInput.Dtor_XksProxyUriPath().UnwrapOr(nil)), + XksProxyVpcEndpointServiceName: com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(dafnyInput.Dtor_XksProxyVpcEndpointServiceName().UnwrapOr(nil)), + XksProxyAuthenticationCredential: com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(dafnyInput.Dtor_XksProxyAuthenticationCredential().UnwrapOr(nil)), + XksProxyConnectivity: com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(dafnyInput.Dtor_XksProxyConnectivity().UnwrapOr(nil)), + } + }() + +} + +func UpdateCustomKeyStoreOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.UpdateCustomKeyStoreResponse) kms.UpdateCustomKeyStoreOutput { + + return func() kms.UpdateCustomKeyStoreOutput { + + return kms.UpdateCustomKeyStoreOutput{} + }() + +} + +func UpdateKeyDescriptionInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.UpdateKeyDescriptionRequest) kms.UpdateKeyDescriptionInput { + + return func() kms.UpdateKeyDescriptionInput { + + return kms.UpdateKeyDescriptionInput{ + KeyId: com_amazonaws_kms_UpdateKeyDescriptionInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Description: com_amazonaws_kms_UpdateKeyDescriptionInput_Description_FromDafny(dafnyInput.Dtor_Description()), + } + }() + +} + +func UpdatePrimaryRegionInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.UpdatePrimaryRegionRequest) kms.UpdatePrimaryRegionInput { + + return func() kms.UpdatePrimaryRegionInput { + + return kms.UpdatePrimaryRegionInput{ + KeyId: com_amazonaws_kms_UpdatePrimaryRegionInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + PrimaryRegion: com_amazonaws_kms_UpdatePrimaryRegionInput_PrimaryRegion_FromDafny(dafnyInput.Dtor_PrimaryRegion()), + } + }() + +} + +func VerifyInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.VerifyRequest) kms.VerifyInput { + + return func() kms.VerifyInput { + + return kms.VerifyInput{ + KeyId: com_amazonaws_kms_VerifyInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + Message: com_amazonaws_kms_VerifyInput_Message_FromDafny(dafnyInput.Dtor_Message()), + MessageType: com_amazonaws_kms_VerifyInput_MessageType_FromDafny(dafnyInput.Dtor_MessageType().UnwrapOr(nil)), + Signature: com_amazonaws_kms_VerifyInput_Signature_FromDafny(dafnyInput.Dtor_Signature()), + SigningAlgorithm: com_amazonaws_kms_VerifyInput_SigningAlgorithm_FromDafny(dafnyInput.Dtor_SigningAlgorithm()), + GrantTokens: com_amazonaws_kms_VerifyInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_VerifyInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func VerifyOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.VerifyResponse) kms.VerifyOutput { + + return func() kms.VerifyOutput { + + return kms.VerifyOutput{ + KeyId: com_amazonaws_kms_VerifyOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + SignatureValid: com_amazonaws_kms_VerifyOutput_SignatureValid_FromDafny(dafnyOutput.Dtor_SignatureValid().UnwrapOr(nil)), + SigningAlgorithm: com_amazonaws_kms_VerifyOutput_SigningAlgorithm_FromDafny(dafnyOutput.Dtor_SigningAlgorithm().UnwrapOr(nil)), + } + }() + +} + +func VerifyMacInput_FromDafny(dafnyInput ComAmazonawsKmsTypes.VerifyMacRequest) kms.VerifyMacInput { + + return func() kms.VerifyMacInput { + + return kms.VerifyMacInput{ + Message: com_amazonaws_kms_VerifyMacInput_Message_FromDafny(dafnyInput.Dtor_Message()), + KeyId: com_amazonaws_kms_VerifyMacInput_KeyId_FromDafny(dafnyInput.Dtor_KeyId()), + MacAlgorithm: com_amazonaws_kms_VerifyMacInput_MacAlgorithm_FromDafny(dafnyInput.Dtor_MacAlgorithm()), + Mac: com_amazonaws_kms_VerifyMacInput_Mac_FromDafny(dafnyInput.Dtor_Mac()), + GrantTokens: com_amazonaws_kms_VerifyMacInput_GrantTokens_FromDafny(dafnyInput.Dtor_GrantTokens().UnwrapOr(nil)), + DryRun: com_amazonaws_kms_VerifyMacInput_DryRun_FromDafny(dafnyInput.Dtor_DryRun().UnwrapOr(nil)), + } + }() + +} + +func VerifyMacOutput_FromDafny(dafnyOutput ComAmazonawsKmsTypes.VerifyMacResponse) kms.VerifyMacOutput { + + return func() kms.VerifyMacOutput { + + return kms.VerifyMacOutput{ + KeyId: com_amazonaws_kms_VerifyMacOutput_KeyId_FromDafny(dafnyOutput.Dtor_KeyId().UnwrapOr(nil)), + MacValid: com_amazonaws_kms_VerifyMacOutput_MacValid_FromDafny(dafnyOutput.Dtor_MacValid().UnwrapOr(nil)), + MacAlgorithm: com_amazonaws_kms_VerifyMacOutput_MacAlgorithm_FromDafny(dafnyOutput.Dtor_MacAlgorithm().UnwrapOr(nil)), + } + }() + +} + +func AlreadyExistsException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.AlreadyExistsException { + return func() types.AlreadyExistsException { + + return types.AlreadyExistsException{ + Message: com_amazonaws_kms_AlreadyExistsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CloudHsmClusterInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterInUseException { + return func() types.CloudHsmClusterInUseException { + + return types.CloudHsmClusterInUseException{ + Message: com_amazonaws_kms_CloudHsmClusterInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CloudHsmClusterInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterInvalidConfigurationException { + return func() types.CloudHsmClusterInvalidConfigurationException { + + return types.CloudHsmClusterInvalidConfigurationException{ + Message: com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CloudHsmClusterNotActiveException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotActiveException { + return func() types.CloudHsmClusterNotActiveException { + + return types.CloudHsmClusterNotActiveException{ + Message: com_amazonaws_kms_CloudHsmClusterNotActiveException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CloudHsmClusterNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotFoundException { + return func() types.CloudHsmClusterNotFoundException { + + return types.CloudHsmClusterNotFoundException{ + Message: com_amazonaws_kms_CloudHsmClusterNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CloudHsmClusterNotRelatedException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CloudHsmClusterNotRelatedException { + return func() types.CloudHsmClusterNotRelatedException { + + return types.CloudHsmClusterNotRelatedException{ + Message: com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ConflictException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.ConflictException { + return func() types.ConflictException { + + return types.ConflictException{ + Message: com_amazonaws_kms_ConflictException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CustomKeyStoreHasCMKsException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreHasCMKsException { + return func() types.CustomKeyStoreHasCMKsException { + + return types.CustomKeyStoreHasCMKsException{ + Message: com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CustomKeyStoreInvalidStateException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreInvalidStateException { + return func() types.CustomKeyStoreInvalidStateException { + + return types.CustomKeyStoreInvalidStateException{ + Message: com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CustomKeyStoreNameInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreNameInUseException { + return func() types.CustomKeyStoreNameInUseException { + + return types.CustomKeyStoreNameInUseException{ + Message: com_amazonaws_kms_CustomKeyStoreNameInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func CustomKeyStoreNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.CustomKeyStoreNotFoundException { + return func() types.CustomKeyStoreNotFoundException { + + return types.CustomKeyStoreNotFoundException{ + Message: com_amazonaws_kms_CustomKeyStoreNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func DependencyTimeoutException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DependencyTimeoutException { + return func() types.DependencyTimeoutException { + + return types.DependencyTimeoutException{ + Message: com_amazonaws_kms_DependencyTimeoutException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func DisabledException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DisabledException { + return func() types.DisabledException { + + return types.DisabledException{ + Message: com_amazonaws_kms_DisabledException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func DryRunOperationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.DryRunOperationException { + return func() types.DryRunOperationException { + + return types.DryRunOperationException{ + Message: com_amazonaws_kms_DryRunOperationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func ExpiredImportTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.ExpiredImportTokenException { + return func() types.ExpiredImportTokenException { + + return types.ExpiredImportTokenException{ + Message: com_amazonaws_kms_ExpiredImportTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func IncorrectKeyException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectKeyException { + return func() types.IncorrectKeyException { + + return types.IncorrectKeyException{ + Message: com_amazonaws_kms_IncorrectKeyException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func IncorrectKeyMaterialException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectKeyMaterialException { + return func() types.IncorrectKeyMaterialException { + + return types.IncorrectKeyMaterialException{ + Message: com_amazonaws_kms_IncorrectKeyMaterialException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func IncorrectTrustAnchorException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.IncorrectTrustAnchorException { + return func() types.IncorrectTrustAnchorException { + + return types.IncorrectTrustAnchorException{ + Message: com_amazonaws_kms_IncorrectTrustAnchorException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidAliasNameException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidAliasNameException { + return func() types.InvalidAliasNameException { + + return types.InvalidAliasNameException{ + Message: com_amazonaws_kms_InvalidAliasNameException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidArnException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidArnException { + return func() types.InvalidArnException { + + return types.InvalidArnException{ + Message: com_amazonaws_kms_InvalidArnException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidCiphertextException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidCiphertextException { + return func() types.InvalidCiphertextException { + + return types.InvalidCiphertextException{ + Message: com_amazonaws_kms_InvalidCiphertextException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidGrantIdException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidGrantIdException { + return func() types.InvalidGrantIdException { + + return types.InvalidGrantIdException{ + Message: com_amazonaws_kms_InvalidGrantIdException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidGrantTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidGrantTokenException { + return func() types.InvalidGrantTokenException { + + return types.InvalidGrantTokenException{ + Message: com_amazonaws_kms_InvalidGrantTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidImportTokenException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidImportTokenException { + return func() types.InvalidImportTokenException { + + return types.InvalidImportTokenException{ + Message: com_amazonaws_kms_InvalidImportTokenException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidKeyUsageException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidKeyUsageException { + return func() types.InvalidKeyUsageException { + + return types.InvalidKeyUsageException{ + Message: com_amazonaws_kms_InvalidKeyUsageException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func InvalidMarkerException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.InvalidMarkerException { + return func() types.InvalidMarkerException { + + return types.InvalidMarkerException{ + Message: com_amazonaws_kms_InvalidMarkerException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func KeyUnavailableException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KeyUnavailableException { + return func() types.KeyUnavailableException { + + return types.KeyUnavailableException{ + Message: com_amazonaws_kms_KeyUnavailableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func KMSInternalException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInternalException { + return func() types.KMSInternalException { + + return types.KMSInternalException{ + Message: com_amazonaws_kms_KMSInternalException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func KMSInvalidMacException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidMacException { + return func() types.KMSInvalidMacException { + + return types.KMSInvalidMacException{ + Message: com_amazonaws_kms_KMSInvalidMacException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func KMSInvalidSignatureException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidSignatureException { + return func() types.KMSInvalidSignatureException { + + return types.KMSInvalidSignatureException{ + Message: com_amazonaws_kms_KMSInvalidSignatureException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func KMSInvalidStateException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.KMSInvalidStateException { + return func() types.KMSInvalidStateException { + + return types.KMSInvalidStateException{ + Message: com_amazonaws_kms_KMSInvalidStateException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func LimitExceededException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.LimitExceededException { + return func() types.LimitExceededException { + + return types.LimitExceededException{ + Message: com_amazonaws_kms_LimitExceededException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func MalformedPolicyDocumentException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.MalformedPolicyDocumentException { + return func() types.MalformedPolicyDocumentException { + + return types.MalformedPolicyDocumentException{ + Message: com_amazonaws_kms_MalformedPolicyDocumentException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func NotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.NotFoundException { + return func() types.NotFoundException { + + return types.NotFoundException{ + Message: com_amazonaws_kms_NotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func TagException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.TagException { + return func() types.TagException { + + return types.TagException{ + Message: com_amazonaws_kms_TagException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func UnsupportedOperationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.UnsupportedOperationException { + return func() types.UnsupportedOperationException { + + return types.UnsupportedOperationException{ + Message: com_amazonaws_kms_UnsupportedOperationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksKeyAlreadyInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyAlreadyInUseException { + return func() types.XksKeyAlreadyInUseException { + + return types.XksKeyAlreadyInUseException{ + Message: com_amazonaws_kms_XksKeyAlreadyInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksKeyInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyInvalidConfigurationException { + return func() types.XksKeyInvalidConfigurationException { + + return types.XksKeyInvalidConfigurationException{ + Message: com_amazonaws_kms_XksKeyInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksKeyNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksKeyNotFoundException { + return func() types.XksKeyNotFoundException { + + return types.XksKeyNotFoundException{ + Message: com_amazonaws_kms_XksKeyNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyIncorrectAuthenticationCredentialException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyIncorrectAuthenticationCredentialException { + return func() types.XksProxyIncorrectAuthenticationCredentialException { + + return types.XksProxyIncorrectAuthenticationCredentialException{ + Message: com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyInvalidConfigurationException { + return func() types.XksProxyInvalidConfigurationException { + + return types.XksProxyInvalidConfigurationException{ + Message: com_amazonaws_kms_XksProxyInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyInvalidResponseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyInvalidResponseException { + return func() types.XksProxyInvalidResponseException { + + return types.XksProxyInvalidResponseException{ + Message: com_amazonaws_kms_XksProxyInvalidResponseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyUriEndpointInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriEndpointInUseException { + return func() types.XksProxyUriEndpointInUseException { + + return types.XksProxyUriEndpointInUseException{ + Message: com_amazonaws_kms_XksProxyUriEndpointInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyUriInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriInUseException { + return func() types.XksProxyUriInUseException { + + return types.XksProxyUriInUseException{ + Message: com_amazonaws_kms_XksProxyUriInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyUriUnreachableException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyUriUnreachableException { + return func() types.XksProxyUriUnreachableException { + + return types.XksProxyUriUnreachableException{ + Message: com_amazonaws_kms_XksProxyUriUnreachableException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyVpcEndpointServiceInUseException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceInUseException { + return func() types.XksProxyVpcEndpointServiceInUseException { + + return types.XksProxyVpcEndpointServiceInUseException{ + Message: com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyVpcEndpointServiceInvalidConfigurationException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceInvalidConfigurationException { + return func() types.XksProxyVpcEndpointServiceInvalidConfigurationException { + + return types.XksProxyVpcEndpointServiceInvalidConfigurationException{ + Message: com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func XksProxyVpcEndpointServiceNotFoundException_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) types.XksProxyVpcEndpointServiceNotFoundException { + return func() types.XksProxyVpcEndpointServiceNotFoundException { + + return types.XksProxyVpcEndpointServiceNotFoundException{ + Message: com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_FromDafny(dafnyOutput.Dtor_message().UnwrapOr(nil)), + } + }() + +} + +func OpaqueError_Output_FromDafny(dafnyOutput ComAmazonawsKmsTypes.Error) error { + responseSmithyOp, ok := dafnyOutput.Dtor_obj().(*smithy.OperationError) + if ok { + return responseSmithyOp + } + responseGenericErr, ok := dafnyOutput.Dtor_obj().(error) + if ok { + return responseGenericErr + } + panic("Invalid Error") +} + +func Error_FromDafny(err ComAmazonawsKmsTypes.Error) error { + // Service Errors + if err.Is_AlreadyExistsException() { + e := AlreadyExistsException_FromDafny(err) + return &e + } + + if err.Is_CloudHsmClusterInUseException() { + e := CloudHsmClusterInUseException_FromDafny(err) + return &e + } + + if err.Is_CloudHsmClusterInvalidConfigurationException() { + e := CloudHsmClusterInvalidConfigurationException_FromDafny(err) + return &e + } + + if err.Is_CloudHsmClusterNotActiveException() { + e := CloudHsmClusterNotActiveException_FromDafny(err) + return &e + } + + if err.Is_CloudHsmClusterNotFoundException() { + e := CloudHsmClusterNotFoundException_FromDafny(err) + return &e + } + + if err.Is_CloudHsmClusterNotRelatedException() { + e := CloudHsmClusterNotRelatedException_FromDafny(err) + return &e + } + + if err.Is_ConflictException() { + e := ConflictException_FromDafny(err) + return &e + } + + if err.Is_CustomKeyStoreHasCMKsException() { + e := CustomKeyStoreHasCMKsException_FromDafny(err) + return &e + } + + if err.Is_CustomKeyStoreInvalidStateException() { + e := CustomKeyStoreInvalidStateException_FromDafny(err) + return &e + } + + if err.Is_CustomKeyStoreNameInUseException() { + e := CustomKeyStoreNameInUseException_FromDafny(err) + return &e + } + + if err.Is_CustomKeyStoreNotFoundException() { + e := CustomKeyStoreNotFoundException_FromDafny(err) + return &e + } + + if err.Is_DependencyTimeoutException() { + e := DependencyTimeoutException_FromDafny(err) + return &e + } + + if err.Is_DisabledException() { + e := DisabledException_FromDafny(err) + return &e + } + + if err.Is_DryRunOperationException() { + e := DryRunOperationException_FromDafny(err) + return &e + } + + if err.Is_ExpiredImportTokenException() { + e := ExpiredImportTokenException_FromDafny(err) + return &e + } + + if err.Is_IncorrectKeyException() { + e := IncorrectKeyException_FromDafny(err) + return &e + } + + if err.Is_IncorrectKeyMaterialException() { + e := IncorrectKeyMaterialException_FromDafny(err) + return &e + } + + if err.Is_IncorrectTrustAnchorException() { + e := IncorrectTrustAnchorException_FromDafny(err) + return &e + } + + if err.Is_InvalidAliasNameException() { + e := InvalidAliasNameException_FromDafny(err) + return &e + } + + if err.Is_InvalidArnException() { + e := InvalidArnException_FromDafny(err) + return &e + } + + if err.Is_InvalidCiphertextException() { + e := InvalidCiphertextException_FromDafny(err) + return &e + } + + if err.Is_InvalidGrantIdException() { + e := InvalidGrantIdException_FromDafny(err) + return &e + } + + if err.Is_InvalidGrantTokenException() { + e := InvalidGrantTokenException_FromDafny(err) + return &e + } + + if err.Is_InvalidImportTokenException() { + e := InvalidImportTokenException_FromDafny(err) + return &e + } + + if err.Is_InvalidKeyUsageException() { + e := InvalidKeyUsageException_FromDafny(err) + return &e + } + + if err.Is_InvalidMarkerException() { + e := InvalidMarkerException_FromDafny(err) + return &e + } + + if err.Is_KeyUnavailableException() { + e := KeyUnavailableException_FromDafny(err) + return &e + } + + if err.Is_KMSInternalException() { + e := KMSInternalException_FromDafny(err) + return &e + } + + if err.Is_KMSInvalidMacException() { + e := KMSInvalidMacException_FromDafny(err) + return &e + } + + if err.Is_KMSInvalidSignatureException() { + e := KMSInvalidSignatureException_FromDafny(err) + return &e + } + + if err.Is_KMSInvalidStateException() { + e := KMSInvalidStateException_FromDafny(err) + return &e + } + + if err.Is_LimitExceededException() { + e := LimitExceededException_FromDafny(err) + return &e + } + + if err.Is_MalformedPolicyDocumentException() { + e := MalformedPolicyDocumentException_FromDafny(err) + return &e + } + + if err.Is_NotFoundException() { + e := NotFoundException_FromDafny(err) + return &e + } + + if err.Is_TagException() { + e := TagException_FromDafny(err) + return &e + } + + if err.Is_UnsupportedOperationException() { + e := UnsupportedOperationException_FromDafny(err) + return &e + } + + if err.Is_XksKeyAlreadyInUseException() { + e := XksKeyAlreadyInUseException_FromDafny(err) + return &e + } + + if err.Is_XksKeyInvalidConfigurationException() { + e := XksKeyInvalidConfigurationException_FromDafny(err) + return &e + } + + if err.Is_XksKeyNotFoundException() { + e := XksKeyNotFoundException_FromDafny(err) + return &e + } + + if err.Is_XksProxyIncorrectAuthenticationCredentialException() { + e := XksProxyIncorrectAuthenticationCredentialException_FromDafny(err) + return &e + } + + if err.Is_XksProxyInvalidConfigurationException() { + e := XksProxyInvalidConfigurationException_FromDafny(err) + return &e + } + + if err.Is_XksProxyInvalidResponseException() { + e := XksProxyInvalidResponseException_FromDafny(err) + return &e + } + + if err.Is_XksProxyUriEndpointInUseException() { + e := XksProxyUriEndpointInUseException_FromDafny(err) + return &e + } + + if err.Is_XksProxyUriInUseException() { + e := XksProxyUriInUseException_FromDafny(err) + return &e + } + + if err.Is_XksProxyUriUnreachableException() { + e := XksProxyUriUnreachableException_FromDafny(err) + return &e + } + + if err.Is_XksProxyVpcEndpointServiceInUseException() { + e := XksProxyVpcEndpointServiceInUseException_FromDafny(err) + return &e + } + + if err.Is_XksProxyVpcEndpointServiceInvalidConfigurationException() { + e := XksProxyVpcEndpointServiceInvalidConfigurationException_FromDafny(err) + return &e + } + + if err.Is_XksProxyVpcEndpointServiceNotFoundException() { + e := XksProxyVpcEndpointServiceNotFoundException_FromDafny(err) + return &e + } + + return OpaqueError_Output_FromDafny(err) +} + +func com_amazonaws_kms_CancelKeyDeletionInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CancelKeyDeletionOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ConnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateAliasInput_AliasName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateAliasInput_TargetKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_TrustAnchorCertificate_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_KeyStorePassword_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_CustomKeyStoreType_FromDafny(input interface{}) types.CustomKeyStoreType { + return func() types.CustomKeyStoreType { + var u types.CustomKeyStoreType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.CustomKeyStoreType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomKeyStoreType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(input interface{}) *types.XksProxyAuthenticationCredentialType { + return func() *types.XksProxyAuthenticationCredentialType { + if input == nil { + return nil + } + return &types.XksProxyAuthenticationCredentialType{ + AccessKeyId: com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_AccessKeyId()), + RawSecretAccessKey: com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_RawSecretAccessKey()), + } + }() +} +func com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { + return func() types.XksProxyConnectivityType { + var u types.XksProxyConnectivityType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CreateCustomKeyStoreOutput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_GranteePrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_RetiringPrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_Operations_FromDafny(input interface{}) []types.GrantOperation { + return func() []types.GrantOperation { + var fieldValue []types.GrantOperation + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantOperationList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GrantOperationList_member_FromDafny(input interface{}) types.GrantOperation { + return func() types.GrantOperation { + var u types.GrantOperation + + inputEnum := input.(ComAmazonawsKmsTypes.GrantOperation) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_GrantOperation_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.GrantOperation).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CreateGrantInput_Constraints_FromDafny(input interface{}) *types.GrantConstraints { + return func() *types.GrantConstraints { + if input == nil { + return nil + } + return &types.GrantConstraints{ + EncryptionContextSubset: com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextSubset().UnwrapOr(nil)), + EncryptionContextEquals: com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextEquals().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_EncryptionContextType_key_FromDafny(input interface{}) string { + return func() string { + var s string + if input == nil { + return s + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_EncryptionContextType_value_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_CreateGrantInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GrantTokenList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_Name_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_CreateGrantOutput_GrantToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateGrantOutput_GrantId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateKeyInput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateKeyInput_Description_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateKeyInput_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { + return func() types.KeyUsageType { + var u types.KeyUsageType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CreateKeyInput_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { + return func() types.CustomerMasterKeySpec { + var u types.CustomerMasterKeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CreateKeyInput_KeySpec_FromDafny(input interface{}) types.KeySpec { + return func() types.KeySpec { + var u types.KeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CreateKeyInput_Origin_FromDafny(input interface{}) types.OriginType { + return func() types.OriginType { + var u types.OriginType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.OriginType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CreateKeyInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_CreateKeyInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_TagList_member_FromDafny(input interface{}) types.Tag { + return func() types.Tag { + + return types.Tag{ + TagKey: com_amazonaws_kms_Tag_TagKey_FromDafny(input.(ComAmazonawsKmsTypes.Tag).Dtor_TagKey()), + TagValue: com_amazonaws_kms_Tag_TagValue_FromDafny(input.(ComAmazonawsKmsTypes.Tag).Dtor_TagValue()), + } + }() +} +func com_amazonaws_kms_Tag_TagKey_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_Tag_TagValue_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateKeyInput_MultiRegion_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_CreateKeyInput_XksKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CreateKeyOutput_KeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { + return func() *types.KeyMetadata { + if input == nil { + return nil + } + return &types.KeyMetadata{ + AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), + Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), + Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), + Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), + KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), + DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), + ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), + Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), + KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), + EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), + SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), + KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), + MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), + MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), + PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), + MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), + XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_KeyMetadata_Description_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { + return func() types.KeyUsageType { + var u types.KeyUsageType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input interface{}) types.KeyState { + return func() types.KeyState { + var u types.KeyState + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyState) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyState).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input interface{}) types.OriginType { + return func() types.OriginType { + var u types.OriginType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.OriginType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input interface{}) types.ExpirationModelType { + return func() types.ExpirationModelType { + var u types.ExpirationModelType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.ExpirationModelType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.ExpirationModelType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input interface{}) types.KeyManagerType { + return func() types.KeyManagerType { + var u types.KeyManagerType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyManagerType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyManagerType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyManagerType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { + return func() types.CustomerMasterKeySpec { + var u types.CustomerMasterKeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input interface{}) types.KeySpec { + return func() types.KeySpec { + var u types.KeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input interface{}) []types.EncryptionAlgorithmSpec { + return func() []types.EncryptionAlgorithmSpec { + var fieldValue []types.EncryptionAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input interface{}) []types.SigningAlgorithmSpec { + return func() []types.SigningAlgorithmSpec { + var fieldValue []types.SigningAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input interface{}) []types.KeyAgreementAlgorithmSpec { + return func() []types.KeyAgreementAlgorithmSpec { + var fieldValue []types.KeyAgreementAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { + return func() types.KeyAgreementAlgorithmSpec { + var u types.KeyAgreementAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input interface{}) *types.MultiRegionConfiguration { + return func() *types.MultiRegionConfiguration { + if input == nil { + return nil + } + return &types.MultiRegionConfiguration{ + MultiRegionKeyType: com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_MultiRegionKeyType().UnwrapOr(nil)), + PrimaryKey: com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_PrimaryKey().UnwrapOr(nil)), + ReplicaKeys: com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionConfiguration).Dtor_ReplicaKeys().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_MultiRegionConfiguration_MultiRegionKeyType_FromDafny(input interface{}) types.MultiRegionKeyType { + return func() types.MultiRegionKeyType { + var u types.MultiRegionKeyType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.MultiRegionKeyType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MultiRegionKeyType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MultiRegionKeyType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_MultiRegionConfiguration_PrimaryKey_FromDafny(input interface{}) *types.MultiRegionKey { + return func() *types.MultiRegionKey { + if input == nil { + return nil + } + return &types.MultiRegionKey{ + Arn: com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Arn().UnwrapOr(nil)), + Region: com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Region().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_MultiRegionConfiguration_ReplicaKeys_FromDafny(input interface{}) []types.MultiRegionKey { + return func() []types.MultiRegionKey { + var fieldValue []types.MultiRegionKey + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_MultiRegionKeyList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_MultiRegionKeyList_member_FromDafny(input interface{}) types.MultiRegionKey { + return func() types.MultiRegionKey { + + return types.MultiRegionKey{ + Arn: com_amazonaws_kms_MultiRegionKey_Arn_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Arn().UnwrapOr(nil)), + Region: com_amazonaws_kms_MultiRegionKey_Region_FromDafny(input.(ComAmazonawsKmsTypes.MultiRegionKey).Dtor_Region().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input interface{}) []types.MacAlgorithmSpec { + return func() []types.MacAlgorithmSpec { + var fieldValue []types.MacAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_MacAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_MacAlgorithmSpecList_member_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input interface{}) *types.XksKeyConfigurationType { + return func() *types.XksKeyConfigurationType { + if input == nil { + return nil + } + return &types.XksKeyConfigurationType{ + Id: com_amazonaws_kms_XksKeyConfigurationType_Id_FromDafny(input.(ComAmazonawsKmsTypes.XksKeyConfigurationType).Dtor_Id().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_XksKeyConfigurationType_Id_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DecryptInput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DecryptInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_DecryptInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_DecryptInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DecryptInput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_DecryptInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input interface{}) types.KeyEncryptionMechanism { + return func() types.KeyEncryptionMechanism { + var u types.KeyEncryptionMechanism + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyEncryptionMechanism) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyEncryptionMechanism_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyEncryptionMechanism).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DecryptInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_DecryptOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DecryptOutput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DecryptOutput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_DecryptOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DeleteAliasInput_AliasName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DeleteCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DeleteImportedKeyMaterialInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretInput_KeyAgreementAlgorithm_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { + return func() types.KeyAgreementAlgorithmSpec { + var u types.KeyAgreementAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_DeriveSharedSecretInput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_DeriveSharedSecretInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_DeriveSharedSecretInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretOutput_SharedSecret_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_DeriveSharedSecretOutput_KeyAgreementAlgorithm_FromDafny(input interface{}) types.KeyAgreementAlgorithmSpec { + return func() types.KeyAgreementAlgorithmSpec { + var u types.KeyAgreementAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyAgreementAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyAgreementAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_DeriveSharedSecretOutput_KeyOrigin_FromDafny(input interface{}) types.OriginType { + return func() types.OriginType { + var u types.OriginType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.OriginType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_OriginType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.OriginType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresInput_CustomKeyStoreName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresOutput_CustomKeyStores_FromDafny(input interface{}) []types.CustomKeyStoresListEntry { + return func() []types.CustomKeyStoresListEntry { + var fieldValue []types.CustomKeyStoresListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_CustomKeyStoresList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_CustomKeyStoresList_member_FromDafny(input interface{}) types.CustomKeyStoresListEntry { + return func() types.CustomKeyStoresListEntry { + + return types.CustomKeyStoresListEntry{ + CustomKeyStoreId: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CustomKeyStoreName: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreName().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + TrustAnchorCertificate: com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_TrustAnchorCertificate().UnwrapOr(nil)), + ConnectionState: com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_ConnectionState().UnwrapOr(nil)), + ConnectionErrorCode: com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_ConnectionErrorCode().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CreationDate().UnwrapOr(nil)), + CustomKeyStoreType: com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_CustomKeyStoreType().UnwrapOr(nil)), + XksProxyConfiguration: com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.CustomKeyStoresListEntry).Dtor_XksProxyConfiguration().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_CloudHsmClusterId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_TrustAnchorCertificate_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionState_FromDafny(input interface{}) types.ConnectionStateType { + return func() types.ConnectionStateType { + var u types.ConnectionStateType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.ConnectionStateType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionStateType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.ConnectionStateType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_ConnectionErrorCode_FromDafny(input interface{}) types.ConnectionErrorCodeType { + return func() types.ConnectionErrorCodeType { + var u types.ConnectionErrorCodeType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.ConnectionErrorCodeType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ConnectionErrorCodeType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.ConnectionErrorCodeType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_CustomKeyStoreType_FromDafny(input interface{}) types.CustomKeyStoreType { + return func() types.CustomKeyStoreType { + var u types.CustomKeyStoreType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.CustomKeyStoreType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomKeyStoreType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomKeyStoreType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_CustomKeyStoresListEntry_XksProxyConfiguration_FromDafny(input interface{}) *types.XksProxyConfigurationType { + return func() *types.XksProxyConfigurationType { + if input == nil { + return nil + } + return &types.XksProxyConfigurationType{ + Connectivity: com_amazonaws_kms_XksProxyConfigurationType_Connectivity_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_Connectivity().UnwrapOr(nil)), + AccessKeyId: com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_AccessKeyId().UnwrapOr(nil)), + UriEndpoint: com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_UriEndpoint().UnwrapOr(nil)), + UriPath: com_amazonaws_kms_XksProxyConfigurationType_UriPath_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_UriPath().UnwrapOr(nil)), + VpcEndpointServiceName: com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyConfigurationType).Dtor_VpcEndpointServiceName().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_XksProxyConfigurationType_Connectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { + return func() types.XksProxyConnectivityType { + var u types.XksProxyConnectivityType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_XksProxyConfigurationType_AccessKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyConfigurationType_UriEndpoint_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyConfigurationType_UriPath_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyConfigurationType_VpcEndpointServiceName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DescribeCustomKeyStoresOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_DescribeKeyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DescribeKeyInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_DescribeKeyOutput_KeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { + return func() *types.KeyMetadata { + if input == nil { + return nil + } + return &types.KeyMetadata{ + AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), + Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), + Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), + Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), + KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), + DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), + ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), + Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), + KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), + EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), + SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), + KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), + MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), + MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), + PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), + MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), + XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_DisableKeyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DisableKeyRotationInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DisconnectCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_EnableKeyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_EnableKeyRotationInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_EnableKeyRotationInput_RotationPeriodInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_EncryptInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_EncryptInput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_EncryptInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_EncryptInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_EncryptInput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_EncryptInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_EncryptOutput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_EncryptOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_EncryptOutput_EncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_NumberOfBytes_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_KeySpec_FromDafny(input interface{}) types.DataKeySpec { + return func() types.DataKeySpec { + var u types.DataKeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GenerateDataKeyInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_GenerateDataKeyOutput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyOutput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyCiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_PrivateKeyPlaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyPairOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PrivateKeyCiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextOutput_KeyPairSpec_FromDafny(input interface{}) types.DataKeyPairSpec { + return func() types.DataKeyPairSpec { + var u types.DataKeyPairSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeyPairSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeyPairSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeyPairSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_EncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_KeySpec_FromDafny(input interface{}) types.DataKeySpec { + return func() types.DataKeySpec { + var u types.DataKeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.DataKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_DataKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.DataKeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_NumberOfBytes_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateDataKeyWithoutPlaintextOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateMacInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateMacInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateMacInput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateMacInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GenerateMacInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_GenerateMacOutput_Mac_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateMacOutput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GenerateMacOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateRandomInput_NumberOfBytes_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_GenerateRandomInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GenerateRandomInput_Recipient_FromDafny(input interface{}) *types.RecipientInfo { + return func() *types.RecipientInfo { + if input == nil { + return nil + } + return &types.RecipientInfo{ + KeyEncryptionAlgorithm: com_amazonaws_kms_RecipientInfo_KeyEncryptionAlgorithm_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_KeyEncryptionAlgorithm().UnwrapOr(nil)), + AttestationDocument: com_amazonaws_kms_RecipientInfo_AttestationDocument_FromDafny(input.(ComAmazonawsKmsTypes.RecipientInfo).Dtor_AttestationDocument().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GenerateRandomOutput_Plaintext_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GenerateRandomOutput_CiphertextForRecipient_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GetKeyPolicyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetKeyPolicyInput_PolicyName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetKeyPolicyOutput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetKeyPolicyOutput_PolicyName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetKeyRotationStatusInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetKeyRotationStatusOutput_KeyRotationEnabled_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_GetKeyRotationStatusOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetKeyRotationStatusOutput_RotationPeriodInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_GetKeyRotationStatusOutput_NextRotationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_GetKeyRotationStatusOutput_OnDemandRotationStartDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_GetParametersForImportInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetParametersForImportInput_WrappingAlgorithm_FromDafny(input interface{}) types.AlgorithmSpec { + return func() types.AlgorithmSpec { + var u types.AlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.AlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_AlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.AlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetParametersForImportInput_WrappingKeySpec_FromDafny(input interface{}) types.WrappingKeySpec { + return func() types.WrappingKeySpec { + var u types.WrappingKeySpec + + inputEnum := input.(ComAmazonawsKmsTypes.WrappingKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_WrappingKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.WrappingKeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetParametersForImportOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetParametersForImportOutput_ImportToken_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GetParametersForImportOutput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GetParametersForImportOutput_ParametersValidTo_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_GetPublicKeyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetPublicKeyInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_PublicKey_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_CustomerMasterKeySpec_FromDafny(input interface{}) types.CustomerMasterKeySpec { + return func() types.CustomerMasterKeySpec { + var u types.CustomerMasterKeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.CustomerMasterKeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_CustomerMasterKeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.CustomerMasterKeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_KeySpec_FromDafny(input interface{}) types.KeySpec { + return func() types.KeySpec { + var u types.KeySpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeySpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeySpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeySpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_KeyUsage_FromDafny(input interface{}) types.KeyUsageType { + return func() types.KeyUsageType { + var u types.KeyUsageType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyUsageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyUsageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyUsageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_EncryptionAlgorithms_FromDafny(input interface{}) []types.EncryptionAlgorithmSpec { + return func() []types.EncryptionAlgorithmSpec { + var fieldValue []types.EncryptionAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_EncryptionAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_SigningAlgorithms_FromDafny(input interface{}) []types.SigningAlgorithmSpec { + return func() []types.SigningAlgorithmSpec { + var fieldValue []types.SigningAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_SigningAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GetPublicKeyOutput_KeyAgreementAlgorithms_FromDafny(input interface{}) []types.KeyAgreementAlgorithmSpec { + return func() []types.KeyAgreementAlgorithmSpec { + var fieldValue []types.KeyAgreementAlgorithmSpec + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_KeyAgreementAlgorithmSpecList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_ImportKeyMaterialInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ImportKeyMaterialInput_ImportToken_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_ImportKeyMaterialInput_EncryptedKeyMaterial_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_ImportKeyMaterialInput_ValidTo_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_ImportKeyMaterialInput_ExpirationModel_FromDafny(input interface{}) types.ExpirationModelType { + return func() types.ExpirationModelType { + var u types.ExpirationModelType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.ExpirationModelType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_ExpirationModelType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.ExpirationModelType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ListAliasesInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListAliasesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListAliasesInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListAliasesOutput_Aliases_FromDafny(input interface{}) []types.AliasListEntry { + return func() []types.AliasListEntry { + var fieldValue []types.AliasListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_AliasList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_AliasList_member_FromDafny(input interface{}) types.AliasListEntry { + return func() types.AliasListEntry { + + return types.AliasListEntry{ + AliasName: com_amazonaws_kms_AliasListEntry_AliasName_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_AliasName().UnwrapOr(nil)), + AliasArn: com_amazonaws_kms_AliasListEntry_AliasArn_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_AliasArn().UnwrapOr(nil)), + TargetKeyId: com_amazonaws_kms_AliasListEntry_TargetKeyId_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_TargetKeyId().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_AliasListEntry_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_CreationDate().UnwrapOr(nil)), + LastUpdatedDate: com_amazonaws_kms_AliasListEntry_LastUpdatedDate_FromDafny(input.(ComAmazonawsKmsTypes.AliasListEntry).Dtor_LastUpdatedDate().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_AliasListEntry_AliasName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_AliasListEntry_AliasArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_AliasListEntry_TargetKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_AliasListEntry_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_AliasListEntry_LastUpdatedDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_ListAliasesOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListAliasesOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListGrantsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListGrantsInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListGrantsInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListGrantsInput_GrantId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListGrantsInput_GranteePrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListGrantsOutput_Grants_FromDafny(input interface{}) []types.GrantListEntry { + return func() []types.GrantListEntry { + var fieldValue []types.GrantListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GrantList_member_FromDafny(input interface{}) types.GrantListEntry { + return func() types.GrantListEntry { + + return types.GrantListEntry{ + KeyId: com_amazonaws_kms_GrantListEntry_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_KeyId().UnwrapOr(nil)), + GrantId: com_amazonaws_kms_GrantListEntry_GrantId_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_GrantId().UnwrapOr(nil)), + Name: com_amazonaws_kms_GrantListEntry_Name_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_Name().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_GrantListEntry_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_CreationDate().UnwrapOr(nil)), + GranteePrincipal: com_amazonaws_kms_GrantListEntry_GranteePrincipal_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_GranteePrincipal().UnwrapOr(nil)), + RetiringPrincipal: com_amazonaws_kms_GrantListEntry_RetiringPrincipal_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_RetiringPrincipal().UnwrapOr(nil)), + IssuingAccount: com_amazonaws_kms_GrantListEntry_IssuingAccount_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_IssuingAccount().UnwrapOr(nil)), + Operations: com_amazonaws_kms_GrantListEntry_Operations_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_Operations().UnwrapOr(nil)), + Constraints: com_amazonaws_kms_GrantListEntry_Constraints_FromDafny(input.(ComAmazonawsKmsTypes.GrantListEntry).Dtor_Constraints().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_GrantListEntry_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GrantListEntry_GrantId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GrantListEntry_Name_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GrantListEntry_CreationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_GrantListEntry_GranteePrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GrantListEntry_RetiringPrincipal_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GrantListEntry_IssuingAccount_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_GrantListEntry_Operations_FromDafny(input interface{}) []types.GrantOperation { + return func() []types.GrantOperation { + var fieldValue []types.GrantOperation + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantOperationList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_GrantListEntry_Constraints_FromDafny(input interface{}) *types.GrantConstraints { + return func() *types.GrantConstraints { + if input == nil { + return nil + } + return &types.GrantConstraints{ + EncryptionContextSubset: com_amazonaws_kms_GrantConstraints_EncryptionContextSubset_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextSubset().UnwrapOr(nil)), + EncryptionContextEquals: com_amazonaws_kms_GrantConstraints_EncryptionContextEquals_FromDafny(input.(ComAmazonawsKmsTypes.GrantConstraints).Dtor_EncryptionContextEquals().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_ListGrantsOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListGrantsOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListKeyPoliciesInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeyPoliciesInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListKeyPoliciesInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeyPoliciesOutput_PolicyNames_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_PolicyNameList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_PolicyNameList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeyPoliciesOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeyPoliciesOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListKeyRotationsInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeyRotationsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListKeyRotationsInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeyRotationsOutput_Rotations_FromDafny(input interface{}) []types.RotationsListEntry { + return func() []types.RotationsListEntry { + var fieldValue []types.RotationsListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_RotationsList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_RotationsList_member_FromDafny(input interface{}) types.RotationsListEntry { + return func() types.RotationsListEntry { + + return types.RotationsListEntry{ + KeyId: com_amazonaws_kms_RotationsListEntry_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_KeyId().UnwrapOr(nil)), + RotationDate: com_amazonaws_kms_RotationsListEntry_RotationDate_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_RotationDate().UnwrapOr(nil)), + RotationType: com_amazonaws_kms_RotationsListEntry_RotationType_FromDafny(input.(ComAmazonawsKmsTypes.RotationsListEntry).Dtor_RotationType().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_RotationsListEntry_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RotationsListEntry_RotationDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_RotationsListEntry_RotationType_FromDafny(input interface{}) types.RotationType { + return func() types.RotationType { + var u types.RotationType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.RotationType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_RotationType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.RotationType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ListKeyRotationsOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeyRotationsOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListKeysInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListKeysInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeysOutput_Keys_FromDafny(input interface{}) []types.KeyListEntry { + return func() []types.KeyListEntry { + var fieldValue []types.KeyListEntry + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_KeyList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_KeyList_member_FromDafny(input interface{}) types.KeyListEntry { + return func() types.KeyListEntry { + + return types.KeyListEntry{ + KeyId: com_amazonaws_kms_KeyListEntry_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyListEntry).Dtor_KeyId().UnwrapOr(nil)), + KeyArn: com_amazonaws_kms_KeyListEntry_KeyArn_FromDafny(input.(ComAmazonawsKmsTypes.KeyListEntry).Dtor_KeyArn().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_KeyListEntry_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyListEntry_KeyArn_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeysOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListKeysOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ListResourceTagsInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListResourceTagsInput_Limit_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ListResourceTagsInput_Marker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListResourceTagsOutput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_ListResourceTagsOutput_NextMarker_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ListResourceTagsOutput_Truncated_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_PutKeyPolicyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_PutKeyPolicyInput_PolicyName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_PutKeyPolicyInput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_PutKeyPolicyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ReEncryptInput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_ReEncryptInput_SourceEncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_ReEncryptInput_SourceKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReEncryptInput_DestinationKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReEncryptInput_DestinationEncryptionContext_FromDafny(input interface{}) map[string]string { + return func() map[string]string { + var m map[string]string = make(map[string]string) + if input == nil { + return nil + } + + for i := dafny.Iterate(input.(dafny.Map).Items()); ; { + val, ok := i() + if !ok { + break + } + m[com_amazonaws_kms_EncryptionContextType_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = com_amazonaws_kms_EncryptionContextType_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) + } + return m + }() +} +func com_amazonaws_kms_ReEncryptInput_SourceEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ReEncryptInput_DestinationEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ReEncryptInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_ReEncryptInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_ReEncryptOutput_CiphertextBlob_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_ReEncryptOutput_SourceKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReEncryptOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReEncryptOutput_SourceEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ReEncryptOutput_DestinationEncryptionAlgorithm_FromDafny(input interface{}) types.EncryptionAlgorithmSpec { + return func() types.EncryptionAlgorithmSpec { + var u types.EncryptionAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ReplicateKeyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReplicateKeyInput_ReplicaRegion_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReplicateKeyInput_Policy_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReplicateKeyInput_BypassPolicyLockoutSafetyCheck_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_ReplicateKeyInput_Description_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReplicateKeyInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_ReplicateKeyOutput_ReplicaKeyMetadata_FromDafny(input interface{}) *types.KeyMetadata { + return func() *types.KeyMetadata { + if input == nil { + return nil + } + return &types.KeyMetadata{ + AWSAccountId: com_amazonaws_kms_KeyMetadata_AWSAccountId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_AWSAccountId().UnwrapOr(nil)), + KeyId: com_amazonaws_kms_KeyMetadata_KeyId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyId()), + Arn: com_amazonaws_kms_KeyMetadata_Arn_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Arn().UnwrapOr(nil)), + CreationDate: com_amazonaws_kms_KeyMetadata_CreationDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CreationDate().UnwrapOr(nil)), + Enabled: com_amazonaws_kms_KeyMetadata_Enabled_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Enabled().UnwrapOr(nil)), + Description: com_amazonaws_kms_KeyMetadata_Description_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Description().UnwrapOr(nil)), + KeyUsage: com_amazonaws_kms_KeyMetadata_KeyUsage_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyUsage().UnwrapOr(nil)), + KeyState: com_amazonaws_kms_KeyMetadata_KeyState_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyState().UnwrapOr(nil)), + DeletionDate: com_amazonaws_kms_KeyMetadata_DeletionDate_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_DeletionDate().UnwrapOr(nil)), + ValidTo: com_amazonaws_kms_KeyMetadata_ValidTo_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ValidTo().UnwrapOr(nil)), + Origin: com_amazonaws_kms_KeyMetadata_Origin_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_Origin().UnwrapOr(nil)), + CustomKeyStoreId: com_amazonaws_kms_KeyMetadata_CustomKeyStoreId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomKeyStoreId().UnwrapOr(nil)), + CloudHsmClusterId: com_amazonaws_kms_KeyMetadata_CloudHsmClusterId_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CloudHsmClusterId().UnwrapOr(nil)), + ExpirationModel: com_amazonaws_kms_KeyMetadata_ExpirationModel_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_ExpirationModel().UnwrapOr(nil)), + KeyManager: com_amazonaws_kms_KeyMetadata_KeyManager_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyManager().UnwrapOr(nil)), + CustomerMasterKeySpec: com_amazonaws_kms_KeyMetadata_CustomerMasterKeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_CustomerMasterKeySpec().UnwrapOr(nil)), + KeySpec: com_amazonaws_kms_KeyMetadata_KeySpec_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeySpec().UnwrapOr(nil)), + EncryptionAlgorithms: com_amazonaws_kms_KeyMetadata_EncryptionAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_EncryptionAlgorithms().UnwrapOr(nil)), + SigningAlgorithms: com_amazonaws_kms_KeyMetadata_SigningAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_SigningAlgorithms().UnwrapOr(nil)), + KeyAgreementAlgorithms: com_amazonaws_kms_KeyMetadata_KeyAgreementAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_KeyAgreementAlgorithms().UnwrapOr(nil)), + MultiRegion: com_amazonaws_kms_KeyMetadata_MultiRegion_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegion().UnwrapOr(nil)), + MultiRegionConfiguration: com_amazonaws_kms_KeyMetadata_MultiRegionConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MultiRegionConfiguration().UnwrapOr(nil)), + PendingDeletionWindowInDays: com_amazonaws_kms_KeyMetadata_PendingDeletionWindowInDays_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_PendingDeletionWindowInDays().UnwrapOr(nil)), + MacAlgorithms: com_amazonaws_kms_KeyMetadata_MacAlgorithms_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_MacAlgorithms().UnwrapOr(nil)), + XksKeyConfiguration: com_amazonaws_kms_KeyMetadata_XksKeyConfiguration_FromDafny(input.(ComAmazonawsKmsTypes.KeyMetadata).Dtor_XksKeyConfiguration().UnwrapOr(nil)), + } + }() +} +func com_amazonaws_kms_ReplicateKeyOutput_ReplicaPolicy_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ReplicateKeyOutput_ReplicaTags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_RetireGrantInput_GrantToken_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RetireGrantInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RetireGrantInput_GrantId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RetireGrantInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_RevokeGrantInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RevokeGrantInput_GrantId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RevokeGrantInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_RotateKeyOnDemandInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_RotateKeyOnDemandOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionInput_PendingWindowInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionOutput_DeletionDate_FromDafny(input interface{}) *time.Time { + return func() *time.Time { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } else { + s = s + string(val.(dafny.Char)) + } + } + if len(s) == 0 { + panic("timestamp string is empty") + } else { + t, err := time.Parse("2006-01-02T15:04:05.999999Z", s) + if err != nil { + panic(err) + } + return &t + } + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionOutput_KeyState_FromDafny(input interface{}) types.KeyState { + return func() types.KeyState { + var u types.KeyState + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.KeyState) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_KeyState_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.KeyState).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_ScheduleKeyDeletionOutput_PendingWindowInDays_FromDafny(input interface{}) *int32 { + return func() *int32 { + var i int32 + if input == nil { + return nil + } + i = input.(int32) + return &i + }() +} +func com_amazonaws_kms_SignInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_SignInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_SignInput_MessageType_FromDafny(input interface{}) types.MessageType { + return func() types.MessageType { + var u types.MessageType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.MessageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MessageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_SignInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_SignInput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_SignInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_SignOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_SignOutput_Signature_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_SignOutput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_TagResourceInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_TagResourceInput_Tags_FromDafny(input interface{}) []types.Tag { + return func() []types.Tag { + var fieldValue []types.Tag + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_TagList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_UntagResourceInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UntagResourceInput_TagKeys_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_TagKeyList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_TagKeyList_member_FromDafny(input interface{}) string { + return func() string { + var s string + + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return []string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateAliasInput_AliasName_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateAliasInput_TargetKeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_CustomKeyStoreId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_NewCustomKeyStoreName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_KeyStorePassword_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_CloudHsmClusterId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriEndpoint_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyUriPath_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyVpcEndpointServiceName_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyAuthenticationCredential_FromDafny(input interface{}) *types.XksProxyAuthenticationCredentialType { + return func() *types.XksProxyAuthenticationCredentialType { + if input == nil { + return nil + } + return &types.XksProxyAuthenticationCredentialType{ + AccessKeyId: com_amazonaws_kms_XksProxyAuthenticationCredentialType_AccessKeyId_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_AccessKeyId()), + RawSecretAccessKey: com_amazonaws_kms_XksProxyAuthenticationCredentialType_RawSecretAccessKey_FromDafny(input.(ComAmazonawsKmsTypes.XksProxyAuthenticationCredentialType).Dtor_RawSecretAccessKey()), + } + }() +} +func com_amazonaws_kms_UpdateCustomKeyStoreInput_XksProxyConnectivity_FromDafny(input interface{}) types.XksProxyConnectivityType { + return func() types.XksProxyConnectivityType { + var u types.XksProxyConnectivityType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.XksProxyConnectivityType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_XksProxyConnectivityType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.XksProxyConnectivityType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_UpdateKeyDescriptionInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdateKeyDescriptionInput_Description_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdatePrimaryRegionInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UpdatePrimaryRegionInput_PrimaryRegion_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_VerifyInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_VerifyInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_VerifyInput_MessageType_FromDafny(input interface{}) types.MessageType { + return func() types.MessageType { + var u types.MessageType + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.MessageType) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MessageType_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MessageType).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_VerifyInput_Signature_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_VerifyInput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_VerifyInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_VerifyInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_VerifyOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_VerifyOutput_SignatureValid_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_VerifyOutput_SigningAlgorithm_FromDafny(input interface{}) types.SigningAlgorithmSpec { + return func() types.SigningAlgorithmSpec { + var u types.SigningAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.SigningAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_SigningAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.SigningAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_VerifyMacInput_Message_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_VerifyMacInput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_VerifyMacInput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_VerifyMacInput_Mac_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil + } + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return b + } else { + b = append(b, val.(byte)) + } + } + }() +} +func com_amazonaws_kms_VerifyMacInput_GrantTokens_FromDafny(input interface{}) []string { + return func() []string { + var fieldValue []string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence).(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, com_amazonaws_kms_GrantTokenList_member_FromDafny(val)) + } + return fieldValue + }() +} +func com_amazonaws_kms_VerifyMacInput_DryRun_FromDafny(input interface{}) *bool { + return func() *bool { + var b bool + if input == nil { + return nil + } + b = input.(bool) + return &b + }() +} +func com_amazonaws_kms_VerifyMacOutput_KeyId_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_VerifyMacOutput_MacValid_FromDafny(input interface{}) bool { + return func() bool { + var b bool + if input == nil { + return b + } + b = input.(bool) + return b + }() +} +func com_amazonaws_kms_VerifyMacOutput_MacAlgorithm_FromDafny(input interface{}) types.MacAlgorithmSpec { + return func() types.MacAlgorithmSpec { + var u types.MacAlgorithmSpec + if input == nil { + return u + } + + inputEnum := input.(ComAmazonawsKmsTypes.MacAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_MacAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.MacAlgorithmSpec).Equals(inputEnum) { + break + } + } + } + return u.Values()[index] + }() +} +func com_amazonaws_kms_AlreadyExistsException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CloudHsmClusterInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CloudHsmClusterNotActiveException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CloudHsmClusterNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CloudHsmClusterNotRelatedException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ConflictException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoreHasCMKsException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoreInvalidStateException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoreNameInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_CustomKeyStoreNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DependencyTimeoutException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DisabledException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_DryRunOperationException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_ExpiredImportTokenException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_IncorrectKeyException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_IncorrectKeyMaterialException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_IncorrectTrustAnchorException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidAliasNameException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidArnException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidCiphertextException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidGrantIdException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidGrantTokenException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidImportTokenException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidKeyUsageException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_InvalidMarkerException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KeyUnavailableException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KMSInternalException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KMSInvalidMacException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KMSInvalidSignatureException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_KMSInvalidStateException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_LimitExceededException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_MalformedPolicyDocumentException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_NotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_TagException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_UnsupportedOperationException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksKeyAlreadyInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksKeyInvalidConfigurationException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksKeyNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyInvalidConfigurationException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyInvalidResponseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyUriEndpointInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyUriInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyUriUnreachableException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException_message_FromDafny(input interface{}) *string { + return func() *string { + var s string + if input == nil { + return nil + } + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + return &[]string{s}[0] + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go index af6ddfde9..1c28744a2 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go @@ -117,26 +117,71 @@ func KeyVectorsConfig_ToDafny(nativeInput awscryptographymaterialproviderstestve } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { + return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { + + switch input.(type) { + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_HierarchyKeyring_.Create_HierarchyKeyring_(aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input.KeyId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KMSInfo_.Create_KMSInfo_(aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input.KeyId))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAware_.Create_KmsMrkAware_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_ToDafny(input.KeyId))) }() } @@ -147,69 +192,69 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_ToDafny( }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAwareDiscovery_.Create_KmsMrkAwareDiscovery_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input.DefaultMrkRegion), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input.AwsKmsDiscoveryFilter))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - switch input.(type) { - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + }() +} - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } +func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawRSA_.Create_RawRSA_(aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input.ProviderId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input.Padding))) + }() +} + func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { @@ -217,10 +262,53 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { + return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsRsaKeyring_.Create_KmsRsaKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input.EncryptionAlgorithm))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawAES_.Create_RawAES_(aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input.ProviderId))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } @@ -238,147 +326,225 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_ToDafn }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_MultiKeyring_.Create_MultiKeyring_(aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input.Generator), aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input.ChildKeyrings))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_StaticKeyring_.Create_StaticKeyring_(aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input.KeyId))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsRsaKeyring_.Create_KmsRsaKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input.EncryptionAlgorithm))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return dafny.SeqOf(fieldValue...) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsEcdhKeyring_.Create_KmsEcdhKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input.SenderKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input.RecipientKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input.RecipientPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input.CurveSpec), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input.KeyAgreementScheme))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { - return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - switch input.(type) { - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM)) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} - default: - panic("Unhandled union type") - } +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawAES_.Create_RawAES_(aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input.ProviderId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_HierarchyKeyring_.Create_HierarchyKeyring_(aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input.KeyId))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_MultiKeyring_.Create_MultiKeyring_(aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input.Generator), aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input.ChildKeyrings))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + switch input.(type) { + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM))) + + default: + panic("Unhandled union type") } - return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KMSInfo_.Create_KMSInfo_(aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input.KeyId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RequiredEncryptionContextCMM_.Create_RequiredEncryptionContextCMM_(aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input.Underlying), aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -425,28 +591,46 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_ke }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RequiredEncryptionContextCMM_.Create_RequiredEncryptionContextCMM_(aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input.Underlying), aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys))) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsEcdhKeyring_.Create_KmsEcdhKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input.SenderKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input.RecipientKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input.RecipientPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input.CurveSpec), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input.KeyAgreementScheme))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -493,42 +677,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextC }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawRSA_.Create_RawRSA_(aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input.ProviderId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input.Padding))) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAware_.Create_KmsMrkAware_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_ToDafny(input.KeyId))) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -575,13 +724,6 @@ func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInp }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOperation_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation) AwsCryptographyMaterialProvidersTestVectorKeysTypes.CmmOperation { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.CmmOperation { @@ -604,64 +746,20 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOper }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { - return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + var v []interface{} + if input == nil { + return nil } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_StaticKeyring_.Create_StaticKeyring_(aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input.KeyId))) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -708,69 +806,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_key }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) dafny.Sequence { - return func() dafny.Sequence { - - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -817,14 +853,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAwareDiscovery_.Create_KmsMrkAwareDiscovery_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input.DefaultMrkRegion), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input.AwsKmsDiscoveryFilter))) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -837,43 +866,14 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_jso }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - }() -} - -func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go index 1749e5845..3cb1f4b11 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go @@ -108,61 +108,8 @@ func KeyVectorsConfig_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTest } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring).Dtor_keyId())} -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription - if input == nil { - return nil - } if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -229,18 +176,370 @@ func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_Fro union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti{ Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_Multi())), } - } - if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { + } + if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { + + union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ + Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), + } + } + + return union + +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_keyId()), + DefaultMrkRegion: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_defaultMrkRegion()), + AwsKmsDiscoveryFilter: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_awsKmsDiscoveryFilter().UnwrapOr(nil)), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil + } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), + } +} +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_keyId()), + ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_providerId()), + Padding: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_padding()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_keyId()), + ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_providerId()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderKeyId()), + RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientKeyId()), + SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderPublicKey()), + RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientPublicKey()), + ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_providerId()), + CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_curveSpec()), + KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_keyAgreementScheme()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_keyId()), + EncryptionAlgorithm: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_encryptionAlgorithm()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input interface{}) kmstypes.EncryptionAlgorithmSpec { + return func() kmstypes.EncryptionAlgorithmSpec { + var u kmstypes.EncryptionAlgorithmSpec + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } - union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ - Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), - } + return u.Values()[index] + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderKeyId()), + RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientKeyId()), + SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderPublicKey()), + RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientPublicKey()), + CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_curveSpec()), + KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_keyAgreementScheme()), } - - return union - } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -253,7 +552,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPubli } }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -266,22 +565,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(inp } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_keyId()), - EncryptionAlgorithm: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_encryptionAlgorithm()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderKeyId()), - RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientKeyId()), - SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderPublicKey()), - RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientPublicKey()), - ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_providerId()), - CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_curveSpec()), - KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_keyAgreementScheme()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -294,7 +578,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDa } }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -307,39 +591,36 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(inp } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring{Generator: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_generator().UnwrapOr(nil)), - ChildKeyrings: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_childKeyrings()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) - } - return fieldValue + }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -352,8 +633,16 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPu } }() } -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring{Generator: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_generator().UnwrapOr(nil)), + ChildKeyrings: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_childKeyrings()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription + if input == nil { + return nil + } if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -431,65 +720,12 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDesc return union } -func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_keyId()), - ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_providerId()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM{Underlying: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_underlying()), + RequiredEncryptionContextKeys: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_requiredEncryptionContextKeys()), } - return fieldValue -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo).Dtor_keyId())} } -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -568,7 +804,18 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_ke return union } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -576,26 +823,29 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM{Underlying: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_underlying()), - RequiredEncryptionContextKeys: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_requiredEncryptionContextKeys()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderKeyId()), - RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientKeyId()), - SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderPublicKey()), - RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientPublicKey()), - CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_curveSpec()), - KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_keyAgreementScheme()), +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { + fieldValue := make([]awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(val)) } + return fieldValue } -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -659,70 +909,22 @@ func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextC } } if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Multi() { - - union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti{ - Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_Multi())), - } - } - if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { - - union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ - Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), - } - } - - return union - -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_keyId()), - ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_providerId()), - Padding: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_padding()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } + + union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti{ + Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_Multi())), } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware).Dtor_keyId())} -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } + } + if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { + + union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ + Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), } - }() + } + + return union + } -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -801,19 +1003,6 @@ func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInp return union } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOperation_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation { return func() awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation { var u awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation @@ -832,80 +1021,23 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOper return u.Values()[index] }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input interface{}) string { - return func() string { - var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring).Dtor_keyId())} -} -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -984,102 +1116,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_key return union } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { - fieldValue := make([]awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -1158,13 +1195,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ return union } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_keyId()), - DefaultMrkRegion: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_defaultMrkRegion()), - AwsKmsDiscoveryFilter: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_awsKmsDiscoveryFilter().UnwrapOr(nil)), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1180,20 +1211,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_jso } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1206,25 +1224,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_Fro } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input interface{}) kmstypes.EncryptionAlgorithmSpec { - return func() kmstypes.EncryptionAlgorithmSpec { - var u kmstypes.EncryptionAlgorithmSpec - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go index 9f09ea74d..39340e755 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go @@ -646,6 +646,15 @@ func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_KeyDe return nil } +func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_Validate() error { + for _, item := range input.ChildKeyrings { + if input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) != nil { + return input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) + } + } + + return nil +} func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_Validate() error { if input.Generator == nil { return nil @@ -706,15 +715,6 @@ func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_Multi return nil } -func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_Validate() error { - for _, item := range input.ChildKeyrings { - if input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) != nil { - return input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) - } - } - - return nil -} type KeyVectorsConfig struct { KeyManifestPath string @@ -734,8 +734,8 @@ func (input KeyVectorsConfig) Validate() error { // KeyDescriptionMemberKmsMrkDiscovery // KeyDescriptionMemberKmsRsa // KeyDescriptionMemberMulti -// KeyDescriptionMemberRequiredEncryptionContext // KeyDescriptionMemberRSA +// KeyDescriptionMemberRequiredEncryptionContext // KeyDescriptionMemberStatic type KeyDescription interface { isKeyDescription() diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go index af6ddfde9..1c28744a2 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_dafny.go @@ -117,26 +117,71 @@ func KeyVectorsConfig_ToDafny(nativeInput awscryptographymaterialproviderstestve } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { + return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { + + switch input.(type) { + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring)) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) + return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM)) + + default: + panic("Unhandled union type") + } + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_HierarchyKeyring_.Create_HierarchyKeyring_(aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input.KeyId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KMSInfo_.Create_KMSInfo_(aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input.KeyId))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware) Wrappers.Option { return func() Wrappers.Option { - if input == nil { - return Wrappers.Companion_Option_.Create_None_() - } - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAware_.Create_KmsMrkAware_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_ToDafny(input.KeyId))) }() } @@ -147,69 +192,69 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_ToDafny( }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAwareDiscovery_.Create_KmsMrkAwareDiscovery_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input.DefaultMrkRegion), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input.AwsKmsDiscoveryFilter))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter) Wrappers.Option { return func() Wrappers.Option { if input == nil { return Wrappers.Companion_Option_.Create_None_() } - switch input.(type) { - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring))) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTypes.Companion_DiscoveryFilter_.Create_DiscoveryFilter_(aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input.AccountIds), aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input.Partition))) + }() +} - default: - panic("Unhandled union type") +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { + return func() dafny.Sequence { + + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) + fieldValue = append(fieldValue, element) } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } +func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawRSA_.Create_RawRSA_(aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input.ProviderId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input.Padding))) + }() +} + func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { @@ -217,10 +262,53 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { + return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } + } + var enum interface{} + for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsRsaKeyring_.Create_KmsRsaKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input.EncryptionAlgorithm))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawAES_.Create_RawAES_(aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input.ProviderId))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } @@ -238,147 +326,225 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_ToDafn }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_MultiKeyring_.Create_MultiKeyring_(aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input.Generator), aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input.ChildKeyrings))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_StaticKeyring_.Create_StaticKeyring_(aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input.KeyId))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var v []interface{} - if input == nil { - return nil - } - for _, e := range input { - v = append(v, e) - } - return dafny.SeqOf(v...) + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsRsaKeyring_.Create_KmsRsaKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input.EncryptionAlgorithm))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_AccountIdList_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { + + var index int + for _, enumVal := range input.Values() { + index++ + if enumVal == input { + break + } } - return dafny.SeqOf(fieldValue...) + var enum interface{} + for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { + var ok bool + enum, ok = allEnums() + if !ok { + break + } + } + return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsEcdhKeyring_.Create_KmsEcdhKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input.SenderKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input.RecipientKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input.RecipientPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input.CurveSpec), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input.KeyAgreementScheme))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { - return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - switch input.(type) { - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring)) - case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: - var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) - return AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM)) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} - default: - panic("Unhandled union type") - } +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { + + return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProviders_DiscoveryFilter_partition_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawAES_.Create_RawAES_(aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input.ProviderId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_HierarchyKeyring_.Create_HierarchyKeyring_(aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input.KeyId))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) - fieldValue = append(fieldValue, element) + return dafny.SeqOfChars([]dafny.Char(input)...) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring) Wrappers.Option { + return func() Wrappers.Option { + + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_MultiKeyring_.Create_MultiKeyring_(aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input.Generator), aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input.ChildKeyrings))) + }() +} + +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) Wrappers.Option { + return func() Wrappers.Option { + if input == nil { + return Wrappers.Companion_Option_.Create_None_() + } + switch input.(type) { + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKms).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Kms_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrk).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrk_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsMrkDiscovery).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsMrkDiscovery_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRSA).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RSA_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberAES).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_AES_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberECDH).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_ECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberStatic).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Static_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsRsa).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsRsa_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberKmsECDH).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_KmsECDH_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberHierarchy).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Hierarchy_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_Multi_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring))) + case *awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext: + var inputToConversion = aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input.(*awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext).Value) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.CompanionStruct_KeyDescription_{}.Create_RequiredEncryptionContext_(inputToConversion.UnwrapOr(nil).(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM))) + + default: + panic("Unhandled union type") } - return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo) Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM) Wrappers.Option { return func() Wrappers.Option { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KMSInfo_.Create_KMSInfo_(aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_ToDafny(input.KeyId))) + return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RequiredEncryptionContextCMM_.Create_RequiredEncryptionContextCMM_(aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input.Underlying), aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys))) }() } -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -425,28 +591,46 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_ke }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input []string) dafny.Sequence { return func() dafny.Sequence { - return dafny.SeqOfChars([]dafny.Char(input)...) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RequiredEncryptionContextCMM_.Create_RequiredEncryptionContextCMM_(aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input.Underlying), aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_ToDafny(input.RequiredEncryptionContextKeys))) + return dafny.SeqOf(func() []interface{} { + utf8.ValidString(input) + b := []byte(input) + f := make([]interface{}, len(b)) + for i, v := range b { + f[i] = v + } + return f + }()...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring) Wrappers.Option { - return func() Wrappers.Option { +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) dafny.Sequence { + return func() dafny.Sequence { - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsEcdhKeyring_.Create_KmsEcdhKeyring_(aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input.SenderKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input.RecipientKeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_ToDafny(input.SenderPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_ToDafny(input.RecipientPublicKey), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input.CurveSpec), aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input.KeyAgreementScheme))) + var fieldValue []interface{} = make([]interface{}, 0) + for _, val := range input { + element := aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(val) + fieldValue = append(fieldValue, element) + } + return dafny.SeqOf(fieldValue...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -493,42 +677,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextC }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_RawRSA_.Create_RawRSA_(aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input.ProviderId), aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input.Padding))) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAware_.Create_KmsMrkAware_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_ToDafny(input.KeyId))) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -575,13 +724,6 @@ func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInp }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOperation_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation) AwsCryptographyMaterialProvidersTestVectorKeysTypes.CmmOperation { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.CmmOperation { @@ -604,64 +746,20 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOper }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_ToDafny(input awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme) AwsCryptographyMaterialProvidersTypes.PaddingScheme { - return func() AwsCryptographyMaterialProvidersTypes.PaddingScheme { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } + var v []interface{} + if input == nil { + return nil } - var enum interface{} - for allEnums, i := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } + for _, e := range input { + v = append(v, e) } - return enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_StaticKeyring_.Create_StaticKeyring_(aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_ToDafny(input.KeyId))) + return dafny.SeqOf(v...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -708,69 +806,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_key }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_ToDafny(input []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) dafny.Sequence { - return func() dafny.Sequence { - - var fieldValue []interface{} = make([]interface{}, 0) - for _, val := range input { - element := aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(val) - fieldValue = append(fieldValue, element) - } - return dafny.SeqOf(fieldValue...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProviders_EncryptionContextKeys_member_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOf(func() []interface{} { - utf8.ValidString(input) - b := []byte(input) - f := make([]interface{}, len(b)) - for i, v := range b { - f[i] = v - } - return f - }()...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription) AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { return func() AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription { switch input.(type) { @@ -817,14 +853,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_ToDafny(input awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery) Wrappers.Option { - return func() Wrappers.Option { - - return Wrappers.Companion_Option_.Create_Some_(AwsCryptographyMaterialProvidersTestVectorKeysTypes.Companion_KmsMrkAwareDiscovery_.Create_KmsMrkAwareDiscovery_(aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_ToDafny(input.KeyId), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_ToDafny(input.DefaultMrkRegion), aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_ToDafny(input.AwsKmsDiscoveryFilter))) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_ToDafny(input []byte) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_ToDafny(input []byte) dafny.Sequence { return func() dafny.Sequence { var v []interface{} if input == nil { @@ -837,43 +866,14 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_jso }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_ToDafny(input string) dafny.Sequence { - return func() dafny.Sequence { - - return dafny.SeqOfChars([]dafny.Char(input)...) - }() -} - -func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_ToDafny(input kmstypes.EncryptionAlgorithmSpec) ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - return func() ComAmazonawsKmsTypes.EncryptionAlgorithmSpec { - - var index int - for _, enumVal := range input.Values() { - index++ - if enumVal == input { - break - } - } - var enum interface{} - for allEnums, i := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()), 0; i < index; i++ { - var ok bool - enum, ok = allEnums() - if !ok { - break - } - } - return enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - }() -} - -func aws_cryptography_materialProviders_AccountIdList_member_ToDafny(input string) dafny.Sequence { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_ToDafny(input string) dafny.Sequence { return func() dafny.Sequence { return dafny.SeqOfChars([]dafny.Char(input)...) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go index 1749e5845..3cb1f4b11 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygenerated/to_native.go @@ -108,61 +108,8 @@ func KeyVectorsConfig_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTest } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring).Dtor_keyId())} -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { - if input == nil { - return nil - } - return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), - Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription - if input == nil { - return nil - } if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -229,18 +176,370 @@ func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_Fro union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti{ Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_Multi())), } - } - if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { + } + if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { + + union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ + Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), + } + } + + return union + +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_keyId()), + DefaultMrkRegion: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_defaultMrkRegion()), + AwsKmsDiscoveryFilter: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_awsKmsDiscoveryFilter().UnwrapOr(nil)), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { + if input == nil { + return nil + } + return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), + Partition: aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), + } +} +func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_keyId()), + ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_providerId()), + Padding: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_padding()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { + var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme + inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) + index := -1 + for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { + break + } + } + } + + return u.Values()[index] + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_keyId()), + ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_providerId()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderKeyId()), + RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientKeyId()), + SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderPublicKey()), + RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientPublicKey()), + ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_providerId()), + CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_curveSpec()), + KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_keyAgreementScheme()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_keyId()), + EncryptionAlgorithm: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_encryptionAlgorithm()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } + } + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input interface{}) kmstypes.EncryptionAlgorithmSpec { + return func() kmstypes.EncryptionAlgorithmSpec { + var u kmstypes.EncryptionAlgorithmSpec + inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) + index := -1 + for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { + enum, ok := allEnums() + if ok { + index++ + if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { + break + } + } + } - union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ - Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), - } + return u.Values()[index] + }() +} +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderKeyId()), + RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientKeyId()), + SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderPublicKey()), + RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientPublicKey()), + CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_curveSpec()), + KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_keyAgreementScheme()), } - - return union - } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -253,7 +552,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPubli } }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -266,22 +565,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(inp } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsRsa_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsRsaKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_keyId()), - EncryptionAlgorithm: aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsRsaKeyring).Dtor_encryptionAlgorithm()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawEcdh{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderKeyId()), - RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientKeyId()), - SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_senderPublicKey()), - RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_recipientPublicKey()), - ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_providerId()), - CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_curveSpec()), - KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawEcdh).Dtor_keyAgreementScheme()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -294,7 +578,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderKeyId_FromDa } }() } -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -307,39 +591,36 @@ func aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(inp } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring{Generator: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_generator().UnwrapOr(nil)), - ChildKeyrings: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_childKeyrings()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_FromDafny(input interface{}) []byte { - return func() []byte { - var b []byte - if input == nil { - return nil - } +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input interface{}) string { + return func() string { + var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return b + return s } else { - b = append(b, val.(byte)) + s = s + string(val.(dafny.Char)) } } }() } -func aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break +func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input interface{}) string { + return func() string { + var s string + for i := dafny.Iterate(input); ; { + val, ok := i() + if !ok { + return s + } else { + s = s + string(val.(dafny.Char)) + } } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) - } - return fieldValue + }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Hierarchy_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.HierarchyKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.HierarchyKeyring).Dtor_keyId())} +} +func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -352,8 +633,16 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPu } }() } -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.MultiKeyring{Generator: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_generator().UnwrapOr(nil)), + ChildKeyrings: aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.MultiKeyring).Dtor_childKeyrings()), + } +} +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription + if input == nil { + return nil + } if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -431,65 +720,12 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDesc return union } -func aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_AES_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawAES{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_keyId()), - ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawAES).Dtor_providerId()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { - fieldValue := make([]string, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM { + return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM{Underlying: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_underlying()), + RequiredEncryptionContextKeys: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_requiredEncryptionContextKeys()), } - return fieldValue -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Kms_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KMSInfo{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KMSInfo_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KMSInfo).Dtor_keyId())} } -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -568,7 +804,18 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_ke return union } -func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { + fieldValue := make([]string, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) + } + return fieldValue +} +func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -576,26 +823,29 @@ func aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId if !ok { return s } else { - s = s + string(val.(dafny.Char)) + // UTF bytes should be always converted from bytes to string in go + // Otherwise go treats the string as a unicode codepoint + + var valUint, _ = val.(uint8) + var byteSlice = []byte{valUint} + s = s + string(byteSlice) + } } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RequiredEncryptionContextCMM{Underlying: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_underlying()), - RequiredEncryptionContextKeys: aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RequiredEncryptionContextCMM).Dtor_requiredEncryptionContextKeys()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsECDH_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsEcdhKeyring{SenderKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderKeyId()), - RecipientKeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientKeyId()), - SenderPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_senderPublicKey()), - RecipientPublicKey: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_recipientPublicKey()), - CurveSpec: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_curveSpec()), - KeyAgreementScheme: aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsEcdhKeyring).Dtor_keyAgreementScheme()), +func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { + fieldValue := make([]awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription, 0) + for i := dafny.Iterate(input.(dafny.Sequence)); ; { + val, ok := i() + if !ok { + break + } + fieldValue = append(fieldValue, aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(val)) } + return fieldValue } -func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextCMM_underlying_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -659,70 +909,22 @@ func aws_cryptography_materialProvidersTestVectorKeys_RequiredEncryptionContextC } } if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Multi() { - - union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti{ - Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_Multi())), - } - } - if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { - - union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ - Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), - } - } - - return union - -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RSA_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.RawRSA{KeyId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_keyId()), - ProviderId: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_providerId()), - Padding: aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.RawRSA).Dtor_padding()), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientPublicKey_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_keyAgreementScheme_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } + + union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberMulti{ + Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Multi_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_Multi())), } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrk_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAware{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAware_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAware).Dtor_keyId())} -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_recipientKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } + } + if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_RequiredEncryptionContext() { + + union = &awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescriptionMemberRequiredEncryptionContext{ + Value: (aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_RequiredEncryptionContext_FromDafny((input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Dtor_RequiredEncryptionContext())), } - }() + } + + return union + } -func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -801,19 +1003,6 @@ func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInp return union } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_providerId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOperation_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation { return func() awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation { var u awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.CmmOperation @@ -832,80 +1021,23 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorCmmInput_forOper return u.Values()[index] }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_padding_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { - var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme - inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) - index := -1 - for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_senderKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_FromDafny(input interface{}) []byte { + return func() []byte { + var b []byte + if input == nil { + return nil } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_senderPublicKey_FromDafny(input interface{}) string { - return func() string { - var s string for i := dafny.Iterate(input); ; { val, ok := i() if !ok { - return s + return b } else { - s = s + string(val.(dafny.Char)) + b = append(b, val.(byte)) } } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_Static_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.StaticKeyring{KeyId: aws_cryptography_materialProvidersTestVectorKeys_StaticKeyring_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.StaticKeyring).Dtor_keyId())} -} -func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionOutput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -984,102 +1116,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_TestVectorKeyringInput_key return union } -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_recipientKeyId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { - fieldValue := make([]awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription, 0) - for i := dafny.Iterate(input.(dafny.Sequence)); ; { - val, ok := i() - if !ok { - break - } - fieldValue = append(fieldValue, aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(val)) - } - return fieldValue -} -func aws_cryptography_materialProvidersTestVectorKeys_RawAES_providerId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawEcdh_curveSpec_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - // UTF bytes should be always converted from bytes to string in go - // Otherwise go treats the string as a unicode codepoint - - var valUint, _ = val.(uint8) - var byteSlice = []byte{valUint} - s = s + string(byteSlice) - - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_RawRSA_providerId_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_keyAgreementScheme_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionInput_keyDescription_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription { var union awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KeyDescription if (input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KeyDescription)).Is_Kms() { @@ -1158,13 +1195,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_ return union } -func aws_cryptography_materialProvidersTestVectorKeys_KeyDescription_KmsMrkDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery { - return awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes.KmsMrkAwareDiscovery{KeyId: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_keyId_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_keyId()), - DefaultMrkRegion: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_defaultMrkRegion_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_defaultMrkRegion()), - AwsKmsDiscoveryFilter: aws_cryptography_materialProvidersTestVectorKeys_KmsMrkAwareDiscovery_awsKmsDiscoveryFilter_FromDafny(input.(AwsCryptographyMaterialProvidersTestVectorKeysTypes.KmsMrkAwareDiscovery).Dtor_awsKmsDiscoveryFilter().UnwrapOr(nil)), - } -} -func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_json_FromDafny(input interface{}) []byte { +func aws_cryptography_materialProvidersTestVectorKeys_SerializeKeyDescriptionOutput_json_FromDafny(input interface{}) []byte { return func() []byte { var b []byte if input == nil { @@ -1180,20 +1211,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_GetKeyDescriptionInput_jso } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsEcdhKeyring_curveSpec_FromDafny(input interface{}) string { - return func() string { - var s string - for i := dafny.Iterate(input); ; { - val, ok := i() - if !ok { - return s - } else { - s = s + string(val.(dafny.Char)) - } - } - }() -} -func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorException_message_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { @@ -1206,25 +1224,7 @@ func aws_cryptography_materialProvidersTestVectorKeys_HierarchyKeyring_keyId_Fro } }() } -func aws_cryptography_materialProvidersTestVectorKeys_KmsRsaKeyring_encryptionAlgorithm_FromDafny(input interface{}) kmstypes.EncryptionAlgorithmSpec { - return func() kmstypes.EncryptionAlgorithmSpec { - var u kmstypes.EncryptionAlgorithmSpec - inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) - index := -1 - for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { - enum, ok := allEnums() - if ok { - index++ - if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { - break - } - } - } - - return u.Values()[index] - }() -} -func aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { +func aws_cryptography_materialProvidersTestVectorKeys_KeyVectorsConfig_keyManifestPath_FromDafny(input interface{}) string { return func() string { var s string for i := dafny.Iterate(input); ; { diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go index 9f09ea74d..39340e755 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/go/TestsFromDafny-go/awscryptographymaterialproviderstestvectorkeyssmithygeneratedtypes/types.go @@ -646,6 +646,15 @@ func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_KeyDe return nil } +func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_Validate() error { + for _, item := range input.ChildKeyrings { + if input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) != nil { + return input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) + } + } + + return nil +} func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_generator_Validate() error { if input.Generator == nil { return nil @@ -706,15 +715,6 @@ func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_Multi return nil } -func (input MultiKeyring) aws_cryptography_materialProvidersTestVectorKeys_MultiKeyring_childKeyrings_Validate() error { - for _, item := range input.ChildKeyrings { - if input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) != nil { - return input.aws_cryptography_materialProvidersTestVectorKeys_KeyDescriptionList_member_Validate(item) - } - } - - return nil -} type KeyVectorsConfig struct { KeyManifestPath string @@ -734,8 +734,8 @@ func (input KeyVectorsConfig) Validate() error { // KeyDescriptionMemberKmsMrkDiscovery // KeyDescriptionMemberKmsRsa // KeyDescriptionMemberMulti -// KeyDescriptionMemberRequiredEncryptionContext // KeyDescriptionMemberRSA +// KeyDescriptionMemberRequiredEncryptionContext // KeyDescriptionMemberStatic type KeyDescription interface { isKeyDescription() diff --git a/smithy-dafny b/smithy-dafny index bf06e19a3..7a86bc87a 160000 --- a/smithy-dafny +++ b/smithy-dafny @@ -1 +1 @@ -Subproject commit bf06e19a3487676570a54feea81d557c06008e3d +Subproject commit 7a86bc87a1d2e004791198611042c2d0f9b41adf