diff --git a/DynamoDbEncryptionMiddlewareInternal/Model/AwsCryptographyDynamoDbEncryptionTypes.dfy b/DynamoDbEncryptionMiddlewareInternal/Model/AwsCryptographyDynamoDbEncryptionTypes.dfy index cf8468b48..e77b26f3a 100644 --- a/DynamoDbEncryptionMiddlewareInternal/Model/AwsCryptographyDynamoDbEncryptionTypes.dfy +++ b/DynamoDbEncryptionMiddlewareInternal/Model/AwsCryptographyDynamoDbEncryptionTypes.dfy @@ -67,7 +67,8 @@ include "../../private-aws-encryption-sdk-dafny-staging/StandardLibrary/src/Inde nameonly version: VersionNumber , nameonly keyring: AwsCryptographyMaterialProvidersTypes.IKeyring , nameonly standardBeacons: Option , - nameonly compoundBeacons: Option + nameonly compoundBeacons: Option , + nameonly virtualFields: Option ) type BeaconVersionList = x: seq | IsValid_BeaconVersionList(x) witness * predicate method IsValid_BeaconVersionList(x: seq) { @@ -771,6 +772,31 @@ include "../../private-aws-encryption-sdk-dafny-staging/StandardLibrary/src/Inde ) datatype GetItemOutputTransformOutput = | GetItemOutputTransformOutput ( nameonly transformedOutput: ComAmazonawsDynamodbTypes.GetItemOutput + ) + datatype GetPrefix = | GetPrefix ( + nameonly length: int32 + ) + datatype GetSegment = | GetSegment ( + nameonly split: Char , + nameonly index: int32 + ) + datatype GetSegments = | GetSegments ( + nameonly split: Char , + nameonly low: int32 , + nameonly high: int32 + ) + datatype GetSubstring = | GetSubstring ( + nameonly low: int32 , + nameonly high: int32 + ) + datatype GetSuffix = | GetSuffix ( + nameonly length: int32 + ) + datatype Insert = | Insert ( + nameonly literal: string + ) + datatype Lower = | Lower ( + ) datatype NonSensitivePart = | NonSensitivePart ( nameonly name: string , @@ -902,10 +928,42 @@ include "../../private-aws-encryption-sdk-dafny-staging/StandardLibrary/src/Inde ) datatype UpdateTableOutputTransformOutput = | UpdateTableOutputTransformOutput ( nameonly transformedOutput: ComAmazonawsDynamodbTypes.UpdateTableOutput + ) + datatype Upper = | Upper ( + ) type VersionNumber = x: int32 | IsValid_VersionNumber(x) witness * predicate method IsValid_VersionNumber(x: int32) { ( 1 <= x ) +} + datatype VirtualField = | VirtualField ( + nameonly name: string , + nameonly parts: VirtualPartList + ) + type VirtualFieldList = x: seq | IsValid_VirtualFieldList(x) witness * + predicate method IsValid_VirtualFieldList(x: seq) { + ( 1 <= |x| ) +} + datatype VirtualPart = | VirtualPart ( + nameonly loc: TerminalLocation , + nameonly trans: Option + ) + type VirtualPartList = x: seq | IsValid_VirtualPartList(x) witness * + predicate method IsValid_VirtualPartList(x: seq) { + ( 1 <= |x| ) +} + datatype VirtualTransform = + | upper(upper: Upper) + | lower(lower: Lower) + | insert(insert: Insert) + | prefix(prefix: GetPrefix) + | suffix(suffix: GetSuffix) + | substring(substring: GetSubstring) + | segment(segment: GetSegment) + | segments(segments: GetSegments) + type VirtualTransformList = x: seq | IsValid_VirtualTransformList(x) witness * + predicate method IsValid_VirtualTransformList(x: seq) { + ( 1 <= |x| ) } datatype Error = // Local Error structures are listed here @@ -955,7 +1013,9 @@ include "../../private-aws-encryption-sdk-dafny-staging/StandardLibrary/src/Inde function method DefaultDynamoDbEncryptionConfig(): DynamoDbEncryptionConfig method DynamoDbEncryption(config: DynamoDbEncryptionConfig := DefaultDynamoDbEncryptionConfig()) returns (res: Result) -// TODO smithy->Dafny needs to generate the following + // TODO smithy->Dafny correctly generates something equivalent the following + // but as a result DynamoDbEncryption.DynamoDbEncryption and TestFixtures.GetDynamoDbEncryption + // take too long to verify ///// MANUAL UPDATE STARTS HERE requires var cmms := set cfg | cfg in config.tableEncryptionConfigs.Values && cfg.cmm.Some? :: cfg.cmm.value; diff --git a/DynamoDbEncryptionMiddlewareInternal/Model/DynamoDbEncryptionMiddlewareInternal.smithy b/DynamoDbEncryptionMiddlewareInternal/Model/DynamoDbEncryptionMiddlewareInternal.smithy index 0f782768e..0c02b65fb 100644 --- a/DynamoDbEncryptionMiddlewareInternal/Model/DynamoDbEncryptionMiddlewareInternal.smithy +++ b/DynamoDbEncryptionMiddlewareInternal/Model/DynamoDbEncryptionMiddlewareInternal.smithy @@ -124,6 +124,21 @@ list BeaconVersionList { member: BeaconVersion } +@length(min: 1) +list VirtualFieldList { + member: VirtualField +} + +@length(min: 1) +list VirtualPartList { + member: VirtualPart +} + +@length(min: 1) +list VirtualTransformList { + member: VirtualTransform +} + @length(min: 1) list StandardBeaconList { member: StandardBeacon @@ -154,6 +169,93 @@ list ConstructorPartList { member: ConstructorPart } +structure VirtualField { + @required + name : String, + @required + parts : VirtualPartList, +} + +structure VirtualPart { + @required + loc : TerminalLocation, + trans : VirtualTransformList, +} + +// Convert ASCII characters to upper case +structure Upper {} + +// Convert ASCII characters to lower case +structure Lower {} + +// Append this literal string +structure Insert { + @required + literal : String +} + +// return the first part of the string +// Positive length : return that many characters from the front +// Negative length : exclude -length characters from the end +// e.g. GetPrefix(-1) returns all but the last character +structure GetPrefix { + @required + length : Integer +} + +// return the last part of the string +// Positive length : return that many characters from the end +// Negative length : exclude -length characters from the front +// e.g. GetSuffix(-1) returns all but the first character +structure GetSuffix { + @required + length : Integer +} + +// return range of characters, 0-based counting +// low is inclusive, high is exclusive +// negative numbers count from the end, -1 is the end of string +// i.e. the whole string is GetSubstring(0, -1) +// e.g. for "123456789" +// GetSubstring(2, 6) == GetSubstring(2, -4) == "3456" +structure GetSubstring { + @required + low : Integer, + @required + high : Integer, +} + +// split string on character, then return one piece. +// 'index' has the same semantics as 'low' in GetSubstring +structure GetSegment { + @required + split : Char, + @required + index : Integer +} + +// split string on character, then return range of pieces. +// 'low' and 'high' have the same semantics as GetSubstring +structure GetSegments { + @required + split : Char, + @required + low : Integer, + @required + high : Integer, +} + +union VirtualTransform { + upper: Upper, + lower: Lower, + insert: Insert, + prefix: GetPrefix, + suffix: GetSuffix, + substring : GetSubstring, + segment : GetSegment, + segments : GetSegments +} + structure SensitivePart { @required name : String, @@ -210,6 +312,7 @@ structure BeaconVersion { keyring: KeyringReference, // Must be Hierarchy Keyring standardBeacons : StandardBeaconList, compoundBeacons : CompoundBeaconList, + virtualFields : VirtualFieldList, } structure SearchConfig { diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToDafny.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToDafny.java index ee64e4489..efabf0993 100644 --- a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToDafny.java +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToDafny.java @@ -47,6 +47,13 @@ import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetItemInputTransformOutput; import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetItemOutputTransformInput; import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetItemOutputTransformOutput; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetPrefix; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSegment; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSegments; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSubstring; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSuffix; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.Insert; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.Lower; import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.NonSensitivePart; import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.PutItemInputTransformInput; import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.PutItemInputTransformOutput; @@ -79,6 +86,10 @@ import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.UpdateTableInputTransformOutput; import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.UpdateTableOutputTransformInput; import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.UpdateTableOutputTransformOutput; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.Upper; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.VirtualField; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.VirtualPart; +import Dafny.Aws.Cryptography.DynamoDbEncryption.Types.VirtualTransform; import Dafny.Aws.Cryptography.MaterialProviders.Types.DBEAlgorithmSuiteId; import Dafny.Aws.Cryptography.MaterialProviders.Types.ICryptographicMaterialsManager; import Dafny.Aws.Cryptography.MaterialProviders.Types.IKeyring; @@ -120,6 +131,7 @@ import dafny.DafnySequence; import java.lang.Boolean; import java.lang.Character; +import java.lang.IllegalArgumentException; import java.lang.Integer; import java.lang.String; import java.util.List; @@ -156,6 +168,13 @@ public static Error Error(CollectionOfErrors nativeValue) { return Error.create_CollectionOfErrors(list); } + public static GetSuffix GetSuffix( + software.amazon.cryptography.dynamoDbEncryption.model.GetSuffix nativeValue) { + Integer length; + length = (nativeValue.length()); + return new GetSuffix(length); + } + public static TransactWriteItemsOutputTransformInput TransactWriteItemsOutputTransformInput( software.amazon.cryptography.dynamoDbEncryption.model.TransactWriteItemsOutputTransformInput nativeValue) { TransactWriteItemsOutput sdkOutput; @@ -301,6 +320,29 @@ public static SearchConfig SearchConfig( return new SearchConfig(versions, writeVersion); } + public static Lower Lower( + software.amazon.cryptography.dynamoDbEncryption.model.Lower nativeValue) { + return new Lower(); + } + + public static VirtualField VirtualField( + software.amazon.cryptography.dynamoDbEncryption.model.VirtualField nativeValue) { + DafnySequence name; + name = software.amazon.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()); + DafnySequence parts; + parts = ToDafny.VirtualPartList(nativeValue.parts()); + return new VirtualField(name, parts); + } + + public static GetSegment GetSegment( + software.amazon.cryptography.dynamoDbEncryption.model.GetSegment nativeValue) { + DafnySequence split; + split = software.amazon.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.split()); + Integer index; + index = (nativeValue.index()); + return new GetSegment(split, index); + } + public static PutItemInputTransformOutput PutItemInputTransformOutput( software.amazon.cryptography.dynamoDbEncryption.model.PutItemInputTransformOutput nativeValue) { PutItemInput transformedInput; @@ -324,6 +366,17 @@ public static DeleteItemInputTransformInput DeleteItemInputTransformInput( return new DeleteItemInputTransformInput(sdkInput); } + public static GetSegments GetSegments( + software.amazon.cryptography.dynamoDbEncryption.model.GetSegments nativeValue) { + DafnySequence split; + split = software.amazon.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.split()); + Integer low; + low = (nativeValue.low()); + Integer high; + high = (nativeValue.high()); + return new GetSegments(split, low, high); + } + public static QueryOutputTransformInput QueryOutputTransformInput( software.amazon.cryptography.dynamoDbEncryption.model.QueryOutputTransformInput nativeValue) { QueryOutput sdkOutput; @@ -384,6 +437,13 @@ public static GetItemOutputTransformInput GetItemOutputTransformInput( return new GetItemOutputTransformInput(sdkOutput, originalInput); } + public static GetPrefix GetPrefix( + software.amazon.cryptography.dynamoDbEncryption.model.GetPrefix nativeValue) { + Integer length; + length = (nativeValue.length()); + return new GetPrefix(length); + } + public static TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransformOutput( software.amazon.cryptography.dynamoDbEncryption.model.TransactWriteItemsInputTransformOutput nativeValue) { TransactWriteItemsInput transformedInput; @@ -414,7 +474,11 @@ public static BeaconVersion BeaconVersion( compoundBeacons = (Objects.nonNull(nativeValue.compoundBeacons()) && nativeValue.compoundBeacons().size() > 0) ? Option.create_Some(ToDafny.CompoundBeaconList(nativeValue.compoundBeacons())) : Option.create_None(); - return new BeaconVersion(version, keyring, standardBeacons, compoundBeacons); + Option> virtualFields; + virtualFields = (Objects.nonNull(nativeValue.virtualFields()) && nativeValue.virtualFields().size() > 0) ? + Option.create_Some(ToDafny.VirtualFieldList(nativeValue.virtualFields())) + : Option.create_None(); + return new BeaconVersion(version, keyring, standardBeacons, compoundBeacons, virtualFields); } public static BatchGetItemInputTransformOutput BatchGetItemInputTransformOutput( @@ -424,6 +488,13 @@ public static BatchGetItemInputTransformOutput BatchGetItemInputTransformOutput( return new BatchGetItemInputTransformOutput(transformedInput); } + public static Insert Insert( + software.amazon.cryptography.dynamoDbEncryption.model.Insert nativeValue) { + DafnySequence literal; + literal = software.amazon.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.literal()); + return new Insert(literal); + } + public static BatchExecuteStatementOutputTransformInput BatchExecuteStatementOutputTransformInput( software.amazon.cryptography.dynamoDbEncryption.model.BatchExecuteStatementOutputTransformInput nativeValue) { BatchExecuteStatementOutput sdkOutput; @@ -642,6 +713,20 @@ public static UpdateTableInputTransformOutput UpdateTableInputTransformOutput( return new UpdateTableInputTransformOutput(transformedInput); } + public static GetSubstring GetSubstring( + software.amazon.cryptography.dynamoDbEncryption.model.GetSubstring nativeValue) { + Integer low; + low = (nativeValue.low()); + Integer high; + high = (nativeValue.high()); + return new GetSubstring(low, high); + } + + public static Upper Upper( + software.amazon.cryptography.dynamoDbEncryption.model.Upper nativeValue) { + return new Upper(); + } + public static QueryInputTransformInput QueryInputTransformInput( software.amazon.cryptography.dynamoDbEncryption.model.QueryInputTransformInput nativeValue) { QueryInput sdkInput; @@ -738,6 +823,17 @@ public static BatchGetItemOutputTransformOutput BatchGetItemOutputTransformOutpu return new BatchGetItemOutputTransformOutput(transformedOutput); } + public static VirtualPart VirtualPart( + software.amazon.cryptography.dynamoDbEncryption.model.VirtualPart nativeValue) { + DafnySequence loc; + loc = software.amazon.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.loc()); + Option> trans; + trans = (Objects.nonNull(nativeValue.trans()) && nativeValue.trans().size() > 0) ? + Option.create_Some(ToDafny.VirtualTransformList(nativeValue.trans())) + : Option.create_None(); + return new VirtualPart(loc, trans); + } + public static CreateTableInputTransformOutput CreateTableInputTransformOutput( software.amazon.cryptography.dynamoDbEncryption.model.CreateTableInputTransformOutput nativeValue) { CreateTableInput transformedInput; @@ -788,6 +884,43 @@ public static Error Error(DynamoDbEncryptionException nativeValue) { return new Error_DynamoDbEncryptionException(message); } + public static VirtualTransform VirtualTransform( + software.amazon.cryptography.dynamoDbEncryption.model.VirtualTransform nativeValue) { + if (Objects.nonNull(nativeValue.upper())) { + return VirtualTransform.create_upper(ToDafny.Upper(nativeValue.upper())); + } + if (Objects.nonNull(nativeValue.lower())) { + return VirtualTransform.create_lower(ToDafny.Lower(nativeValue.lower())); + } + if (Objects.nonNull(nativeValue.insert())) { + return VirtualTransform.create_insert(ToDafny.Insert(nativeValue.insert())); + } + if (Objects.nonNull(nativeValue.prefix())) { + return VirtualTransform.create_prefix(ToDafny.GetPrefix(nativeValue.prefix())); + } + if (Objects.nonNull(nativeValue.suffix())) { + return VirtualTransform.create_suffix(ToDafny.GetSuffix(nativeValue.suffix())); + } + if (Objects.nonNull(nativeValue.substring())) { + return VirtualTransform.create_substring(ToDafny.GetSubstring(nativeValue.substring())); + } + if (Objects.nonNull(nativeValue.segment())) { + return VirtualTransform.create_segment(ToDafny.GetSegment(nativeValue.segment())); + } + if (Objects.nonNull(nativeValue.segments())) { + return VirtualTransform.create_segments(ToDafny.GetSegments(nativeValue.segments())); + } + throw new IllegalArgumentException("Cannot convert " + nativeValue + " to Dafny.Aws.Cryptography.DynamoDbEncryption.Types.VirtualTransform."); + } + + public static DafnySequence VirtualFieldList( + List nativeValue) { + return software.amazon.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue, + software.amazon.cryptography.dynamoDbEncryption.ToDafny::VirtualField, + VirtualField._typeDescriptor()); + } + public static DafnySequence StandardBeaconList( List nativeValue) { return software.amazon.dafny.conversion.ToDafny.Aggregate.GenericToSequence( @@ -796,6 +929,22 @@ public static DafnySequence StandardBeaconList( StandardBeacon._typeDescriptor()); } + public static DafnySequence VirtualPartList( + List nativeValue) { + return software.amazon.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue, + software.amazon.cryptography.dynamoDbEncryption.ToDafny::VirtualPart, + VirtualPart._typeDescriptor()); + } + + public static DafnySequence VirtualTransformList( + List nativeValue) { + return software.amazon.dafny.conversion.ToDafny.Aggregate.GenericToSequence( + nativeValue, + software.amazon.cryptography.dynamoDbEncryption.ToDafny::VirtualTransform, + VirtualTransform._typeDescriptor()); + } + public static DafnySequence NonSensitivePartsList( List nativeValue) { return software.amazon.dafny.conversion.ToDafny.Aggregate.GenericToSequence( diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToNative.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToNative.java index 8d1f1159d..2e8967c8c 100644 --- a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToNative.java +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/ToNative.java @@ -57,6 +57,13 @@ import software.amazon.cryptography.dynamoDbEncryption.model.GetItemInputTransformOutput; import software.amazon.cryptography.dynamoDbEncryption.model.GetItemOutputTransformInput; import software.amazon.cryptography.dynamoDbEncryption.model.GetItemOutputTransformOutput; +import software.amazon.cryptography.dynamoDbEncryption.model.GetPrefix; +import software.amazon.cryptography.dynamoDbEncryption.model.GetSegment; +import software.amazon.cryptography.dynamoDbEncryption.model.GetSegments; +import software.amazon.cryptography.dynamoDbEncryption.model.GetSubstring; +import software.amazon.cryptography.dynamoDbEncryption.model.GetSuffix; +import software.amazon.cryptography.dynamoDbEncryption.model.Insert; +import software.amazon.cryptography.dynamoDbEncryption.model.Lower; import software.amazon.cryptography.dynamoDbEncryption.model.NativeError; import software.amazon.cryptography.dynamoDbEncryption.model.NonSensitivePart; import software.amazon.cryptography.dynamoDbEncryption.model.OpaqueError; @@ -91,6 +98,10 @@ import software.amazon.cryptography.dynamoDbEncryption.model.UpdateTableInputTransformOutput; import software.amazon.cryptography.dynamoDbEncryption.model.UpdateTableOutputTransformInput; import software.amazon.cryptography.dynamoDbEncryption.model.UpdateTableOutputTransformOutput; +import software.amazon.cryptography.dynamoDbEncryption.model.Upper; +import software.amazon.cryptography.dynamoDbEncryption.model.VirtualField; +import software.amazon.cryptography.dynamoDbEncryption.model.VirtualPart; +import software.amazon.cryptography.dynamoDbEncryption.model.VirtualTransform; public class ToNative { public static OpaqueError Error(Error_Opaque dafnyValue) { @@ -129,6 +140,13 @@ public static NativeError Error(Error dafnyValue) { return nativeBuilder.build(); } + public static GetSuffix GetSuffix( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSuffix dafnyValue) { + GetSuffix.Builder nativeBuilder = GetSuffix.builder(); + nativeBuilder.length((dafnyValue.dtor_length())); + return nativeBuilder.build(); + } + public static TransactWriteItemsOutputTransformInput TransactWriteItemsOutputTransformInput( Dafny.Aws.Cryptography.DynamoDbEncryption.Types.TransactWriteItemsOutputTransformInput dafnyValue) { TransactWriteItemsOutputTransformInput.Builder nativeBuilder = TransactWriteItemsOutputTransformInput.builder(); @@ -262,6 +280,27 @@ public static SearchConfig SearchConfig( return nativeBuilder.build(); } + public static Lower Lower(Dafny.Aws.Cryptography.DynamoDbEncryption.Types.Lower dafnyValue) { + Lower.Builder nativeBuilder = Lower.builder(); + return nativeBuilder.build(); + } + + public static VirtualField VirtualField( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.VirtualField dafnyValue) { + VirtualField.Builder nativeBuilder = VirtualField.builder(); + nativeBuilder.name(software.amazon.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_name())); + nativeBuilder.parts(ToNative.VirtualPartList(dafnyValue.dtor_parts())); + return nativeBuilder.build(); + } + + public static GetSegment GetSegment( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSegment dafnyValue) { + GetSegment.Builder nativeBuilder = GetSegment.builder(); + nativeBuilder.split(software.amazon.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_split())); + nativeBuilder.index((dafnyValue.dtor_index())); + return nativeBuilder.build(); + } + public static PutItemInputTransformOutput PutItemInputTransformOutput( Dafny.Aws.Cryptography.DynamoDbEncryption.Types.PutItemInputTransformOutput dafnyValue) { PutItemInputTransformOutput.Builder nativeBuilder = PutItemInputTransformOutput.builder(); @@ -284,6 +323,15 @@ public static DeleteItemInputTransformInput DeleteItemInputTransformInput( return nativeBuilder.build(); } + public static GetSegments GetSegments( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSegments dafnyValue) { + GetSegments.Builder nativeBuilder = GetSegments.builder(); + nativeBuilder.split(software.amazon.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_split())); + nativeBuilder.low((dafnyValue.dtor_low())); + nativeBuilder.high((dafnyValue.dtor_high())); + return nativeBuilder.build(); + } + public static QueryOutputTransformInput QueryOutputTransformInput( Dafny.Aws.Cryptography.DynamoDbEncryption.Types.QueryOutputTransformInput dafnyValue) { QueryOutputTransformInput.Builder nativeBuilder = QueryOutputTransformInput.builder(); @@ -342,6 +390,13 @@ public static GetItemOutputTransformInput GetItemOutputTransformInput( return nativeBuilder.build(); } + public static GetPrefix GetPrefix( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetPrefix dafnyValue) { + GetPrefix.Builder nativeBuilder = GetPrefix.builder(); + nativeBuilder.length((dafnyValue.dtor_length())); + return nativeBuilder.build(); + } + public static TransactWriteItemsInputTransformOutput TransactWriteItemsInputTransformOutput( Dafny.Aws.Cryptography.DynamoDbEncryption.Types.TransactWriteItemsInputTransformOutput dafnyValue) { TransactWriteItemsInputTransformOutput.Builder nativeBuilder = TransactWriteItemsInputTransformOutput.builder(); @@ -368,6 +423,9 @@ public static BeaconVersion BeaconVersion( if (dafnyValue.dtor_compoundBeacons().is_Some()) { nativeBuilder.compoundBeacons(ToNative.CompoundBeaconList(dafnyValue.dtor_compoundBeacons().dtor_value())); } + if (dafnyValue.dtor_virtualFields().is_Some()) { + nativeBuilder.virtualFields(ToNative.VirtualFieldList(dafnyValue.dtor_virtualFields().dtor_value())); + } return nativeBuilder.build(); } @@ -378,6 +436,12 @@ public static BatchGetItemInputTransformOutput BatchGetItemInputTransformOutput( return nativeBuilder.build(); } + public static Insert Insert(Dafny.Aws.Cryptography.DynamoDbEncryption.Types.Insert dafnyValue) { + Insert.Builder nativeBuilder = Insert.builder(); + nativeBuilder.literal(software.amazon.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_literal())); + return nativeBuilder.build(); + } + public static BatchExecuteStatementOutputTransformInput BatchExecuteStatementOutputTransformInput( Dafny.Aws.Cryptography.DynamoDbEncryption.Types.BatchExecuteStatementOutputTransformInput dafnyValue) { BatchExecuteStatementOutputTransformInput.Builder nativeBuilder = BatchExecuteStatementOutputTransformInput.builder(); @@ -582,6 +646,19 @@ public static UpdateTableInputTransformOutput UpdateTableInputTransformOutput( return nativeBuilder.build(); } + public static GetSubstring GetSubstring( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.GetSubstring dafnyValue) { + GetSubstring.Builder nativeBuilder = GetSubstring.builder(); + nativeBuilder.low((dafnyValue.dtor_low())); + nativeBuilder.high((dafnyValue.dtor_high())); + return nativeBuilder.build(); + } + + public static Upper Upper(Dafny.Aws.Cryptography.DynamoDbEncryption.Types.Upper dafnyValue) { + Upper.Builder nativeBuilder = Upper.builder(); + return nativeBuilder.build(); + } + public static QueryInputTransformInput QueryInputTransformInput( Dafny.Aws.Cryptography.DynamoDbEncryption.Types.QueryInputTransformInput dafnyValue) { QueryInputTransformInput.Builder nativeBuilder = QueryInputTransformInput.builder(); @@ -672,6 +749,16 @@ public static BatchGetItemOutputTransformOutput BatchGetItemOutputTransformOutpu return nativeBuilder.build(); } + public static VirtualPart VirtualPart( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.VirtualPart dafnyValue) { + VirtualPart.Builder nativeBuilder = VirtualPart.builder(); + nativeBuilder.loc(software.amazon.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_loc())); + if (dafnyValue.dtor_trans().is_Some()) { + nativeBuilder.trans(ToNative.VirtualTransformList(dafnyValue.dtor_trans().dtor_value())); + } + return nativeBuilder.build(); + } + public static CreateTableInputTransformOutput CreateTableInputTransformOutput( Dafny.Aws.Cryptography.DynamoDbEncryption.Types.CreateTableInputTransformOutput dafnyValue) { CreateTableInputTransformOutput.Builder nativeBuilder = CreateTableInputTransformOutput.builder(); @@ -715,6 +802,43 @@ public static TransactWriteItemsOutputTransformOutput TransactWriteItemsOutputTr return nativeBuilder.build(); } + public static VirtualTransform VirtualTransform( + Dafny.Aws.Cryptography.DynamoDbEncryption.Types.VirtualTransform dafnyValue) { + VirtualTransform.Builder nativeBuilder = VirtualTransform.builder(); + if (dafnyValue.is_upper()) { + nativeBuilder.upper(ToNative.Upper(dafnyValue.dtor_upper())); + } + if (dafnyValue.is_lower()) { + nativeBuilder.lower(ToNative.Lower(dafnyValue.dtor_lower())); + } + if (dafnyValue.is_insert()) { + nativeBuilder.insert(ToNative.Insert(dafnyValue.dtor_insert())); + } + if (dafnyValue.is_prefix()) { + nativeBuilder.prefix(ToNative.GetPrefix(dafnyValue.dtor_prefix())); + } + if (dafnyValue.is_suffix()) { + nativeBuilder.suffix(ToNative.GetSuffix(dafnyValue.dtor_suffix())); + } + if (dafnyValue.is_substring()) { + nativeBuilder.substring(ToNative.GetSubstring(dafnyValue.dtor_substring())); + } + if (dafnyValue.is_segment()) { + nativeBuilder.segment(ToNative.GetSegment(dafnyValue.dtor_segment())); + } + if (dafnyValue.is_segments()) { + nativeBuilder.segments(ToNative.GetSegments(dafnyValue.dtor_segments())); + } + return nativeBuilder.build(); + } + + public static List VirtualFieldList( + DafnySequence dafnyValue) { + return software.amazon.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue, + software.amazon.cryptography.dynamoDbEncryption.ToNative::VirtualField); + } + public static List StandardBeaconList( DafnySequence dafnyValue) { return software.amazon.dafny.conversion.ToNative.Aggregate.GenericToList( @@ -722,6 +846,20 @@ public static List StandardBeaconList( software.amazon.cryptography.dynamoDbEncryption.ToNative::StandardBeacon); } + public static List VirtualPartList( + DafnySequence dafnyValue) { + return software.amazon.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue, + software.amazon.cryptography.dynamoDbEncryption.ToNative::VirtualPart); + } + + public static List VirtualTransformList( + DafnySequence dafnyValue) { + return software.amazon.dafny.conversion.ToNative.Aggregate.GenericToList( + dafnyValue, + software.amazon.cryptography.dynamoDbEncryption.ToNative::VirtualTransform); + } + public static List NonSensitivePartsList( DafnySequence dafnyValue) { return software.amazon.dafny.conversion.ToNative.Aggregate.GenericToList( diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/BeaconVersion.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/BeaconVersion.java index 33e692d01..65da1ff97 100644 --- a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/BeaconVersion.java +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/BeaconVersion.java @@ -17,11 +17,14 @@ public class BeaconVersion { private final List compoundBeacons; + private final List virtualFields; + protected BeaconVersion(BuilderImpl builder) { this.version = builder.version(); this.keyring = builder.keyring(); this.standardBeacons = builder.standardBeacons(); this.compoundBeacons = builder.compoundBeacons(); + this.virtualFields = builder.virtualFields(); } public int version() { @@ -40,6 +43,10 @@ public List compoundBeacons() { return this.compoundBeacons; } + public List virtualFields() { + return this.virtualFields; + } + public Builder toBuilder() { return new BuilderImpl(this); } @@ -65,6 +72,10 @@ public interface Builder { List compoundBeacons(); + Builder virtualFields(List virtualFields); + + List virtualFields(); + BeaconVersion build(); } @@ -77,6 +88,8 @@ static class BuilderImpl implements Builder { protected List compoundBeacons; + protected List virtualFields; + protected BuilderImpl() { } @@ -85,6 +98,7 @@ protected BuilderImpl(BeaconVersion model) { this.keyring = model.keyring(); this.standardBeacons = model.standardBeacons(); this.compoundBeacons = model.compoundBeacons(); + this.virtualFields = model.virtualFields(); } public Builder version(int version) { @@ -123,6 +137,15 @@ public List compoundBeacons() { return this.compoundBeacons; } + public Builder virtualFields(List virtualFields) { + this.virtualFields = virtualFields; + return this; + } + + public List virtualFields() { + return this.virtualFields; + } + public BeaconVersion build() { if (Objects.isNull(this.version())) { throw new IllegalArgumentException("Missing value for required field `version`"); @@ -139,6 +162,9 @@ public BeaconVersion build() { if (Objects.nonNull(this.compoundBeacons()) && this.compoundBeacons().size() < 1) { throw new IllegalArgumentException("The size of `compoundBeacons` must be greater than or equal to 1"); } + if (Objects.nonNull(this.virtualFields()) && this.virtualFields().size() < 1) { + throw new IllegalArgumentException("The size of `virtualFields` must be greater than or equal to 1"); + } return new BeaconVersion(this); } } diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetPrefix.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetPrefix.java new file mode 100644 index 000000000..c9c6d5cca --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetPrefix.java @@ -0,0 +1,61 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.Objects; + +public class GetPrefix { + private final Integer length; + + protected GetPrefix(BuilderImpl builder) { + this.length = builder.length(); + } + + public Integer length() { + return this.length; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder length(Integer length); + + Integer length(); + + GetPrefix build(); + } + + static class BuilderImpl implements Builder { + protected Integer length; + + protected BuilderImpl() { + } + + protected BuilderImpl(GetPrefix model) { + this.length = model.length(); + } + + public Builder length(Integer length) { + this.length = length; + return this; + } + + public Integer length() { + return this.length; + } + + public GetPrefix build() { + if (Objects.isNull(this.length())) { + throw new IllegalArgumentException("Missing value for required field `length`"); + } + return new GetPrefix(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSegment.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSegment.java new file mode 100644 index 000000000..2ceffd78d --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSegment.java @@ -0,0 +1,93 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.Objects; + +public class GetSegment { + private final String split; + + private final Integer index; + + protected GetSegment(BuilderImpl builder) { + this.split = builder.split(); + this.index = builder.index(); + } + + public String split() { + return this.split; + } + + public Integer index() { + return this.index; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder split(String split); + + String split(); + + Builder index(Integer index); + + Integer index(); + + GetSegment build(); + } + + static class BuilderImpl implements Builder { + protected String split; + + protected Integer index; + + protected BuilderImpl() { + } + + protected BuilderImpl(GetSegment model) { + this.split = model.split(); + this.index = model.index(); + } + + public Builder split(String split) { + this.split = split; + return this; + } + + public String split() { + return this.split; + } + + public Builder index(Integer index) { + this.index = index; + return this; + } + + public Integer index() { + return this.index; + } + + public GetSegment build() { + if (Objects.isNull(this.split())) { + throw new IllegalArgumentException("Missing value for required field `split`"); + } + if (Objects.nonNull(this.split()) && this.split().length() < 1) { + throw new IllegalArgumentException("The size of `split` must be greater than or equal to 1"); + } + if (Objects.nonNull(this.split()) && this.split().length() > 1) { + throw new IllegalArgumentException("The size of `split` must be less than or equal to 1"); + } + if (Objects.isNull(this.index())) { + throw new IllegalArgumentException("Missing value for required field `index`"); + } + return new GetSegment(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSegments.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSegments.java new file mode 100644 index 000000000..b8ce898bd --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSegments.java @@ -0,0 +1,119 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.Objects; + +public class GetSegments { + private final String split; + + private final Integer low; + + private final Integer high; + + protected GetSegments(BuilderImpl builder) { + this.split = builder.split(); + this.low = builder.low(); + this.high = builder.high(); + } + + public String split() { + return this.split; + } + + public Integer low() { + return this.low; + } + + public Integer high() { + return this.high; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder split(String split); + + String split(); + + Builder low(Integer low); + + Integer low(); + + Builder high(Integer high); + + Integer high(); + + GetSegments build(); + } + + static class BuilderImpl implements Builder { + protected String split; + + protected Integer low; + + protected Integer high; + + protected BuilderImpl() { + } + + protected BuilderImpl(GetSegments model) { + this.split = model.split(); + this.low = model.low(); + this.high = model.high(); + } + + public Builder split(String split) { + this.split = split; + return this; + } + + public String split() { + return this.split; + } + + public Builder low(Integer low) { + this.low = low; + return this; + } + + public Integer low() { + return this.low; + } + + public Builder high(Integer high) { + this.high = high; + return this; + } + + public Integer high() { + return this.high; + } + + public GetSegments build() { + if (Objects.isNull(this.split())) { + throw new IllegalArgumentException("Missing value for required field `split`"); + } + if (Objects.nonNull(this.split()) && this.split().length() < 1) { + throw new IllegalArgumentException("The size of `split` must be greater than or equal to 1"); + } + if (Objects.nonNull(this.split()) && this.split().length() > 1) { + throw new IllegalArgumentException("The size of `split` must be less than or equal to 1"); + } + if (Objects.isNull(this.low())) { + throw new IllegalArgumentException("Missing value for required field `low`"); + } + if (Objects.isNull(this.high())) { + throw new IllegalArgumentException("Missing value for required field `high`"); + } + return new GetSegments(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSubstring.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSubstring.java new file mode 100644 index 000000000..7328a6213 --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSubstring.java @@ -0,0 +1,87 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.Objects; + +public class GetSubstring { + private final Integer low; + + private final Integer high; + + protected GetSubstring(BuilderImpl builder) { + this.low = builder.low(); + this.high = builder.high(); + } + + public Integer low() { + return this.low; + } + + public Integer high() { + return this.high; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder low(Integer low); + + Integer low(); + + Builder high(Integer high); + + Integer high(); + + GetSubstring build(); + } + + static class BuilderImpl implements Builder { + protected Integer low; + + protected Integer high; + + protected BuilderImpl() { + } + + protected BuilderImpl(GetSubstring model) { + this.low = model.low(); + this.high = model.high(); + } + + public Builder low(Integer low) { + this.low = low; + return this; + } + + public Integer low() { + return this.low; + } + + public Builder high(Integer high) { + this.high = high; + return this; + } + + public Integer high() { + return this.high; + } + + public GetSubstring build() { + if (Objects.isNull(this.low())) { + throw new IllegalArgumentException("Missing value for required field `low`"); + } + if (Objects.isNull(this.high())) { + throw new IllegalArgumentException("Missing value for required field `high`"); + } + return new GetSubstring(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSuffix.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSuffix.java new file mode 100644 index 000000000..f11ed6704 --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/GetSuffix.java @@ -0,0 +1,61 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.Objects; + +public class GetSuffix { + private final Integer length; + + protected GetSuffix(BuilderImpl builder) { + this.length = builder.length(); + } + + public Integer length() { + return this.length; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder length(Integer length); + + Integer length(); + + GetSuffix build(); + } + + static class BuilderImpl implements Builder { + protected Integer length; + + protected BuilderImpl() { + } + + protected BuilderImpl(GetSuffix model) { + this.length = model.length(); + } + + public Builder length(Integer length) { + this.length = length; + return this; + } + + public Integer length() { + return this.length; + } + + public GetSuffix build() { + if (Objects.isNull(this.length())) { + throw new IllegalArgumentException("Missing value for required field `length`"); + } + return new GetSuffix(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Insert.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Insert.java new file mode 100644 index 000000000..2f0c68ce3 --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Insert.java @@ -0,0 +1,61 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.Objects; + +public class Insert { + private final String literal; + + protected Insert(BuilderImpl builder) { + this.literal = builder.literal(); + } + + public String literal() { + return this.literal; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder literal(String literal); + + String literal(); + + Insert build(); + } + + static class BuilderImpl implements Builder { + protected String literal; + + protected BuilderImpl() { + } + + protected BuilderImpl(Insert model) { + this.literal = model.literal(); + } + + public Builder literal(String literal) { + this.literal = literal; + return this; + } + + public String literal() { + return this.literal; + } + + public Insert build() { + if (Objects.isNull(this.literal())) { + throw new IllegalArgumentException("Missing value for required field `literal`"); + } + return new Insert(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Lower.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Lower.java new file mode 100644 index 000000000..e06e90acf --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Lower.java @@ -0,0 +1,33 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +public class Lower { + protected Lower(BuilderImpl builder) { + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Lower build(); + } + + static class BuilderImpl implements Builder { + protected BuilderImpl() { + } + + protected BuilderImpl(Lower model) { + } + + public Lower build() { + return new Lower(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Upper.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Upper.java new file mode 100644 index 000000000..6b6e99956 --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/Upper.java @@ -0,0 +1,33 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +public class Upper { + protected Upper(BuilderImpl builder) { + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Upper build(); + } + + static class BuilderImpl implements Builder { + protected BuilderImpl() { + } + + protected BuilderImpl(Upper model) { + } + + public Upper build() { + return new Upper(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualField.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualField.java new file mode 100644 index 000000000..a30706abb --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualField.java @@ -0,0 +1,91 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.List; +import java.util.Objects; + +public class VirtualField { + private final String name; + + private final List parts; + + protected VirtualField(BuilderImpl builder) { + this.name = builder.name(); + this.parts = builder.parts(); + } + + public String name() { + return this.name; + } + + public List parts() { + return this.parts; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder name(String name); + + String name(); + + Builder parts(List parts); + + List parts(); + + VirtualField build(); + } + + static class BuilderImpl implements Builder { + protected String name; + + protected List parts; + + protected BuilderImpl() { + } + + protected BuilderImpl(VirtualField model) { + this.name = model.name(); + this.parts = model.parts(); + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public String name() { + return this.name; + } + + public Builder parts(List parts) { + this.parts = parts; + return this; + } + + public List parts() { + return this.parts; + } + + public VirtualField build() { + if (Objects.isNull(this.name())) { + throw new IllegalArgumentException("Missing value for required field `name`"); + } + if (Objects.isNull(this.parts())) { + throw new IllegalArgumentException("Missing value for required field `parts`"); + } + if (Objects.nonNull(this.parts()) && this.parts().size() < 1) { + throw new IllegalArgumentException("The size of `parts` must be greater than or equal to 1"); + } + return new VirtualField(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualPart.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualPart.java new file mode 100644 index 000000000..fcbd96f23 --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualPart.java @@ -0,0 +1,91 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.List; +import java.util.Objects; + +public class VirtualPart { + private final String loc; + + private final List trans; + + protected VirtualPart(BuilderImpl builder) { + this.loc = builder.loc(); + this.trans = builder.trans(); + } + + public String loc() { + return this.loc; + } + + public List trans() { + return this.trans; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder loc(String loc); + + String loc(); + + Builder trans(List trans); + + List trans(); + + VirtualPart build(); + } + + static class BuilderImpl implements Builder { + protected String loc; + + protected List trans; + + protected BuilderImpl() { + } + + protected BuilderImpl(VirtualPart model) { + this.loc = model.loc(); + this.trans = model.trans(); + } + + public Builder loc(String loc) { + this.loc = loc; + return this; + } + + public String loc() { + return this.loc; + } + + public Builder trans(List trans) { + this.trans = trans; + return this; + } + + public List trans() { + return this.trans; + } + + public VirtualPart build() { + if (Objects.isNull(this.loc())) { + throw new IllegalArgumentException("Missing value for required field `loc`"); + } + if (Objects.nonNull(this.loc()) && this.loc().length() < 1) { + throw new IllegalArgumentException("The size of `loc` must be greater than or equal to 1"); + } + if (Objects.nonNull(this.trans()) && this.trans().size() < 1) { + throw new IllegalArgumentException("The size of `trans` must be greater than or equal to 1"); + } + return new VirtualPart(this); + } + } +} diff --git a/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualTransform.java b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualTransform.java new file mode 100644 index 000000000..c0d93d56d --- /dev/null +++ b/DynamoDbEncryptionMiddlewareInternal/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dynamoDbEncryption/model/VirtualTransform.java @@ -0,0 +1,236 @@ +// 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. +package software.amazon.cryptography.dynamoDbEncryption.model; + +import java.util.Objects; + +public class VirtualTransform { + private final Upper upper; + + private final Lower lower; + + private final Insert insert; + + private final GetPrefix prefix; + + private final GetSuffix suffix; + + private final GetSubstring substring; + + private final GetSegment segment; + + private final GetSegments segments; + + protected VirtualTransform(BuilderImpl builder) { + this.upper = builder.upper(); + this.lower = builder.lower(); + this.insert = builder.insert(); + this.prefix = builder.prefix(); + this.suffix = builder.suffix(); + this.substring = builder.substring(); + this.segment = builder.segment(); + this.segments = builder.segments(); + } + + public Upper upper() { + return this.upper; + } + + public Lower lower() { + return this.lower; + } + + public Insert insert() { + return this.insert; + } + + public GetPrefix prefix() { + return this.prefix; + } + + public GetSuffix suffix() { + return this.suffix; + } + + public GetSubstring substring() { + return this.substring; + } + + public GetSegment segment() { + return this.segment; + } + + public GetSegments segments() { + return this.segments; + } + + public Builder toBuilder() { + return new BuilderImpl(this); + } + + public static Builder builder() { + return new BuilderImpl(); + } + + public interface Builder { + Builder upper(Upper upper); + + Upper upper(); + + Builder lower(Lower lower); + + Lower lower(); + + Builder insert(Insert insert); + + Insert insert(); + + Builder prefix(GetPrefix prefix); + + GetPrefix prefix(); + + Builder suffix(GetSuffix suffix); + + GetSuffix suffix(); + + Builder substring(GetSubstring substring); + + GetSubstring substring(); + + Builder segment(GetSegment segment); + + GetSegment segment(); + + Builder segments(GetSegments segments); + + GetSegments segments(); + + VirtualTransform build(); + } + + static class BuilderImpl implements Builder { + protected Upper upper; + + protected Lower lower; + + protected Insert insert; + + protected GetPrefix prefix; + + protected GetSuffix suffix; + + protected GetSubstring substring; + + protected GetSegment segment; + + protected GetSegments segments; + + protected BuilderImpl() { + } + + protected BuilderImpl(VirtualTransform model) { + this.upper = model.upper(); + this.lower = model.lower(); + this.insert = model.insert(); + this.prefix = model.prefix(); + this.suffix = model.suffix(); + this.substring = model.substring(); + this.segment = model.segment(); + this.segments = model.segments(); + } + + public Builder upper(Upper upper) { + this.upper = upper; + return this; + } + + public Upper upper() { + return this.upper; + } + + public Builder lower(Lower lower) { + this.lower = lower; + return this; + } + + public Lower lower() { + return this.lower; + } + + public Builder insert(Insert insert) { + this.insert = insert; + return this; + } + + public Insert insert() { + return this.insert; + } + + public Builder prefix(GetPrefix prefix) { + this.prefix = prefix; + return this; + } + + public GetPrefix prefix() { + return this.prefix; + } + + public Builder suffix(GetSuffix suffix) { + this.suffix = suffix; + return this; + } + + public GetSuffix suffix() { + return this.suffix; + } + + public Builder substring(GetSubstring substring) { + this.substring = substring; + return this; + } + + public GetSubstring substring() { + return this.substring; + } + + public Builder segment(GetSegment segment) { + this.segment = segment; + return this; + } + + public GetSegment segment() { + return this.segment; + } + + public Builder segments(GetSegments segments) { + this.segments = segments; + return this; + } + + public GetSegments segments() { + return this.segments; + } + + public VirtualTransform build() { + if (!onlyOneNonNull()) { + throw new IllegalArgumentException("`VirtualTransform` is a Union. A Union MUST have one and only one value set."); + } + return new VirtualTransform(this); + } + + private boolean onlyOneNonNull() { + Object[] allValues = {this.upper, this.lower, this.insert, this.prefix, this.suffix, this.substring, this.segment, this.segments}; + boolean haveOneNonNull = false; + for (Object o : allValues) { + if (Objects.nonNull(o)) { + if (haveOneNonNull) { + return false; + } + haveOneNonNull = true; + } + } + return haveOneNonNull; + } + } +}