Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DynamoDbEncryption): Add GetEncryptedDataKeyDescription operation #856

Merged
merged 74 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
0f80010
Add parser
rishav-karanjit Mar 19, 2024
a5944c6
Fixed verify
rishav-karanjit Mar 22, 2024
689e83d
Updated Smithy to make keyProviderInfo optional
rishav-karanjit Mar 25, 2024
8f720cd
Added preconditions for GetEncryptedDataKeyDescription operation
rishav-karanjit Mar 25, 2024
79b70da
Add unit test for DynamoDbGetEncryptedDataKeyDescription
rishav-karanjit Mar 25, 2024
24f8f90
Added specification for Get Encrypted Data Key Description
rishav-karanjit Mar 25, 2024
346bf27
Refactor GetEncryptedDataKeyDescription operation
rishav-karanjit Mar 25, 2024
e909d69
Refactor the tests
rishav-karanjit Mar 25, 2024
7de56f3
Add more info in comments
rishav-karanjit Mar 25, 2024
d72193e
Add smithy generated java files
rishav-karanjit Mar 25, 2024
44f22b7
Removed exception for custom keyring
rishav-karanjit Mar 26, 2024
447630d
Add polymorph generated code
rishav-karanjit Mar 26, 2024
5d0a9fb
Revert "Add polymorph generated code"
rishav-karanjit Mar 26, 2024
09b6134
Add GetEncryptedDataKeyDescription Example
rishav-karanjit Mar 26, 2024
9deae04
Add more test coverage and decrease resource count
rishav-karanjit Mar 26, 2024
23b5de7
Add getBranchKeyVersion to decrease resource count
rishav-karanjit Mar 27, 2024
6bc3da1
Merge branch 'main' into rishav-feat-parser
rishav-karanjit Mar 27, 2024
ee7ba8d
Add polymorph generated code
rishav-karanjit Mar 27, 2024
dda196a
Add some more generated dotnet
rishav-karanjit Mar 27, 2024
6e6fd6b
format code
rishav-karanjit Mar 27, 2024
9fc726f
Add copyright and license in the comments
rishav-karanjit Mar 27, 2024
0ebcbe3
Add dotnet example
rishav-karanjit Mar 28, 2024
f1a0051
format code
rishav-karanjit Mar 28, 2024
8e8d19e
Merge branch 'main' of https://github.com/aws/aws-database-encryption…
rishav-karanjit Mar 28, 2024
707ecf7
Merge format
rishav-karanjit Mar 28, 2024
8c7bcaf
fix: merge errors
rishav-karanjit Mar 28, 2024
85ea703
Fix examples
rishav-karanjit Mar 28, 2024
6b4a324
removed unused variable
rishav-karanjit Mar 28, 2024
1810c1d
Fix example
rishav-karanjit Mar 28, 2024
900c398
Format dafny code
rishav-karanjit Mar 28, 2024
9275151
Add comments to dotnet example
rishav-karanjit Mar 29, 2024
fe44b3f
Update dafny test
rishav-karanjit Mar 29, 2024
29ab4f5
Add dotnet generated
rishav-karanjit Mar 29, 2024
0811022
Add smithy generated java
rishav-karanjit Mar 29, 2024
39668ed
Add dotnet typeconversion
rishav-karanjit Mar 29, 2024
5e6294a
Revert head to 3 commits back
rishav-karanjit Apr 1, 2024
0c638cb
Add --local-service-test option and did polymorph
rishav-karanjit Apr 1, 2024
98849ee
Refactor to remove extra blank line to make the code look better
rishav-karanjit Apr 2, 2024
7c17ef5
Format dafny code
rishav-karanjit Apr 2, 2024
75ac9a4
Refactor code and add comments
rishav-karanjit Apr 2, 2024
d73839a
Add comments to example
rishav-karanjit Apr 2, 2024
f3e2e71
Update version date
rishav-karanjit Apr 2, 2024
e95ab46
Removed expect
rishav-karanjit Apr 10, 2024
f804374
Removed extract
rishav-karanjit Apr 10, 2024
1d801ef
Assign Salt, IV and Version length constant
rishav-karanjit Apr 10, 2024
4dcb696
format dafny
rishav-karanjit Apr 10, 2024
dc581e7
Remove redundant codes
rishav-karanjit Apr 10, 2024
b28e230
Removed call to ItemToStructured
rishav-karanjit Apr 10, 2024
d9cd376
Remove extract
rishav-karanjit Apr 10, 2024
1cef3ce
Some nits
rishav-karanjit Apr 10, 2024
4c88676
Removed some more extract
rishav-karanjit Apr 10, 2024
5e88171
Updated to appropriate error datatype
rishav-karanjit Apr 10, 2024
6ffde54
Changed structure EncryptedDataKeyDescriptionOutput to EncryptedDataK…
rishav-karanjit Apr 10, 2024
6f6d384
Update specification
rishav-karanjit Apr 10, 2024
d01a432
Add duvet annotation
rishav-karanjit Apr 10, 2024
af31564
put flavor extracting concept inside else block
rishav-karanjit Apr 10, 2024
23d94d1
change < to <=
rishav-karanjit Apr 11, 2024
912305a
fix examples redundancy
rishav-karanjit Apr 11, 2024
88abd76
fix duvet annotations
rishav-karanjit Apr 11, 2024
325b507
Minor nit on specification
rishav-karanjit Apr 11, 2024
d96e977
Add TestNoHeaderFailureCase
rishav-karanjit Apr 18, 2024
756dd0e
Merge branch 'main' into rishav-feat-parser
rishav-karanjit Apr 18, 2024
23804d6
Use another AlgorithmSuites as well
rishav-karanjit Apr 18, 2024
eabe8b2
Merge branch 'main' into rishav-feat-parser
rishav-karanjit Apr 29, 2024
e69af8c
Add polymorph file after merge
rishav-karanjit Apr 30, 2024
5875935
Merge branch 'main' into rishav-feat-parser
rishav-karanjit Apr 30, 2024
9b58508
Add suggested changes
rishav-karanjit May 5, 2024
aa982c3
Merge branch 'main' into rishav-feat-parser
rishav-karanjit May 6, 2024
2f4cfc9
add generated file
rishav-karanjit May 6, 2024
6dedc67
Assert branch key into separate method to reduce resource count
rishav-karanjit May 6, 2024
6b30e4c
Change plainTextItem to item in examples
rishav-karanjit May 6, 2024
16bafa6
Nits in specification
rishav-karanjit May 6, 2024
dff2be6
Fix duvet annotation after nits in specs
rishav-karanjit May 6, 2024
158a98e
Merge branch 'main' into rishav-feat-parser
rishav-karanjit May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internald
)
datatype GetEncryptedDataKeyDescriptionUnion =
| header(header: seq<uint8>)
| plaintextItem(plaintextItem: ComAmazonawsDynamodbTypes.AttributeMap)
| item(item: ComAmazonawsDynamodbTypes.AttributeMap)
datatype GetPrefix = | GetPrefix (
nameonly length: int32
)
Expand Down
rishav-karanjit marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ service DynamoDbEncryption {
errors: [ DynamoDbEncryptionException ]
}

