diff --git a/DynamoDbEncryption/codegen-patches/DynamoDbEncryption/dotnet/dafny-4.9.0.patch b/DynamoDbEncryption/codegen-patches/DynamoDbEncryption/dotnet/dafny-4.9.0.patch new file mode 100644 index 000000000..26f6eaf2b --- /dev/null +++ b/DynamoDbEncryption/codegen-patches/DynamoDbEncryption/dotnet/dafny-4.9.0.patch @@ -0,0 +1,83 @@ +diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs +index 84d4af9e..4a3a6889 100644 +--- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs ++++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs +@@ -1,6 +1,7 @@ + // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + // SPDX-License-Identifier: Apache-2.0 + // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. ++using System.Collections.Generic; + using System; + using AWS.Cryptography.DbEncryptionSDK.DynamoDb; + namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb +@@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb + public class CollectionOfErrors : Exception + { + public readonly System.Collections.Generic.List list; +- public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } ++ public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } + public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } + public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } ++ private static string ListAsString(List list) ++ { ++ if (list.Count < 1) return ""; ++ string[] msgArr = new string[list.Count]; ++ for (int i = 0; i < list.Count; i++) ++ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; ++ return String.Join("\n\t", msgArr); ++ } + } + + } + +diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs +index 9601968..a2a04f8 100644 +--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs ++++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs +@@ -7,10 +7,43 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb + { + public static class TypeConversion + { +- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z"; +- +- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z"; ++ // BEGIN MANUAL EDIT ++ public static AWS.Cryptography.KeyStore.KeyStore FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S17_KeyStoreReference(software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient value) ++ { ++ if (value is software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient dafnyValue) ++ { ++ return new AWS.Cryptography.KeyStore.KeyStore(dafnyValue); ++ } ++ throw new System.ArgumentException("Custom implementations of AWS.Cryptography.KeyStore.KeyStore are not supported yet"); ++ } ++ public static software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S17_KeyStoreReference(AWS.Cryptography.KeyStore.KeyStore value) ++ { ++ if (value is AWS.Cryptography.KeyStore.KeyStore nativeValue) ++ { ++ return nativeValue.impl(); ++ } ++ throw new System.ArgumentException("Custom implementations of AWS.Cryptography.KeyStore.KeyStore are not supported yet"); ++ } ++ public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.ILegacyDynamoDbEncryptor FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S32_LegacyDynamoDbEncryptorReference(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor value) ++ { ++ if (value is NativeWrapper_LegacyDynamoDbEncryptor nativeWrapper) return nativeWrapper._impl; ++ return new LegacyDynamoDbEncryptor(value); + ++ } ++ public static software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.ILegacyDynamoDbEncryptor ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S32_LegacyDynamoDbEncryptorReference(AWS.Cryptography.DbEncryptionSDK.DynamoDb.ILegacyDynamoDbEncryptor value) ++ { ++ switch (value) ++ { ++ case LegacyDynamoDbEncryptor valueWithImpl: ++ return valueWithImpl._impl; ++ case LegacyDynamoDbEncryptorBase nativeImpl: ++ return new NativeWrapper_LegacyDynamoDbEncryptor(nativeImpl); ++ default: ++ throw new System.ArgumentException( ++ "Custom implementations of LegacyDynamoDbEncryptor must extend LegacyDynamoDbEncryptorBase."); ++ } ++ } ++ // END MANUAL EDIT + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.BeaconKeySource FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S15_BeaconKeySource(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IBeaconKeySource value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource)value; diff --git a/DynamoDbEncryption/codegen-patches/DynamoDbEncryptionTransforms/dotnet/dafny-4.9.0.patch b/DynamoDbEncryption/codegen-patches/DynamoDbEncryptionTransforms/dotnet/dafny-4.9.0.patch new file mode 100644 index 000000000..139087ac6 --- /dev/null +++ b/DynamoDbEncryption/codegen-patches/DynamoDbEncryptionTransforms/dotnet/dafny-4.9.0.patch @@ -0,0 +1,47 @@ +diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs +index 6e2cf219..6d5bbed5 100644 +--- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs ++++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs +@@ -1,6 +1,7 @@ + // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + // SPDX-License-Identifier: Apache-2.0 + // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. ++using System.Collections.Generic; + using System; + using AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms; + namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms +@@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms + public class CollectionOfErrors : Exception + { + public readonly System.Collections.Generic.List list; +- public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } ++ public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } + public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } + public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } ++ private static string ListAsString(List list) ++ { ++ if (list.Count < 1) return ""; ++ string[] msgArr = new string[list.Count]; ++ for (int i = 0; i < list.Count; i++) ++ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; ++ return String.Join("\n\t", msgArr); ++ } + } + + } + +diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs +index 2f95341..36226d3 100644 +--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs ++++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs +@@ -7,10 +7,6 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms + { + public static class TypeConversion + { +- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z"; +- +- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z"; +- + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbTablesEncryptionConfig FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_DynamoDbTablesEncryptionConfig(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IDynamoDbTablesEncryptionConfig value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.DynamoDbTablesEncryptionConfig)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbTablesEncryptionConfig converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbTablesEncryptionConfig(); converted.TableEncryptionConfigs = (System.Collections.Generic.Dictionary)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_DynamoDbTablesEncryptionConfig__M22_tableEncryptionConfigs(concrete._tableEncryptionConfigs); return converted; diff --git a/DynamoDbEncryption/codegen-patches/DynamoDbItemEncryptor/dotnet/dafny-4.9.0.patch b/DynamoDbEncryption/codegen-patches/DynamoDbItemEncryptor/dotnet/dafny-4.9.0.patch new file mode 100644 index 000000000..ee717fa1f --- /dev/null +++ b/DynamoDbEncryption/codegen-patches/DynamoDbItemEncryptor/dotnet/dafny-4.9.0.patch @@ -0,0 +1,47 @@ +diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs +index ef0d4752..42403507 100644 +--- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs ++++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs +@@ -1,6 +1,7 @@ + // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + // SPDX-License-Identifier: Apache-2.0 + // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. ++using System.Collections.Generic; + using System; + using AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor; + namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor +@@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor + public class CollectionOfErrors : Exception + { + public readonly System.Collections.Generic.List list; +- public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } ++ public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } + public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } + public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } ++ private static string ListAsString(List list) ++ { ++ if (list.Count < 1) return ""; ++ string[] msgArr = new string[list.Count]; ++ for (int i = 0; i < list.Count; i++) ++ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; ++ return String.Join("\n\t", msgArr); ++ } + } + + } + +diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs +index da904fc..c5b0bed 100644 +--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs ++++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs +@@ -7,10 +7,6 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor + { + public static class TypeConversion + { +- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z"; +- +- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z"; +- + public static AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor.DecryptItemInput FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__N13_itemEncryptor__S16_DecryptItemInput(software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types._IDecryptItemInput value) + { + software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny.types.DecryptItemInput)value; AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor.DecryptItemInput converted = new AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor.DecryptItemInput(); converted.EncryptedItem = (System.Collections.Generic.Dictionary)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__N13_itemEncryptor__S16_DecryptItemInput__M13_encryptedItem(concrete._encryptedItem); return converted; diff --git a/DynamoDbEncryption/codegen-patches/StructuredEncryption/dotnet/dafny-4.9.0.patch b/DynamoDbEncryption/codegen-patches/StructuredEncryption/dotnet/dafny-4.9.0.patch new file mode 100644 index 000000000..6e33c5e09 --- /dev/null +++ b/DynamoDbEncryption/codegen-patches/StructuredEncryption/dotnet/dafny-4.9.0.patch @@ -0,0 +1,48 @@ +diff --git a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs +index 0f4c3ff9..168f502b 100644 +--- a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs ++++ b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs +@@ -1,6 +1,7 @@ + // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. + // SPDX-License-Identifier: Apache-2.0 + // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. ++using System.Collections.Generic; + using System; + using AWS.Cryptography.DbEncryptionSDK.StructuredEncryption; + namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption +@@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption + public class CollectionOfErrors : Exception + { + public readonly System.Collections.Generic.List list; +- public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } ++ public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } + public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } + public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } ++ private static string ListAsString(List list) ++ { ++ if (list.Count < 1) return ""; ++ string[] msgArr = new string[list.Count]; ++ for (int i = 0; i < list.Count; i++) ++ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; ++ return String.Join("\n\t", msgArr); ++ } + } + + } + +diff --git b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs +index d0a4e58..4e9890c 100644 +--- b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs ++++ a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs +@@ -7,10 +7,6 @@ namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption + { + public static class TypeConversion + { +- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z"; +- +- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z"; +- + public static AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.AuthenticateAction FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N20_structuredEncryption__S18_AuthenticateAction(software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny.types._IAuthenticateAction value) + { + if (value.is_SIGN) return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.AuthenticateAction.SIGN; + diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs index 84d4af9e0..4a3a68899 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs @@ -1,6 +1,7 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +using System.Collections.Generic; using System; using AWS.Cryptography.DbEncryptionSDK.DynamoDb; namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb @@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb public class CollectionOfErrors : Exception { public readonly System.Collections.Generic.List list; - public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } + public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } + private static string ListAsString(List list) + { + if (list.Count < 1) return ""; + string[] msgArr = new string[list.Count]; + for (int i = 0; i < list.Count; i++) + msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; + return String.Join("\n\t", msgArr); + } } } diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs index 6e2cf2190..6d5bbed5e 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs @@ -1,6 +1,7 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +using System.Collections.Generic; using System; using AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms; namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms @@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms public class CollectionOfErrors : Exception { public readonly System.Collections.Generic.List list; - public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } + public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } + private static string ListAsString(List list) + { + if (list.Count < 1) return ""; + string[] msgArr = new string[list.Count]; + for (int i = 0; i < list.Count; i++) + msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; + return String.Join("\n\t", msgArr); + } } } diff --git a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs index ef0d4752c..424035072 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs @@ -1,6 +1,7 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +using System.Collections.Generic; using System; using AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor; namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor @@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor public class CollectionOfErrors : Exception { public readonly System.Collections.Generic.List list; - public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } + public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } + private static string ListAsString(List list) + { + if (list.Count < 1) return ""; + string[] msgArr = new string[list.Count]; + for (int i = 0; i < list.Count; i++) + msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; + return String.Join("\n\t", msgArr); + } } } diff --git a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs index 0f4c3ff93..168f502b3 100644 --- a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs +++ b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs @@ -1,6 +1,7 @@ // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Do not modify this file. This file is machine generated, and any changes to it will be overwritten. +using System.Collections.Generic; using System; using AWS.Cryptography.DbEncryptionSDK.StructuredEncryption; namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption @@ -8,9 +9,17 @@ namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption public class CollectionOfErrors : Exception { public readonly System.Collections.Generic.List list; - public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message) { this.list = list; } + public CollectionOfErrors(System.Collections.Generic.List list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; } public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List(); } public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List(); } + private static string ListAsString(List list) + { + if (list.Count < 1) return ""; + string[] msgArr = new string[list.Count]; + for (int i = 0; i < list.Count; i++) + msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}"; + return String.Join("\n\t", msgArr); + } } }