Skip to content

Commit 606b071

Browse files
committed
chore(.NET): CollectionOfErrors; list as string
1 parent 5e24233 commit 606b071

File tree

4 files changed

+220
-0
lines changed

4 files changed

+220
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs
2+
index 4a3a6889..84d4af9e 100644
3+
--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs
4+
+++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/CollectionOfErrors.cs
5+
@@ -1,7 +1,6 @@
6+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
7+
// SPDX-License-Identifier: Apache-2.0
8+
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
9+
+using System.Collections.Generic;
10+
using System;
11+
using AWS.Cryptography.DbEncryptionSDK.DynamoDb;
12+
namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb
13+
@@ -9,17 +8,9 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb
14+
public class CollectionOfErrors : Exception
15+
{
16+
public readonly System.Collections.Generic.List<Exception> list;
17+
+ public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; }
18+
- public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message) { this.list = list; }
19+
public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List<Exception>(); }
20+
public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List<Exception>(); }
21+
+ private static string ListAsString(List<Exception> list)
22+
+ {
23+
+ if (list.Count < 1) return "";
24+
+ string[] msgArr = new string[list.Count];
25+
+ for (int i = 0; i < list.Count; i++)
26+
+ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}";
27+
+ return String.Join("\n\t", msgArr);
28+
+ }
29+
}
30+
31+
}
32+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs
33+
index 4b68c9ed..5ae8d019 100644
34+
--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs
35+
+++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryption/TypeConversion.cs
36+
@@ -7,10 +7,43 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb
37+
{
38+
public static class TypeConversion
39+
{
40+
- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z";
41+
-
42+
- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z";
43+
+ // BEGIN MANUAL EDIT
44+
+ 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)
45+
+ {
46+
+ if (value is software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient dafnyValue)
47+
+ {
48+
+ return new AWS.Cryptography.KeyStore.KeyStore(dafnyValue);
49+
+ }
50+
+ throw new System.ArgumentException("Custom implementations of AWS.Cryptography.KeyStore.KeyStore are not supported yet");
51+
+ }
52+
+ 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)
53+
+ {
54+
+ if (value is AWS.Cryptography.KeyStore.KeyStore nativeValue)
55+
+ {
56+
+ return nativeValue.impl();
57+
+ }
58+
+ throw new System.ArgumentException("Custom implementations of AWS.Cryptography.KeyStore.KeyStore are not supported yet");
59+
+ }
60+
+ 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)
61+
+ {
62+
+ if (value is NativeWrapper_LegacyDynamoDbEncryptor nativeWrapper) return nativeWrapper._impl;
63+
+ return new LegacyDynamoDbEncryptor(value);
64+
65+
+ }
66+
+ 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)
67+
+ {
68+
+ switch (value)
69+
+ {
70+
+ case LegacyDynamoDbEncryptor valueWithImpl:
71+
+ return valueWithImpl._impl;
72+
+ case LegacyDynamoDbEncryptorBase nativeImpl:
73+
+ return new NativeWrapper_LegacyDynamoDbEncryptor(nativeImpl);
74+
+ default:
75+
+ throw new System.ArgumentException(
76+
+ "Custom implementations of LegacyDynamoDbEncryptor must extend LegacyDynamoDbEncryptorBase.");
77+
+ }
78+
+ }
79+
+ // END MANUAL EDIT
80+
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)
81+
{
82+
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource concrete = (software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.BeaconKeySource)value;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs
2+
index 6d5bbed5..6e2cf219 100644
3+
--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs
4+
+++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/CollectionOfErrors.cs
5+
@@ -1,7 +1,6 @@
6+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
7+
// SPDX-License-Identifier: Apache-2.0
8+
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
9+
+using System.Collections.Generic;
10+
using System;
11+
using AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms;
12+
namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms
13+
@@ -9,17 +8,9 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms
14+
public class CollectionOfErrors : Exception
15+
{
16+
public readonly System.Collections.Generic.List<Exception> list;
17+
+ public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; }
18+
- public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message) { this.list = list; }
19+
public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List<Exception>(); }
20+
public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List<Exception>(); }
21+
+ private static string ListAsString(List<Exception> list)
22+
+ {
23+
+ if (list.Count < 1) return "";
24+
+ string[] msgArr = new string[list.Count];
25+
+ for (int i = 0; i < list.Count; i++)
26+
+ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}";
27+
+ return String.Join("\n\t", msgArr);
28+
+ }
29+
}
30+
31+
}
32+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs
33+
index 97351120..e252e07d 100644
34+
--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs
35+
+++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs
36+
@@ -7,10 +7,6 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms
37+
{
38+
public static class TypeConversion
39+
{
40+
- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z";
41+
-
42+
- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z";
43+
-
44+
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)
45+
{
46+
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<string, AWS.Cryptography.DbEncryptionSDK.DynamoDb.DynamoDbTableEncryptionConfig>)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_DynamoDbTablesEncryptionConfig__M22_tableEncryptionConfigs(concrete._tableEncryptionConfigs); return converted;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs
2+
index 42403507..ef0d4752 100644
3+
--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs
4+
+++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/CollectionOfErrors.cs
5+
@@ -1,7 +1,6 @@
6+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
7+
// SPDX-License-Identifier: Apache-2.0
8+
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
9+
+using System.Collections.Generic;
10+
using System;
11+
using AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor;
12+
namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor
13+
@@ -9,17 +8,9 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor
14+
public class CollectionOfErrors : Exception
15+
{
16+
public readonly System.Collections.Generic.List<Exception> list;
17+
+ public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; }
18+
- public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message) { this.list = list; }
19+
public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List<Exception>(); }
20+
public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List<Exception>(); }
21+
+ private static string ListAsString(List<Exception> list)
22+
+ {
23+
+ if (list.Count < 1) return "";
24+
+ string[] msgArr = new string[list.Count];
25+
+ for (int i = 0; i < list.Count; i++)
26+
+ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}";
27+
+ return String.Join("\n\t", msgArr);
28+
+ }
29+
}
30+
31+
}
32+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs
33+
index d1ceb19b..f96612ee 100644
34+
--- b/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs
35+
+++ a/DynamoDbEncryption/runtimes/net/Generated/DynamoDbItemEncryptor/TypeConversion.cs
36+
@@ -7,10 +7,6 @@ namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.ItemEncryptor
37+
{
38+
public static class TypeConversion
39+
{
40+
- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z";
41+
-
42+
- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z";
43+
-
44+
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)
45+
{
46+
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<string, Amazon.DynamoDBv2.Model.AttributeValue>)FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__N13_itemEncryptor__S16_DecryptItemInput__M13_encryptedItem(concrete._encryptedItem); return converted;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs
2+
index 168f502b..0f4c3ff9 100644
3+
--- b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs
4+
+++ a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/CollectionOfErrors.cs
5+
@@ -1,7 +1,6 @@
6+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
7+
// SPDX-License-Identifier: Apache-2.0
8+
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
9+
+using System.Collections.Generic;
10+
using System;
11+
using AWS.Cryptography.DbEncryptionSDK.StructuredEncryption;
12+
namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption
13+
@@ -9,17 +8,9 @@ namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption
14+
public class CollectionOfErrors : Exception
15+
{
16+
public readonly System.Collections.Generic.List<Exception> list;
17+
+ public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message + $"\n List: \n{ListAsString(list)}") { this.list = list; }
18+
- public CollectionOfErrors(System.Collections.Generic.List<Exception> list, string message) : base(message) { this.list = list; }
19+
public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List<Exception>(); }
20+
public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List<Exception>(); }
21+
+ private static string ListAsString(List<Exception> list)
22+
+ {
23+
+ if (list.Count < 1) return "";
24+
+ string[] msgArr = new string[list.Count];
25+
+ for (int i = 0; i < list.Count; i++)
26+
+ msgArr[i] = $"{list[i].GetType().Name} :: {list[i].Message}";
27+
+ return String.Join("\n\t", msgArr);
28+
+ }
29+
}
30+
31+
}
32+
diff --git b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs
33+
index 6de665f3..6a802466 100644
34+
--- b/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs
35+
+++ a/DynamoDbEncryption/runtimes/net/Generated/StructuredEncryption/TypeConversion.cs
36+
@@ -7,10 +7,6 @@ namespace AWS.Cryptography.DbEncryptionSDK.StructuredEncryption
37+
{
38+
public static class TypeConversion
39+
{
40+
- private const string ISO8601DateFormat = "yyyy-MM-dd\\THH:mm:ss.fff\\Z";
41+
-
42+
- private const string ISO8601DateFormatNoMS = "yyyy-MM-dd\\THH:mm:ss\\Z";
43+
-
44+
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)
45+
{
46+
if (value.is_SIGN) return AWS.Cryptography.DbEncryptionSDK.StructuredEncryption.AuthenticateAction.SIGN;

0 commit comments

Comments
 (0)