@javadoc("Returns encrypted data key description.")
operation GetEncryptedDataKeyDescription {
input: GetEncryptedDataKeyDescriptionInput,
output: GetEncryptedDataKeyDescriptionOutput,
}

@javadoc("Input for getting encrypted data key description.")
structure GetEncryptedDataKeyDescriptionInput {
@required
input: GetEncryptedDataKeyDescriptionUnion
Expand All @@ -65,12 +67,16 @@ structure GetEncryptedDataKeyDescriptionInput {
//# - A [encrypted DynamoDB item](https://github.com/aws/aws-database-encryption-sdk-dynamodb/blob/ff9f08a355a20c81540e4ca652e09aaeffe90c4b/specification/dynamodb-encryption-client/encrypt-item.md#encrypted-dynamodb-item)

union GetEncryptedDataKeyDescriptionUnion {
@javadoc("A binary header value.")
header: Blob,
plaintextItem: AttributeMap,
@javadoc("A DynamoDB item.")
item: AttributeMap,
}

@javadoc("Output for getting encrypted data key description.")
structure GetEncryptedDataKeyDescriptionOutput {
@required
@javadoc("A list of encrypted data key description.")
EncryptedDataKeyDescriptionOutput: EncryptedDataKeyDescriptionList
}

Expand All @@ -88,12 +94,16 @@ list EncryptedDataKeyDescriptionList {

structure EncryptedDataKeyDescription {
@required
@javadoc("Key provider id of the encrypted data key.")
keyProviderId: String,

@javadoc("Key provider information of the encrypted data key.")
keyProviderInfo: String,


@javadoc("Branch key id of the encrypted data key.")
branchKeyId: String,

@javadoc("Branch key version of the encrypted data key.")
branchKeyVersion: String
}
// The top level DynamoDbEncryption local service takes in no config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ module AwsCryptographyDbEncryptionSdkDynamoDbOperations refines AbstractAwsCrypt
{
//= specification/dynamodb-encryption-client/ddb-get-encrypted-data-key-description.md#behavior
//# - If the input is a encrypted DynamoDB item, it MUST attempt to extract "aws_dbe_head" attribute from the DynamoDB item to get binary header.
case plaintextItem(plainTextItem) =>{
:- Need("aws_dbe_head" in plainTextItem && plainTextItem["aws_dbe_head"].B?, E("Header not found in the DynamoDB item."));
header := plainTextItem["aws_dbe_head"].B;
case item(item) =>{
:- Need("aws_dbe_head" in item && item["aws_dbe_head"].B?, E("Header not found in the DynamoDB item."));
header := item["aws_dbe_head"].B;
}
case header(headerItem) =>
header := headerItem;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,21 @@ public CreateDynamoDbEncryptionBranchKeyIdSupplierOutput CreateDynamoDbEncryptio
);
}

/**
* Returns encrypted data key description.
*
* @param input Input for getting encrypted data key description.
* @return Output for getting encrypted data key description.
*/
public GetEncryptedDataKeyDescriptionOutput GetEncryptedDataKeyDescription(
rishav-karanjit marked this conversation as resolved.
Show resolved Hide resolved
GetEncryptedDataKeyDescriptionInput input) {
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionInput dafnyValue = ToDafny.GetEncryptedDataKeyDescriptionInput(input);
Result<software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionOutput, Error> result = this._impl.GetEncryptedDataKeyDescription(dafnyValue);
GetEncryptedDataKeyDescriptionInput input
) {
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionInput dafnyValue =
ToDafny.GetEncryptedDataKeyDescriptionInput(input);
Result<
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionOutput,
Error
> result = this._impl.GetEncryptedDataKeyDescription(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,22 +382,46 @@ public static DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig(
}

public static EncryptedDataKeyDescription EncryptedDataKeyDescription(
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.EncryptedDataKeyDescription nativeValue) {
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.EncryptedDataKeyDescription nativeValue
) {
DafnySequence<? extends Character> keyProviderId;
keyProviderId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyProviderId());
keyProviderId =
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.keyProviderId()
);
Option<DafnySequence<? extends Character>> keyProviderInfo;
keyProviderInfo = Objects.nonNull(nativeValue.keyProviderInfo()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyProviderInfo()))
keyProviderInfo =
Objects.nonNull(nativeValue.keyProviderInfo())
? Option.create_Some(
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.keyProviderInfo()
)
)
: Option.create_None();
Option<DafnySequence<? extends Character>> branchKeyId;
branchKeyId = Objects.nonNull(nativeValue.branchKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyId()))
branchKeyId =
Objects.nonNull(nativeValue.branchKeyId())
? Option.create_Some(
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.branchKeyId()
)
)
: Option.create_None();
Option<DafnySequence<? extends Character>> branchKeyVersion;
branchKeyVersion = Objects.nonNull(nativeValue.branchKeyVersion()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyVersion()))
branchKeyVersion =
Objects.nonNull(nativeValue.branchKeyVersion())
? Option.create_Some(
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.branchKeyVersion()
)
)
: Option.create_None();
return new EncryptedDataKeyDescription(keyProviderId, keyProviderInfo, branchKeyId, branchKeyVersion);
return new EncryptedDataKeyDescription(
keyProviderId,
keyProviderInfo,
branchKeyId,
branchKeyVersion
);
}

