|
| 1 | +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | +// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. |
| 4 | +// ReSharper disable RedundantUsingDirective |
| 5 | +// ReSharper disable RedundantNameQualifier |
| 6 | +// ReSharper disable SuggestVarOrType_SimpleTypes |
| 7 | + using System; |
| 8 | + using _System; |
| 9 | + using Wrappers_Compile; |
| 10 | + |
| 11 | + namespace AWS.Cryptography.DbEncryptionSDK.DynamoDb.Wrapped { |
| 12 | + internal class WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier : software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.IDynamoDbKeyBranchKeyIdSupplier |
| 13 | + { |
| 14 | + internal readonly DynamoDbKeyBranchKeyIdSupplierBase _impl; |
| 15 | + public WrappedNativeWrapper_DynamoDbKeyBranchKeyIdSupplier(DynamoDbKeyBranchKeyIdSupplierBase nativeImpl) |
| 16 | + { |
| 17 | + _impl = nativeImpl; |
| 18 | +} |
| 19 | + public Wrappers_Compile._IResult<software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyOutput, software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError> GetBranchKeyIdFromDdbKey(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyInput input) |
| 20 | + { |
| 21 | + void validateOutput(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput nativeOutput) { |
| 22 | + try { nativeOutput.Validate(); } catch (ArgumentException e) |
| 23 | + { |
| 24 | + var message = $"Output of {_impl}._GetBranchKeyIdFromDdbKey is invalid. {e.Message}"; |
| 25 | + throw new DynamoDbEncryptionException(message); |
| 26 | +} |
| 27 | +} |
| 28 | + AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyInput nativeInput = TypeConversion.FromDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S29_GetBranchKeyIdFromDdbKeyInput(input); |
| 29 | + try { |
| 30 | + AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput nativeOutput = _impl.GetBranchKeyIdFromDdbKey(nativeInput); |
| 31 | + _ = nativeOutput ?? throw new DynamoDbEncryptionException($"{_impl}._GetBranchKeyIdFromDdbKey returned null, should be {typeof(AWS.Cryptography.DbEncryptionSDK.DynamoDb.GetBranchKeyIdFromDdbKeyOutput)}"); |
| 32 | + validateOutput(nativeOutput); |
| 33 | + return Wrappers_Compile.Result<software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyOutput, software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError>.create_Success(TypeConversion.ToDafny_N3_aws__N12_cryptography__N15_dbEncryptionSdk__N8_dynamoDb__S30_GetBranchKeyIdFromDdbKeyOutput(nativeOutput)); |
| 34 | +} |
| 35 | + catch(Exception e) |
| 36 | + { |
| 37 | + return Wrappers_Compile.Result<software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyOutput, software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError>.create_Failure(TypeConversion.ToDafny_CommonError(e)); |
| 38 | +} |
| 39 | +} |
| 40 | + public Wrappers_Compile._IResult<software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyOutput, software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IError> GetBranchKeyIdFromDdbKey_k(software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types._IGetBranchKeyIdFromDdbKeyInput input) |
| 41 | + { |
| 42 | + throw new DynamoDbEncryptionException("Not supported at this time."); |
| 43 | +} |
| 44 | +} |
| 45 | +} |
0 commit comments