Skip to content

Commit

Permalink
feat: ddbv2 re-polymorph
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Chaturvedi committed Oct 28, 2024
1 parent a36f799 commit 1357f42
Show file tree
Hide file tree
Showing 21 changed files with 4,161 additions and 13,681 deletions.
4 changes: 2 additions & 2 deletions AwsCryptographicMaterialProviders/project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file stores the top level dafny version information.
# All elements of the project need to agree on this version.
dafnyVersion=4.8.0
dafnyRuntimeJavaVersion=4.8.0
dafnyVersion=4.8.1
dafnyRuntimeJavaVersion=4.8.1
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ public CreateKeyStoreOutput build() {
"Missing value for required field `tableArn`"
);
}
if (Objects.nonNull(this.tableArn()) && this.tableArn().length() < 1) {
throw new IllegalArgumentException(
"The size of `tableArn` must be greater than or equal to 1"
);
}
if (Objects.nonNull(this.tableArn()) && this.tableArn().length() > 1024) {
throw new IllegalArgumentException(
"The size of `tableArn` must be less than or equal to 1024"
);
}
return new CreateKeyStoreOutput(this);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
file_format_version = "1.0"
dafny_version = "4.8.0.0"
dafny_version = "4.8.1.0"
[options_by_module.AwsCryptographyKeyStoreTypes]
legacy-module-names = false
python-module-name = "aws_cryptographic_material_providers.internaldafny.generated"
Expand Down
4 changes: 2 additions & 2 deletions AwsCryptographyPrimitives/project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file stores the top level dafny version information.
# All elements of the project need to agree on this version.
dafnyVersion=4.8.0
dafnyRuntimeJavaVersion=4.8.0
dafnyVersion=4.8.1
dafnyRuntimeJavaVersion=4.8.1
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ private static IAsymmetricBlockCipher GetEngineForPadding(_IRSAPaddingMode paddi
// key and returns the AsymmetricKeyParameter for that public key, encoded using UTF-8
private static AsymmetricKeyParameter GetPublicKeyFromByteSeq(ibyteseq key)
{
AsymmetricKeyParameter keyParam;
using (var stringReader = new StringReader(Encoding.UTF8.GetString(key.CloneAsArray())))
{
return (AsymmetricKeyParameter)new PemReader(stringReader).ReadObject();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
file_format_version = "1.0"
dafny_version = "4.8.0.0"
dafny_version = "4.8.1.0"
[options_by_module.AwsCryptographyPrimitivesTypes]
legacy-module-names = false
python-module-name = "aws_cryptography_primitives.internaldafny.generated"
Expand Down
4 changes: 2 additions & 2 deletions ComAmazonawsDynamodb/project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file stores the top level dafny version information.
# All elements of the project need to agree on this version.
dafnyVersion=4.8.0
dafnyRuntimeJavaVersion=4.8.0
dafnyVersion=4.8.1
dafnyRuntimeJavaVersion=4.8.1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import software.amazon.awssdk.services.dynamodb.model.DeleteBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeBackupRequest;
Expand Down Expand Up @@ -70,6 +72,8 @@
import software.amazon.awssdk.services.dynamodb.model.ExportTableToPointInTimeResponse;
import software.amazon.awssdk.services.dynamodb.model.GetItemRequest;
import software.amazon.awssdk.services.dynamodb.model.GetItemResponse;
import software.amazon.awssdk.services.dynamodb.model.GetResourcePolicyRequest;
import software.amazon.awssdk.services.dynamodb.model.GetResourcePolicyResponse;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.IdempotentParameterMismatchException;
Expand Down Expand Up @@ -98,9 +102,12 @@
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceResponse;
import software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryUnavailableException;
import software.amazon.awssdk.services.dynamodb.model.PolicyNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputExceededException;
import software.amazon.awssdk.services.dynamodb.model.PutItemRequest;
import software.amazon.awssdk.services.dynamodb.model.PutItemResponse;
import software.amazon.awssdk.services.dynamodb.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.dynamodb.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.dynamodb.model.QueryRequest;
import software.amazon.awssdk.services.dynamodb.model.QueryResponse;
import software.amazon.awssdk.services.dynamodb.model.ReplicaAlreadyExistsException;
Expand Down Expand Up @@ -136,6 +143,8 @@
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableSettingsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableRequest;
Expand All @@ -158,6 +167,8 @@
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteResourcePolicyInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteResourcePolicyOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupInput;
Expand Down Expand Up @@ -199,6 +210,8 @@
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetResourcePolicyInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetResourcePolicyOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.IDynamoDBClient;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableOutput;
Expand All @@ -218,6 +231,8 @@
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutResourcePolicyInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutResourcePolicyOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupInput;
Expand All @@ -242,6 +257,8 @@
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingInput;
Expand Down Expand Up @@ -704,6 +721,69 @@ public Result<DeleteItemOutput, Error> DeleteItem(DeleteItemInput input) {
}
}

@Override
public Result<DeleteResourcePolicyOutput, Error> DeleteResourcePolicy(
DeleteResourcePolicyInput input
) {
DeleteResourcePolicyRequest converted = ToNative.DeleteResourcePolicyInput(
input
);
try {
DeleteResourcePolicyResponse result = _impl.deleteResourcePolicy(
converted
);
DeleteResourcePolicyOutput dafnyResponse =
ToDafny.DeleteResourcePolicyOutput(result);
return Result.create_Success(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
dafnyResponse
);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (LimitExceededException ex) {
return Result.create_Failure(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (PolicyNotFoundException ex) {
return Result.create_Failure(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (ResourceInUseException ex) {
return Result.create_Failure(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (DynamoDbException ex) {
return Result.create_Failure(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (Exception ex) {
return Result.create_Failure(
DeleteResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
}
}

@Override
public Result<DeleteTableOutput, Error> DeleteTable(DeleteTableInput input) {
DeleteTableRequest converted = ToNative.DeleteTableInput(input);
Expand Down Expand Up @@ -1676,6 +1756,54 @@ public Result<GetItemOutput, Error> GetItem(GetItemInput input) {
}
}

@Override
public Result<GetResourcePolicyOutput, Error> GetResourcePolicy(
GetResourcePolicyInput input
) {
GetResourcePolicyRequest converted = ToNative.GetResourcePolicyInput(input);
try {
GetResourcePolicyResponse result = _impl.getResourcePolicy(converted);
GetResourcePolicyOutput dafnyResponse = ToDafny.GetResourcePolicyOutput(
result
);
return Result.create_Success(
GetResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
dafnyResponse
);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(
GetResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (PolicyNotFoundException ex) {
return Result.create_Failure(
GetResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(
GetResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (DynamoDbException ex) {
return Result.create_Failure(
GetResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (Exception ex) {
return Result.create_Failure(
GetResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
}
}

@Override
public Result<ImportTableOutput, Error> ImportTable(ImportTableInput input) {
ImportTableRequest converted = ToNative.ImportTableInput(input);
Expand Down Expand Up @@ -2046,6 +2174,66 @@ public Result<PutItemOutput, Error> PutItem(PutItemInput input) {
}
}

@Override
public Result<PutResourcePolicyOutput, Error> PutResourcePolicy(
PutResourcePolicyInput input
) {
PutResourcePolicyRequest converted = ToNative.PutResourcePolicyInput(input);
try {
PutResourcePolicyResponse result = _impl.putResourcePolicy(converted);
PutResourcePolicyOutput dafnyResponse = ToDafny.PutResourcePolicyOutput(
result
);
return Result.create_Success(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
dafnyResponse
);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (LimitExceededException ex) {
return Result.create_Failure(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (PolicyNotFoundException ex) {
return Result.create_Failure(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (ResourceInUseException ex) {
return Result.create_Failure(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (DynamoDbException ex) {
return Result.create_Failure(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (Exception ex) {
return Result.create_Failure(
PutResourcePolicyOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
}
}

@Override
public Result<QueryOutput, Error> Query(QueryInput input) {
QueryRequest converted = ToNative.QueryInput(input);
Expand Down Expand Up @@ -2810,6 +2998,64 @@ public Result<UpdateItemOutput, Error> UpdateItem(UpdateItemInput input) {
}
}

@Override
public Result<
UpdateKinesisStreamingDestinationOutput,
Error
> UpdateKinesisStreamingDestination(
UpdateKinesisStreamingDestinationInput input
) {
UpdateKinesisStreamingDestinationRequest converted =
ToNative.UpdateKinesisStreamingDestinationInput(input);
try {
UpdateKinesisStreamingDestinationResponse result =
_impl.updateKinesisStreamingDestination(converted);
UpdateKinesisStreamingDestinationOutput dafnyResponse =
ToDafny.UpdateKinesisStreamingDestinationOutput(result);
return Result.create_Success(
UpdateKinesisStreamingDestinationOutput._typeDescriptor(),
Error._typeDescriptor(),
dafnyResponse
);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(
UpdateKinesisStreamingDestinationOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (LimitExceededException ex) {
return Result.create_Failure(
UpdateKinesisStreamingDestinationOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (ResourceInUseException ex) {
return Result.create_Failure(
UpdateKinesisStreamingDestinationOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(
UpdateKinesisStreamingDestinationOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (DynamoDbException ex) {
return Result.create_Failure(
UpdateKinesisStreamingDestinationOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
} catch (Exception ex) {
return Result.create_Failure(
UpdateKinesisStreamingDestinationOutput._typeDescriptor(),
Error._typeDescriptor(),
ToDafny.Error(ex)
);
}
}

@Override
public Result<UpdateTableOutput, Error> UpdateTable(UpdateTableInput input) {
UpdateTableRequest converted = ToNative.UpdateTableInput(input);
Expand Down
Loading

0 comments on commit 1357f42

Please sign in to comment.