public static EncryptedPart EncryptedPart(
Expand Down Expand Up @@ -442,17 +466,26 @@ public static GetBranchKeyIdFromDdbKeyOutput GetBranchKeyIdFromDdbKeyOutput(
}

public static GetEncryptedDataKeyDescriptionInput GetEncryptedDataKeyDescriptionInput(
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionInput nativeValue) {
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionInput nativeValue
) {
GetEncryptedDataKeyDescriptionUnion input;
input = ToDafny.GetEncryptedDataKeyDescriptionUnion(nativeValue.input());
return new GetEncryptedDataKeyDescriptionInput(input);
}

public static GetEncryptedDataKeyDescriptionOutput GetEncryptedDataKeyDescriptionOutput(
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionOutput nativeValue) {
DafnySequence<? extends EncryptedDataKeyDescription> encryptedDataKeyDescriptionOutput;
encryptedDataKeyDescriptionOutput = ToDafny.EncryptedDataKeyDescriptionList(nativeValue.EncryptedDataKeyDescriptionOutput());
return new GetEncryptedDataKeyDescriptionOutput(encryptedDataKeyDescriptionOutput);
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionOutput nativeValue
) {
DafnySequence<
? extends EncryptedDataKeyDescription
> encryptedDataKeyDescriptionOutput;
encryptedDataKeyDescriptionOutput =
ToDafny.EncryptedDataKeyDescriptionList(
nativeValue.EncryptedDataKeyDescriptionOutput()
);
return new GetEncryptedDataKeyDescriptionOutput(
encryptedDataKeyDescriptionOutput
);
}

public static GetPrefix GetPrefix(
Expand Down Expand Up @@ -826,14 +859,27 @@ public static BeaconStyle BeaconStyle(
}

public static GetEncryptedDataKeyDescriptionUnion GetEncryptedDataKeyDescriptionUnion(
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionUnion nativeValue) {
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.GetEncryptedDataKeyDescriptionUnion nativeValue
) {
if (Objects.nonNull(nativeValue.header())) {
return GetEncryptedDataKeyDescriptionUnion.create_header(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.header()));
return GetEncryptedDataKeyDescriptionUnion.create_header(
software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(
nativeValue.header()
)
);
}
if (Objects.nonNull(nativeValue.plaintextItem())) {
return GetEncryptedDataKeyDescriptionUnion.create_plaintextItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(nativeValue.plaintextItem()));
if (Objects.nonNull(nativeValue.item())) {
return GetEncryptedDataKeyDescriptionUnion.create_item(
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeMap(
nativeValue.item()
)
);
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionUnion.");
throw new IllegalArgumentException(
"Cannot convert " +
nativeValue +
" to software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionUnion."
);
}

public static VirtualTransform VirtualTransform(
Expand Down Expand Up @@ -930,12 +976,18 @@ public static DafnySequence<? extends ConstructorPart> ConstructorPartList(
);
}

public static DafnySequence<? extends EncryptedDataKeyDescription> EncryptedDataKeyDescriptionList(
List<software.amazon.cryptography.dbencryptionsdk.dynamodb.model.EncryptedDataKeyDescription> nativeValue) {
public static DafnySequence<
? extends EncryptedDataKeyDescription
> EncryptedDataKeyDescriptionList(
List<
software.amazon.cryptography.dbencryptionsdk.dynamodb.model.EncryptedDataKeyDescription
> nativeValue
) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::EncryptedDataKeyDescription,
EncryptedDataKeyDescription._typeDescriptor());
nativeValue,
software.amazon.cryptography.dbencryptionsdk.dynamodb.ToDafny::EncryptedDataKeyDescription,
EncryptedDataKeyDescription._typeDescriptor()
);
}

