Skip to content

feat: update codegen to Dafny 4.7.0 #1203

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -873,7 +873,6 @@ structure CreateDynamoDbEncryptionBranchKeyIdSupplierOutput {
branchKeyIdSupplier: BranchKeyIdSupplierReference
}

/////////////
// Errors

@error("client")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ structure AtomicPrimitivesReference {}
@aws.polymorph#reference(service: aws.cryptography.dbEncryptionSdk.structuredEncryption#StructuredEncryption)
structure StructuredEncryptionReference {}

/////////////
// Errors

@error("client")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ list AuthList {
@aws.polymorph#reference(service: aws.cryptography.primitives#AwsCryptographicPrimitives)
structure AtomicPrimitivesReference {}

/////////////
// Errors

@error("client")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,17 @@ > GetBranchKeyIdFromDdbKey(
this._impl.GetBranchKeyIdFromDdbKey(nativeInput);
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput dafnyOutput =
ToDafny.GetBranchKeyIdFromDdbKeyOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
return Result.create_Success(
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput._typeDescriptor(),
Error._typeDescriptor(),
dafnyOutput
);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
return Result.create_Failure(
software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny.types.GetBranchKeyIdFromDdbKeyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Wrappers_Compile.Option;
import dafny.DafnyMap;
import dafny.DafnySequence;
import dafny.TypeDescriptor;
import java.lang.Boolean;
import java.lang.Character;
import java.lang.IllegalArgumentException;
Expand Down Expand Up @@ -129,31 +130,45 @@ public static BeaconVersion BeaconVersion(
(Objects.nonNull(nativeValue.compoundBeacons()) &&
nativeValue.compoundBeacons().size() > 0)
? Option.create_Some(
DafnySequence._typeDescriptor(CompoundBeacon._typeDescriptor()),
ToDafny.CompoundBeaconList(nativeValue.compoundBeacons())
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(CompoundBeacon._typeDescriptor())
);
Option<DafnySequence<? extends VirtualField>> virtualFields;
virtualFields =
(Objects.nonNull(nativeValue.virtualFields()) &&
nativeValue.virtualFields().size() > 0)
? Option.create_Some(
DafnySequence._typeDescriptor(VirtualField._typeDescriptor()),
ToDafny.VirtualFieldList(nativeValue.virtualFields())
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(VirtualField._typeDescriptor())
);
Option<DafnySequence<? extends EncryptedPart>> encryptedParts;
encryptedParts =
(Objects.nonNull(nativeValue.encryptedParts()) &&
nativeValue.encryptedParts().size() > 0)
? Option.create_Some(
DafnySequence._typeDescriptor(EncryptedPart._typeDescriptor()),
ToDafny.EncryptedPartsList(nativeValue.encryptedParts())
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(EncryptedPart._typeDescriptor())
);
Option<DafnySequence<? extends SignedPart>> signedParts;
signedParts =
(Objects.nonNull(nativeValue.signedParts()) &&
nativeValue.signedParts().size() > 0)
? Option.create_Some(ToDafny.SignedPartsList(nativeValue.signedParts()))
: Option.create_None();
? Option.create_Some(
DafnySequence._typeDescriptor(SignedPart._typeDescriptor()),
ToDafny.SignedPartsList(nativeValue.signedParts())
)
: Option.create_None(
DafnySequence._typeDescriptor(SignedPart._typeDescriptor())
);
return new BeaconVersion(
version,
keyStore,
Expand Down Expand Up @@ -184,22 +199,33 @@ public static CompoundBeacon CompoundBeacon(
(Objects.nonNull(nativeValue.encrypted()) &&
nativeValue.encrypted().size() > 0)
? Option.create_Some(
DafnySequence._typeDescriptor(EncryptedPart._typeDescriptor()),
ToDafny.EncryptedPartsList(nativeValue.encrypted())
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(EncryptedPart._typeDescriptor())
);
Option<DafnySequence<? extends SignedPart>> signed;
signed =
(Objects.nonNull(nativeValue.signed()) && nativeValue.signed().size() > 0)
? Option.create_Some(ToDafny.SignedPartsList(nativeValue.signed()))
: Option.create_None();
? Option.create_Some(
DafnySequence._typeDescriptor(SignedPart._typeDescriptor()),
ToDafny.SignedPartsList(nativeValue.signed())
)
: Option.create_None(
DafnySequence._typeDescriptor(SignedPart._typeDescriptor())
);
Option<DafnySequence<? extends Constructor>> constructors;
constructors =
(Objects.nonNull(nativeValue.constructors()) &&
nativeValue.constructors().size() > 0)
? Option.create_Some(
DafnySequence._typeDescriptor(Constructor._typeDescriptor()),
ToDafny.ConstructorList(nativeValue.constructors())
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(Constructor._typeDescriptor())
);
return new CompoundBeacon(name, split, encrypted, signed, constructors);
}

Expand Down Expand Up @@ -273,16 +299,22 @@ public static DynamoDbTableEncryptionConfig DynamoDbTableEncryptionConfig(
sortKeyName =
Objects.nonNull(nativeValue.sortKeyName())
? Option.create_Some(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR),
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.sortKeyName()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
);
Option<SearchConfig> search;
search =
Objects.nonNull(nativeValue.search())
? Option.create_Some(ToDafny.SearchConfig(nativeValue.search()))
: Option.create_None();
? Option.create_Some(
SearchConfig._typeDescriptor(),
ToDafny.SearchConfig(nativeValue.search())
)
: Option.create_None(SearchConfig._typeDescriptor());
DafnyMap<
? extends DafnySequence<? extends Character>,
? extends CryptoAction
Expand All @@ -296,61 +328,78 @@ public static DynamoDbTableEncryptionConfig DynamoDbTableEncryptionConfig(
(Objects.nonNull(nativeValue.allowedUnsignedAttributes()) &&
nativeValue.allowedUnsignedAttributes().size() > 0)
? Option.create_Some(
DafnySequence._typeDescriptor(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
),
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.AttributeNameList(
nativeValue.allowedUnsignedAttributes()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
)
);
Option<DafnySequence<? extends Character>> allowedUnsignedAttributePrefix;
allowedUnsignedAttributePrefix =
Objects.nonNull(nativeValue.allowedUnsignedAttributePrefix())
? Option.create_Some(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR),
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.allowedUnsignedAttributePrefix()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
);
Option<DBEAlgorithmSuiteId> algorithmSuiteId;
algorithmSuiteId =
Objects.nonNull(nativeValue.algorithmSuiteId())
? Option.create_Some(
DBEAlgorithmSuiteId._typeDescriptor(),
software.amazon.cryptography.materialproviders.ToDafny.DBEAlgorithmSuiteId(
nativeValue.algorithmSuiteId()
)
)
: Option.create_None();
: Option.create_None(DBEAlgorithmSuiteId._typeDescriptor());
Option<IKeyring> keyring;
keyring =
Objects.nonNull(nativeValue.keyring())
? Option.create_Some(
TypeDescriptor.reference(IKeyring.class),
software.amazon.cryptography.materialproviders.ToDafny.Keyring(
nativeValue.keyring()
)
)
: Option.create_None();
: Option.create_None(TypeDescriptor.reference(IKeyring.class));
Option<ICryptographicMaterialsManager> cmm;
cmm =
Objects.nonNull(nativeValue.cmm())
? Option.create_Some(
TypeDescriptor.reference(ICryptographicMaterialsManager.class),
software.amazon.cryptography.materialproviders.ToDafny.CryptographicMaterialsManager(
nativeValue.cmm()
)
)
: Option.create_None();
: Option.create_None(
TypeDescriptor.reference(ICryptographicMaterialsManager.class)
);
Option<LegacyOverride> legacyOverride;
legacyOverride =
Objects.nonNull(nativeValue.legacyOverride())
? Option.create_Some(
LegacyOverride._typeDescriptor(),
ToDafny.LegacyOverride(nativeValue.legacyOverride())
)
: Option.create_None();
: Option.create_None(LegacyOverride._typeDescriptor());
Option<PlaintextOverride> plaintextOverride;
plaintextOverride =
Objects.nonNull(nativeValue.plaintextOverride())
? Option.create_Some(
PlaintextOverride._typeDescriptor(),
ToDafny.PlaintextOverride(nativeValue.plaintextOverride())
)
: Option.create_None();
: Option.create_None(PlaintextOverride._typeDescriptor());
return new DynamoDbTableEncryptionConfig(
logicalTableName,
partitionKeyName,
Expand Down Expand Up @@ -393,29 +442,38 @@ public static EncryptedDataKeyDescription EncryptedDataKeyDescription(
keyProviderInfo =
Objects.nonNull(nativeValue.keyProviderInfo())
? Option.create_Some(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR),
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.keyProviderInfo()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
);
Option<DafnySequence<? extends Character>> branchKeyId;
branchKeyId =
Objects.nonNull(nativeValue.branchKeyId())
? Option.create_Some(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR),
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.branchKeyId()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
);
Option<DafnySequence<? extends Character>> branchKeyVersion;
branchKeyVersion =
Objects.nonNull(nativeValue.branchKeyVersion())
? Option.create_Some(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR),
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.branchKeyVersion()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
);
return new EncryptedDataKeyDescription(
keyProviderId,
keyProviderInfo,
Expand Down Expand Up @@ -570,11 +628,12 @@ public static LegacyOverride LegacyOverride(
defaultAttributeFlag =
Objects.nonNull(nativeValue.defaultAttributeFlag())
? Option.create_Some(
CryptoAction._typeDescriptor(),
software.amazon.cryptography.dbencryptionsdk.structuredencryption.ToDafny.CryptoAction(
nativeValue.defaultAttributeFlag()
)
)
: Option.create_None();
: Option.create_None(CryptoAction._typeDescriptor());
return new LegacyOverride(
policy,
encryptor,
Expand Down Expand Up @@ -603,11 +662,12 @@ public static MultiKeyStore MultiKeyStore(
cache =
Objects.nonNull(nativeValue.cache())
? Option.create_Some(
CacheType._typeDescriptor(),
software.amazon.cryptography.materialproviders.ToDafny.CacheType(
nativeValue.cache()
)
)
: Option.create_None();
: Option.create_None(CacheType._typeDescriptor());
return new MultiKeyStore(keyFieldName, cacheTTL, cache);
}

Expand Down Expand Up @@ -666,11 +726,14 @@ public static SignedPart SignedPart(
loc =
Objects.nonNull(nativeValue.loc())
? Option.create_Some(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR),
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.loc()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
);
return new SignedPart(name, prefix, loc);
}

Expand Down Expand Up @@ -701,16 +764,22 @@ public static StandardBeacon StandardBeacon(
loc =
Objects.nonNull(nativeValue.loc())
? Option.create_Some(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR),
software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(
nativeValue.loc()
)
)
: Option.create_None();
: Option.create_None(
DafnySequence._typeDescriptor(TypeDescriptor.CHAR)
);
Option<BeaconStyle> style;
style =
Objects.nonNull(nativeValue.style())
? Option.create_Some(ToDafny.BeaconStyle(nativeValue.style()))
: Option.create_None();
? Option.create_Some(
BeaconStyle._typeDescriptor(),
ToDafny.BeaconStyle(nativeValue.style())
)
: Option.create_None(BeaconStyle._typeDescriptor());
return new StandardBeacon(name, length, loc, style);
}

Expand Down Expand Up @@ -744,8 +813,13 @@ public static VirtualPart VirtualPart(
Option<DafnySequence<? extends VirtualTransform>> trans;
trans =
(Objects.nonNull(nativeValue.trans()) && nativeValue.trans().size() > 0)
? Option.create_Some(ToDafny.VirtualTransformList(nativeValue.trans()))
: Option.create_None();
? Option.create_Some(
DafnySequence._typeDescriptor(VirtualTransform._typeDescriptor()),
ToDafny.VirtualTransformList(nativeValue.trans())
)
: Option.create_None(
DafnySequence._typeDescriptor(VirtualTransform._typeDescriptor())
);
return new VirtualPart(loc, trans);
}

Expand Down
Loading
Loading