public static DafnySequence<? extends EncryptedPart> EncryptedPartsList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,35 @@ public static DynamoDbTablesEncryptionConfig DynamoDbTablesEncryptionConfig(
}

public static EncryptedDataKeyDescription EncryptedDataKeyDescription(
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.EncryptedDataKeyDescription dafnyValue) {
EncryptedDataKeyDescription.Builder nativeBuilder = EncryptedDataKeyDescription.builder();
nativeBuilder.keyProviderId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyProviderId()));
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.EncryptedDataKeyDescription dafnyValue
) {
EncryptedDataKeyDescription.Builder nativeBuilder =
EncryptedDataKeyDescription.builder();
nativeBuilder.keyProviderId(
software.amazon.smithy.dafny.conversion.ToNative.Simple.String(
dafnyValue.dtor_keyProviderId()
)
);
if (dafnyValue.dtor_keyProviderInfo().is_Some()) {
nativeBuilder.keyProviderInfo(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyProviderInfo().dtor_value()));
nativeBuilder.keyProviderInfo(
software.amazon.smithy.dafny.conversion.ToNative.Simple.String(
dafnyValue.dtor_keyProviderInfo().dtor_value()
)
);
}
if (dafnyValue.dtor_branchKeyId().is_Some()) {
nativeBuilder.branchKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyId().dtor_value()));
nativeBuilder.branchKeyId(
software.amazon.smithy.dafny.conversion.ToNative.Simple.String(
dafnyValue.dtor_branchKeyId().dtor_value()
)
);
}
if (dafnyValue.dtor_branchKeyVersion().is_Some()) {
nativeBuilder.branchKeyVersion(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyVersion().dtor_value()));
nativeBuilder.branchKeyVersion(
software.amazon.smithy.dafny.conversion.ToNative.Simple.String(
dafnyValue.dtor_branchKeyVersion().dtor_value()
)
);
}
return nativeBuilder.build();
}
Expand Down Expand Up @@ -424,16 +442,26 @@ public static GetBranchKeyIdFromDdbKeyOutput GetBranchKeyIdFromDdbKeyOutput(
}

public static GetEncryptedDataKeyDescriptionInput GetEncryptedDataKeyDescriptionInput(
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionInput dafnyValue) {
GetEncryptedDataKeyDescriptionInput.Builder nativeBuilder = GetEncryptedDataKeyDescriptionInput.builder();
nativeBuilder.input(ToNative.GetEncryptedDataKeyDescriptionUnion(dafnyValue.dtor_input()));
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionInput dafnyValue
) {
GetEncryptedDataKeyDescriptionInput.Builder nativeBuilder =
GetEncryptedDataKeyDescriptionInput.builder();
nativeBuilder.input(
ToNative.GetEncryptedDataKeyDescriptionUnion(dafnyValue.dtor_input())
);
return nativeBuilder.build();
}

public static GetEncryptedDataKeyDescriptionOutput GetEncryptedDataKeyDescriptionOutput(
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionOutput dafnyValue) {
GetEncryptedDataKeyDescriptionOutput.Builder nativeBuilder = GetEncryptedDataKeyDescriptionOutput.builder();
nativeBuilder.EncryptedDataKeyDescriptionOutput(ToNative.EncryptedDataKeyDescriptionList(dafnyValue.dtor_EncryptedDataKeyDescriptionOutput()));
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionOutput dafnyValue
) {
GetEncryptedDataKeyDescriptionOutput.Builder nativeBuilder =
GetEncryptedDataKeyDescriptionOutput.builder();
nativeBuilder.EncryptedDataKeyDescriptionOutput(
ToNative.EncryptedDataKeyDescriptionList(
dafnyValue.dtor_EncryptedDataKeyDescriptionOutput()
)
);
return nativeBuilder.build();
}

Expand Down Expand Up @@ -759,13 +787,23 @@ public static BeaconStyle BeaconStyle(
}

public static GetEncryptedDataKeyDescriptionUnion GetEncryptedDataKeyDescriptionUnion(
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionUnion dafnyValue) {
GetEncryptedDataKeyDescriptionUnion.Builder nativeBuilder = GetEncryptedDataKeyDescriptionUnion.builder();
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetEncryptedDataKeyDescriptionUnion dafnyValue
) {
GetEncryptedDataKeyDescriptionUnion.Builder nativeBuilder =
GetEncryptedDataKeyDescriptionUnion.builder();
if (dafnyValue.is_header()) {
nativeBuilder.header(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_header()));
nativeBuilder.header(
software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(
dafnyValue.dtor_header()
)
);
}
if (dafnyValue.is_plaintextItem()) {
nativeBuilder.plaintextItem(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(dafnyValue.dtor_plaintextItem()));
if (dafnyValue.is_item()) {
nativeBuilder.item(
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.AttributeMap(
dafnyValue.dtor_item()
)
);
}
return nativeBuilder.build();
}
Expand Down Expand Up @@ -847,11 +885,17 @@ public static List<ConstructorPart> ConstructorPartList(
);
}

public static List<EncryptedDataKeyDescription> EncryptedDataKeyDescriptionList(
DafnySequence<? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.EncryptedDataKeyDescription> dafnyValue) {
public static List<
EncryptedDataKeyDescription
> EncryptedDataKeyDescriptionList(
DafnySequence<
? extends software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.EncryptedDataKeyDescription
> dafnyValue
) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::EncryptedDataKeyDescription);
dafnyValue,
software.amazon.cryptography.dbencryptionsdk.dynamodb.ToNative::EncryptedDataKeyDescription
);
}

public static List<EncryptedPart> EncryptedPartsList(
Expand Down
Loading
Loading