From 89ce6e519da61eb71d206fd37fdb4e99953e14df Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Mon, 5 Feb 2024 15:26:44 -0800 Subject: [PATCH] sync --- .../com_amazonaws_dynamodb/__init__.py | 1 + .../aws_sdk_to_dafny.py | 7297 +++++++++++++++++ .../dafny_to_aws_sdk.py | 5770 +++++++++++++ .../com_amazonaws_dynamodb/shim.py | 1179 +++ 4 files changed, 14247 insertions(+) create mode 100644 ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/__init__.py create mode 100644 ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/aws_sdk_to_dafny.py create mode 100644 ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/dafny_to_aws_sdk.py create mode 100644 ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/shim.py diff --git a/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/__init__.py b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/__init__.py new file mode 100644 index 000000000..247be3e3d --- /dev/null +++ b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/__init__.py @@ -0,0 +1 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. diff --git a/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/aws_sdk_to_dafny.py b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/aws_sdk_to_dafny.py new file mode 100644 index 000000000..a07c46be6 --- /dev/null +++ b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/aws_sdk_to_dafny.py @@ -0,0 +1,7297 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from Wrappers import Option_None, Option_Some +from _dafny import Map, Seq +import com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny +import module_ +from software_amazon_cryptography_services_dynamodb_internaldafny_types import ( + ArchivalSummary_ArchivalSummary as DafnyArchivalSummary, + AttributeAction_ADD, + AttributeAction_DELETE, + AttributeAction_PUT, + AttributeDefinition_AttributeDefinition as DafnyAttributeDefinition, + AttributeValueUpdate_AttributeValueUpdate as DafnyAttributeValueUpdate, + AttributeValue_B, + AttributeValue_BOOL, + AttributeValue_BS, + AttributeValue_L, + AttributeValue_M, + AttributeValue_N, + AttributeValue_NS, + AttributeValue_NULL, + AttributeValue_S, + AttributeValue_SS, + AutoScalingPolicyDescription_AutoScalingPolicyDescription as DafnyAutoScalingPolicyDescription, + AutoScalingPolicyUpdate_AutoScalingPolicyUpdate as DafnyAutoScalingPolicyUpdate, + AutoScalingSettingsDescription_AutoScalingSettingsDescription as DafnyAutoScalingSettingsDescription, + AutoScalingSettingsUpdate_AutoScalingSettingsUpdate as DafnyAutoScalingSettingsUpdate, + AutoScalingTargetTrackingScalingPolicyConfigurationDescription_AutoScalingTargetTrackingScalingPolicyConfigurationDescription as DafnyAutoScalingTargetTrackingScalingPolicyConfigurationDescription, + AutoScalingTargetTrackingScalingPolicyConfigurationUpdate_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate as DafnyAutoScalingTargetTrackingScalingPolicyConfigurationUpdate, + BackupDescription_BackupDescription as DafnyBackupDescription, + BackupDetails_BackupDetails as DafnyBackupDetails, + BackupStatus_AVAILABLE, + BackupStatus_CREATING, + BackupStatus_DELETED, + BackupSummary_BackupSummary as DafnyBackupSummary, + BackupTypeFilter_ALL, + BackupTypeFilter_AWS__BACKUP, + BackupTypeFilter_SYSTEM, + BackupTypeFilter_USER, + BackupType_AWS__BACKUP, + BackupType_SYSTEM, + BackupType_USER, + BatchExecuteStatementInput_BatchExecuteStatementInput as DafnyBatchExecuteStatementInput, + BatchExecuteStatementOutput_BatchExecuteStatementOutput as DafnyBatchExecuteStatementOutput, + BatchGetItemInput_BatchGetItemInput as DafnyBatchGetItemInput, + BatchGetItemOutput_BatchGetItemOutput as DafnyBatchGetItemOutput, + BatchStatementErrorCodeEnum_AccessDenied, + BatchStatementErrorCodeEnum_ConditionalCheckFailed, + BatchStatementErrorCodeEnum_DuplicateItem, + BatchStatementErrorCodeEnum_InternalServerError, + BatchStatementErrorCodeEnum_ItemCollectionSizeLimitExceeded, + BatchStatementErrorCodeEnum_ProvisionedThroughputExceeded, + BatchStatementErrorCodeEnum_RequestLimitExceeded, + BatchStatementErrorCodeEnum_ResourceNotFound, + BatchStatementErrorCodeEnum_ThrottlingError, + BatchStatementErrorCodeEnum_TransactionConflict, + BatchStatementErrorCodeEnum_ValidationError, + BatchStatementError_BatchStatementError as DafnyBatchStatementError, + BatchStatementRequest_BatchStatementRequest as DafnyBatchStatementRequest, + BatchStatementResponse_BatchStatementResponse as DafnyBatchStatementResponse, + BatchWriteItemInput_BatchWriteItemInput as DafnyBatchWriteItemInput, + BatchWriteItemOutput_BatchWriteItemOutput as DafnyBatchWriteItemOutput, + BillingModeSummary_BillingModeSummary as DafnyBillingModeSummary, + BillingMode_PAY__PER__REQUEST, + BillingMode_PROVISIONED, + CancellationReason_CancellationReason as DafnyCancellationReason, + Capacity_Capacity as DafnyCapacity, + ComparisonOperator_BEGINS__WITH, + ComparisonOperator_BETWEEN, + ComparisonOperator_CONTAINS, + ComparisonOperator_EQ, + ComparisonOperator_GE, + ComparisonOperator_GT, + ComparisonOperator_IN, + ComparisonOperator_LE, + ComparisonOperator_LT, + ComparisonOperator_NE, + ComparisonOperator_NOT__CONTAINS, + ComparisonOperator_NOT__NULL, + ComparisonOperator_NULL, + ConditionCheck_ConditionCheck as DafnyConditionCheck, + Condition_Condition as DafnyCondition, + ConditionalOperator_AND, + ConditionalOperator_OR, + ConsumedCapacity_ConsumedCapacity as DafnyConsumedCapacity, + ContinuousBackupsDescription_ContinuousBackupsDescription as DafnyContinuousBackupsDescription, + ContinuousBackupsStatus_DISABLED, + ContinuousBackupsStatus_ENABLED, + ContributorInsightsAction_DISABLE, + ContributorInsightsAction_ENABLE, + ContributorInsightsStatus_DISABLED, + ContributorInsightsStatus_DISABLING, + ContributorInsightsStatus_ENABLED, + ContributorInsightsStatus_ENABLING, + ContributorInsightsStatus_FAILED, + ContributorInsightsSummary_ContributorInsightsSummary as DafnyContributorInsightsSummary, + CreateBackupInput_CreateBackupInput as DafnyCreateBackupInput, + CreateBackupOutput_CreateBackupOutput as DafnyCreateBackupOutput, + CreateGlobalSecondaryIndexAction_CreateGlobalSecondaryIndexAction as DafnyCreateGlobalSecondaryIndexAction, + CreateGlobalTableInput_CreateGlobalTableInput as DafnyCreateGlobalTableInput, + CreateGlobalTableOutput_CreateGlobalTableOutput as DafnyCreateGlobalTableOutput, + CreateReplicaAction_CreateReplicaAction as DafnyCreateReplicaAction, + CreateReplicationGroupMemberAction_CreateReplicationGroupMemberAction as DafnyCreateReplicationGroupMemberAction, + CreateTableInput_CreateTableInput as DafnyCreateTableInput, + CreateTableOutput_CreateTableOutput as DafnyCreateTableOutput, + CsvOptions_CsvOptions as DafnyCsvOptions, + DeleteBackupInput_DeleteBackupInput as DafnyDeleteBackupInput, + DeleteBackupOutput_DeleteBackupOutput as DafnyDeleteBackupOutput, + DeleteGlobalSecondaryIndexAction_DeleteGlobalSecondaryIndexAction as DafnyDeleteGlobalSecondaryIndexAction, + DeleteItemInput_DeleteItemInput as DafnyDeleteItemInput, + DeleteItemOutput_DeleteItemOutput as DafnyDeleteItemOutput, + DeleteReplicaAction_DeleteReplicaAction as DafnyDeleteReplicaAction, + DeleteReplicationGroupMemberAction_DeleteReplicationGroupMemberAction as DafnyDeleteReplicationGroupMemberAction, + DeleteRequest_DeleteRequest as DafnyDeleteRequest, + DeleteTableInput_DeleteTableInput as DafnyDeleteTableInput, + DeleteTableOutput_DeleteTableOutput as DafnyDeleteTableOutput, + Delete_Delete as DafnyDelete, + DescribeBackupInput_DescribeBackupInput as DafnyDescribeBackupInput, + DescribeBackupOutput_DescribeBackupOutput as DafnyDescribeBackupOutput, + DescribeContinuousBackupsInput_DescribeContinuousBackupsInput as DafnyDescribeContinuousBackupsInput, + DescribeContinuousBackupsOutput_DescribeContinuousBackupsOutput as DafnyDescribeContinuousBackupsOutput, + DescribeContributorInsightsInput_DescribeContributorInsightsInput as DafnyDescribeContributorInsightsInput, + DescribeContributorInsightsOutput_DescribeContributorInsightsOutput as DafnyDescribeContributorInsightsOutput, + DescribeEndpointsRequest_DescribeEndpointsRequest as DafnyDescribeEndpointsRequest, + DescribeEndpointsResponse_DescribeEndpointsResponse as DafnyDescribeEndpointsResponse, + DescribeExportInput_DescribeExportInput as DafnyDescribeExportInput, + DescribeExportOutput_DescribeExportOutput as DafnyDescribeExportOutput, + DescribeGlobalTableInput_DescribeGlobalTableInput as DafnyDescribeGlobalTableInput, + DescribeGlobalTableOutput_DescribeGlobalTableOutput as DafnyDescribeGlobalTableOutput, + DescribeGlobalTableSettingsInput_DescribeGlobalTableSettingsInput as DafnyDescribeGlobalTableSettingsInput, + DescribeGlobalTableSettingsOutput_DescribeGlobalTableSettingsOutput as DafnyDescribeGlobalTableSettingsOutput, + DescribeImportInput_DescribeImportInput as DafnyDescribeImportInput, + DescribeImportOutput_DescribeImportOutput as DafnyDescribeImportOutput, + DescribeKinesisStreamingDestinationInput_DescribeKinesisStreamingDestinationInput as DafnyDescribeKinesisStreamingDestinationInput, + DescribeKinesisStreamingDestinationOutput_DescribeKinesisStreamingDestinationOutput as DafnyDescribeKinesisStreamingDestinationOutput, + DescribeLimitsInput_DescribeLimitsInput as DafnyDescribeLimitsInput, + DescribeLimitsOutput_DescribeLimitsOutput as DafnyDescribeLimitsOutput, + DescribeTableInput_DescribeTableInput as DafnyDescribeTableInput, + DescribeTableOutput_DescribeTableOutput as DafnyDescribeTableOutput, + DescribeTableReplicaAutoScalingInput_DescribeTableReplicaAutoScalingInput as DafnyDescribeTableReplicaAutoScalingInput, + DescribeTableReplicaAutoScalingOutput_DescribeTableReplicaAutoScalingOutput as DafnyDescribeTableReplicaAutoScalingOutput, + DescribeTimeToLiveInput_DescribeTimeToLiveInput as DafnyDescribeTimeToLiveInput, + DescribeTimeToLiveOutput_DescribeTimeToLiveOutput as DafnyDescribeTimeToLiveOutput, + DestinationStatus_ACTIVE, + DestinationStatus_DISABLED, + DestinationStatus_DISABLING, + DestinationStatus_ENABLE__FAILED, + DestinationStatus_ENABLING, + DisableKinesisStreamingDestinationInput_DisableKinesisStreamingDestinationInput as DafnyDisableKinesisStreamingDestinationInput, + DisableKinesisStreamingDestinationOutput_DisableKinesisStreamingDestinationOutput as DafnyDisableKinesisStreamingDestinationOutput, + EnableKinesisStreamingDestinationInput_EnableKinesisStreamingDestinationInput as DafnyEnableKinesisStreamingDestinationInput, + EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingDestinationOutput as DafnyEnableKinesisStreamingDestinationOutput, + Endpoint_Endpoint as DafnyEndpoint, + Error_BackupInUseException, + Error_BackupNotFoundException, + Error_ConditionalCheckFailedException, + Error_ContinuousBackupsUnavailableException, + Error_DuplicateItemException, + Error_ExportConflictException, + Error_ExportNotFoundException, + Error_GlobalTableAlreadyExistsException, + Error_GlobalTableNotFoundException, + Error_IdempotentParameterMismatchException, + Error_ImportConflictException, + Error_ImportNotFoundException, + Error_IndexNotFoundException, + Error_InternalServerError, + Error_InvalidEndpointException, + Error_InvalidExportTimeException, + Error_InvalidRestoreTimeException, + Error_ItemCollectionSizeLimitExceededException, + Error_LimitExceededException, + Error_PointInTimeRecoveryUnavailableException, + Error_ProvisionedThroughputExceededException, + Error_ReplicaAlreadyExistsException, + Error_ReplicaNotFoundException, + Error_RequestLimitExceeded, + Error_ResourceInUseException, + Error_ResourceNotFoundException, + Error_TableAlreadyExistsException, + Error_TableInUseException, + Error_TableNotFoundException, + Error_TransactionCanceledException, + Error_TransactionConflictException, + Error_TransactionInProgressException, + ExecuteStatementInput_ExecuteStatementInput as DafnyExecuteStatementInput, + ExecuteStatementOutput_ExecuteStatementOutput as DafnyExecuteStatementOutput, + ExecuteTransactionInput_ExecuteTransactionInput as DafnyExecuteTransactionInput, + ExecuteTransactionOutput_ExecuteTransactionOutput as DafnyExecuteTransactionOutput, + ExpectedAttributeValue_ExpectedAttributeValue as DafnyExpectedAttributeValue, + ExportDescription_ExportDescription as DafnyExportDescription, + ExportFormat_DYNAMODB__JSON, + ExportFormat_ION, + ExportStatus_COMPLETED, + ExportStatus_FAILED, + ExportStatus_IN__PROGRESS, + ExportSummary_ExportSummary as DafnyExportSummary, + ExportTableToPointInTimeInput_ExportTableToPointInTimeInput as DafnyExportTableToPointInTimeInput, + ExportTableToPointInTimeOutput_ExportTableToPointInTimeOutput as DafnyExportTableToPointInTimeOutput, + FailureException_FailureException as DafnyFailureException, + GetItemInput_GetItemInput as DafnyGetItemInput, + GetItemOutput_GetItemOutput as DafnyGetItemOutput, + Get_Get as DafnyGet, + GlobalSecondaryIndexAutoScalingUpdate_GlobalSecondaryIndexAutoScalingUpdate as DafnyGlobalSecondaryIndexAutoScalingUpdate, + GlobalSecondaryIndexDescription_GlobalSecondaryIndexDescription as DafnyGlobalSecondaryIndexDescription, + GlobalSecondaryIndexInfo_GlobalSecondaryIndexInfo as DafnyGlobalSecondaryIndexInfo, + GlobalSecondaryIndexUpdate_GlobalSecondaryIndexUpdate as DafnyGlobalSecondaryIndexUpdate, + GlobalSecondaryIndex_GlobalSecondaryIndex as DafnyGlobalSecondaryIndex, + GlobalTableDescription_GlobalTableDescription as DafnyGlobalTableDescription, + GlobalTableGlobalSecondaryIndexSettingsUpdate_GlobalTableGlobalSecondaryIndexSettingsUpdate as DafnyGlobalTableGlobalSecondaryIndexSettingsUpdate, + GlobalTableStatus_ACTIVE, + GlobalTableStatus_CREATING, + GlobalTableStatus_DELETING, + GlobalTableStatus_UPDATING, + GlobalTable_GlobalTable as DafnyGlobalTable, + ImportStatus_CANCELLED, + ImportStatus_CANCELLING, + ImportStatus_COMPLETED, + ImportStatus_FAILED, + ImportStatus_IN__PROGRESS, + ImportSummary_ImportSummary as DafnyImportSummary, + ImportTableDescription_ImportTableDescription as DafnyImportTableDescription, + ImportTableInput_ImportTableInput as DafnyImportTableInput, + ImportTableOutput_ImportTableOutput as DafnyImportTableOutput, + IndexStatus_ACTIVE, + IndexStatus_CREATING, + IndexStatus_DELETING, + IndexStatus_UPDATING, + InputCompressionType_GZIP, + InputCompressionType_NONE, + InputCompressionType_ZSTD, + InputFormatOptions_InputFormatOptions as DafnyInputFormatOptions, + InputFormat_CSV, + InputFormat_DYNAMODB__JSON, + InputFormat_ION, + ItemCollectionMetrics_ItemCollectionMetrics as DafnyItemCollectionMetrics, + ItemResponse_ItemResponse as DafnyItemResponse, + KeySchemaElement_KeySchemaElement as DafnyKeySchemaElement, + KeyType_HASH, + KeyType_RANGE, + KeysAndAttributes_KeysAndAttributes as DafnyKeysAndAttributes, + KinesisDataStreamDestination_KinesisDataStreamDestination as DafnyKinesisDataStreamDestination, + ListBackupsInput_ListBackupsInput as DafnyListBackupsInput, + ListBackupsOutput_ListBackupsOutput as DafnyListBackupsOutput, + ListContributorInsightsInput_ListContributorInsightsInput as DafnyListContributorInsightsInput, + ListContributorInsightsOutput_ListContributorInsightsOutput as DafnyListContributorInsightsOutput, + ListExportsInput_ListExportsInput as DafnyListExportsInput, + ListExportsOutput_ListExportsOutput as DafnyListExportsOutput, + ListGlobalTablesInput_ListGlobalTablesInput as DafnyListGlobalTablesInput, + ListGlobalTablesOutput_ListGlobalTablesOutput as DafnyListGlobalTablesOutput, + ListImportsInput_ListImportsInput as DafnyListImportsInput, + ListImportsOutput_ListImportsOutput as DafnyListImportsOutput, + ListTablesInput_ListTablesInput as DafnyListTablesInput, + ListTablesOutput_ListTablesOutput as DafnyListTablesOutput, + ListTagsOfResourceInput_ListTagsOfResourceInput as DafnyListTagsOfResourceInput, + ListTagsOfResourceOutput_ListTagsOfResourceOutput as DafnyListTagsOfResourceOutput, + LocalSecondaryIndexDescription_LocalSecondaryIndexDescription as DafnyLocalSecondaryIndexDescription, + LocalSecondaryIndexInfo_LocalSecondaryIndexInfo as DafnyLocalSecondaryIndexInfo, + LocalSecondaryIndex_LocalSecondaryIndex as DafnyLocalSecondaryIndex, + ParameterizedStatement_ParameterizedStatement as DafnyParameterizedStatement, + PointInTimeRecoveryDescription_PointInTimeRecoveryDescription as DafnyPointInTimeRecoveryDescription, + PointInTimeRecoverySpecification_PointInTimeRecoverySpecification as DafnyPointInTimeRecoverySpecification, + PointInTimeRecoveryStatus_DISABLED, + PointInTimeRecoveryStatus_ENABLED, + ProjectionType_ALL, + ProjectionType_INCLUDE, + ProjectionType_KEYS__ONLY, + Projection_Projection as DafnyProjection, + ProvisionedThroughputDescription_ProvisionedThroughputDescription as DafnyProvisionedThroughputDescription, + ProvisionedThroughputOverride_ProvisionedThroughputOverride as DafnyProvisionedThroughputOverride, + ProvisionedThroughput_ProvisionedThroughput as DafnyProvisionedThroughput, + PutItemInput_PutItemInput as DafnyPutItemInput, + PutItemOutput_PutItemOutput as DafnyPutItemOutput, + PutRequest_PutRequest as DafnyPutRequest, + Put_Put as DafnyPut, + QueryInput_QueryInput as DafnyQueryInput, + QueryOutput_QueryOutput as DafnyQueryOutput, + ReplicaAutoScalingDescription_ReplicaAutoScalingDescription as DafnyReplicaAutoScalingDescription, + ReplicaAutoScalingUpdate_ReplicaAutoScalingUpdate as DafnyReplicaAutoScalingUpdate, + ReplicaDescription_ReplicaDescription as DafnyReplicaDescription, + ReplicaGlobalSecondaryIndexAutoScalingDescription_ReplicaGlobalSecondaryIndexAutoScalingDescription as DafnyReplicaGlobalSecondaryIndexAutoScalingDescription, + ReplicaGlobalSecondaryIndexAutoScalingUpdate_ReplicaGlobalSecondaryIndexAutoScalingUpdate as DafnyReplicaGlobalSecondaryIndexAutoScalingUpdate, + ReplicaGlobalSecondaryIndexDescription_ReplicaGlobalSecondaryIndexDescription as DafnyReplicaGlobalSecondaryIndexDescription, + ReplicaGlobalSecondaryIndexSettingsDescription_ReplicaGlobalSecondaryIndexSettingsDescription as DafnyReplicaGlobalSecondaryIndexSettingsDescription, + ReplicaGlobalSecondaryIndexSettingsUpdate_ReplicaGlobalSecondaryIndexSettingsUpdate as DafnyReplicaGlobalSecondaryIndexSettingsUpdate, + ReplicaGlobalSecondaryIndex_ReplicaGlobalSecondaryIndex as DafnyReplicaGlobalSecondaryIndex, + ReplicaSettingsDescription_ReplicaSettingsDescription as DafnyReplicaSettingsDescription, + ReplicaSettingsUpdate_ReplicaSettingsUpdate as DafnyReplicaSettingsUpdate, + ReplicaStatus_ACTIVE, + ReplicaStatus_CREATING, + ReplicaStatus_CREATION__FAILED, + ReplicaStatus_DELETING, + ReplicaStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS, + ReplicaStatus_REGION__DISABLED, + ReplicaStatus_UPDATING, + ReplicaUpdate_ReplicaUpdate as DafnyReplicaUpdate, + Replica_Replica as DafnyReplica, + ReplicationGroupUpdate_ReplicationGroupUpdate as DafnyReplicationGroupUpdate, + RestoreSummary_RestoreSummary as DafnyRestoreSummary, + RestoreTableFromBackupInput_RestoreTableFromBackupInput as DafnyRestoreTableFromBackupInput, + RestoreTableFromBackupOutput_RestoreTableFromBackupOutput as DafnyRestoreTableFromBackupOutput, + RestoreTableToPointInTimeInput_RestoreTableToPointInTimeInput as DafnyRestoreTableToPointInTimeInput, + RestoreTableToPointInTimeOutput_RestoreTableToPointInTimeOutput as DafnyRestoreTableToPointInTimeOutput, + ReturnConsumedCapacity_INDEXES, + ReturnConsumedCapacity_NONE, + ReturnConsumedCapacity_TOTAL, + ReturnItemCollectionMetrics_NONE, + ReturnItemCollectionMetrics_SIZE, + ReturnValue_ALL__NEW, + ReturnValue_ALL__OLD, + ReturnValue_NONE, + ReturnValue_UPDATED__NEW, + ReturnValue_UPDATED__OLD, + ReturnValuesOnConditionCheckFailure_ALL__OLD, + ReturnValuesOnConditionCheckFailure_NONE, + S3BucketSource_S3BucketSource as DafnyS3BucketSource, + S3SseAlgorithm_AES256, + S3SseAlgorithm_KMS, + SSEDescription_SSEDescription as DafnySSEDescription, + SSESpecification_SSESpecification as DafnySSESpecification, + SSEStatus_DISABLED, + SSEStatus_DISABLING, + SSEStatus_ENABLED, + SSEStatus_ENABLING, + SSEStatus_UPDATING, + SSEType_AES256, + SSEType_KMS, + ScalarAttributeType_B, + ScalarAttributeType_N, + ScalarAttributeType_S, + ScanInput_ScanInput as DafnyScanInput, + ScanOutput_ScanOutput as DafnyScanOutput, + Select_ALL__ATTRIBUTES, + Select_ALL__PROJECTED__ATTRIBUTES, + Select_COUNT, + Select_SPECIFIC__ATTRIBUTES, + SourceTableDetails_SourceTableDetails as DafnySourceTableDetails, + SourceTableFeatureDetails_SourceTableFeatureDetails as DafnySourceTableFeatureDetails, + StreamSpecification_StreamSpecification as DafnyStreamSpecification, + StreamViewType_KEYS__ONLY, + StreamViewType_NEW__AND__OLD__IMAGES, + StreamViewType_NEW__IMAGE, + StreamViewType_OLD__IMAGE, + TableAutoScalingDescription_TableAutoScalingDescription as DafnyTableAutoScalingDescription, + TableClassSummary_TableClassSummary as DafnyTableClassSummary, + TableClass_STANDARD, + TableClass_STANDARD__INFREQUENT__ACCESS, + TableCreationParameters_TableCreationParameters as DafnyTableCreationParameters, + TableDescription_TableDescription as DafnyTableDescription, + TableStatus_ACTIVE, + TableStatus_ARCHIVED, + TableStatus_ARCHIVING, + TableStatus_CREATING, + TableStatus_DELETING, + TableStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS, + TableStatus_UPDATING, + TagResourceInput_TagResourceInput as DafnyTagResourceInput, + Tag_Tag as DafnyTag, + TimeToLiveDescription_TimeToLiveDescription as DafnyTimeToLiveDescription, + TimeToLiveSpecification_TimeToLiveSpecification as DafnyTimeToLiveSpecification, + TimeToLiveStatus_DISABLED, + TimeToLiveStatus_DISABLING, + TimeToLiveStatus_ENABLED, + TimeToLiveStatus_ENABLING, + TransactGetItem_TransactGetItem as DafnyTransactGetItem, + TransactGetItemsInput_TransactGetItemsInput as DafnyTransactGetItemsInput, + TransactGetItemsOutput_TransactGetItemsOutput as DafnyTransactGetItemsOutput, + TransactWriteItem_TransactWriteItem as DafnyTransactWriteItem, + TransactWriteItemsInput_TransactWriteItemsInput as DafnyTransactWriteItemsInput, + TransactWriteItemsOutput_TransactWriteItemsOutput as DafnyTransactWriteItemsOutput, + UntagResourceInput_UntagResourceInput as DafnyUntagResourceInput, + UpdateContinuousBackupsInput_UpdateContinuousBackupsInput as DafnyUpdateContinuousBackupsInput, + UpdateContinuousBackupsOutput_UpdateContinuousBackupsOutput as DafnyUpdateContinuousBackupsOutput, + UpdateContributorInsightsInput_UpdateContributorInsightsInput as DafnyUpdateContributorInsightsInput, + UpdateContributorInsightsOutput_UpdateContributorInsightsOutput as DafnyUpdateContributorInsightsOutput, + UpdateGlobalSecondaryIndexAction_UpdateGlobalSecondaryIndexAction as DafnyUpdateGlobalSecondaryIndexAction, + UpdateGlobalTableInput_UpdateGlobalTableInput as DafnyUpdateGlobalTableInput, + UpdateGlobalTableOutput_UpdateGlobalTableOutput as DafnyUpdateGlobalTableOutput, + UpdateGlobalTableSettingsInput_UpdateGlobalTableSettingsInput as DafnyUpdateGlobalTableSettingsInput, + UpdateGlobalTableSettingsOutput_UpdateGlobalTableSettingsOutput as DafnyUpdateGlobalTableSettingsOutput, + UpdateItemInput_UpdateItemInput as DafnyUpdateItemInput, + UpdateItemOutput_UpdateItemOutput as DafnyUpdateItemOutput, + UpdateReplicationGroupMemberAction_UpdateReplicationGroupMemberAction as DafnyUpdateReplicationGroupMemberAction, + UpdateTableInput_UpdateTableInput as DafnyUpdateTableInput, + UpdateTableOutput_UpdateTableOutput as DafnyUpdateTableOutput, + UpdateTableReplicaAutoScalingInput_UpdateTableReplicaAutoScalingInput as DafnyUpdateTableReplicaAutoScalingInput, + UpdateTableReplicaAutoScalingOutput_UpdateTableReplicaAutoScalingOutput as DafnyUpdateTableReplicaAutoScalingOutput, + UpdateTimeToLiveInput_UpdateTimeToLiveInput as DafnyUpdateTimeToLiveInput, + UpdateTimeToLiveOutput_UpdateTimeToLiveOutput as DafnyUpdateTimeToLiveOutput, + Update_Update as DafnyUpdate, + WriteRequest_WriteRequest as DafnyWriteRequest, +) + + +def com_amazonaws_dynamodb_BackupInUseException(input): + return Error_BackupInUseException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_BackupNotFoundException(input): + return Error_BackupNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ConditionalCheckFailedException(input): + return Error_ConditionalCheckFailedException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ContinuousBackupsUnavailableException(input): + return Error_ContinuousBackupsUnavailableException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_DuplicateItemException(input): + return Error_DuplicateItemException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ExportConflictException(input): + return Error_ExportConflictException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ExportNotFoundException(input): + return Error_ExportNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_GlobalTableAlreadyExistsException(input): + return Error_GlobalTableAlreadyExistsException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_GlobalTableNotFoundException(input): + return Error_GlobalTableNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_IdempotentParameterMismatchException(input): + return Error_IdempotentParameterMismatchException( + Message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ImportConflictException(input): + return Error_ImportConflictException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ImportNotFoundException(input): + return Error_ImportNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_IndexNotFoundException(input): + return Error_IndexNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_InternalServerError(input): + return Error_InternalServerError( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_InvalidEndpointException(input): + return Error_InvalidEndpointException( + Message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_InvalidExportTimeException(input): + return Error_InvalidExportTimeException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_InvalidRestoreTimeException(input): + return Error_InvalidRestoreTimeException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException(input): + return Error_ItemCollectionSizeLimitExceededException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_LimitExceededException(input): + return Error_LimitExceededException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException(input): + return Error_PointInTimeRecoveryUnavailableException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ProvisionedThroughputExceededException(input): + return Error_ProvisionedThroughputExceededException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ReplicaAlreadyExistsException(input): + return Error_ReplicaAlreadyExistsException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ReplicaNotFoundException(input): + return Error_ReplicaNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_RequestLimitExceeded(input): + return Error_RequestLimitExceeded( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ResourceInUseException(input): + return Error_ResourceInUseException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_ResourceNotFoundException(input): + return Error_ResourceNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_TableAlreadyExistsException(input): + return Error_TableAlreadyExistsException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_TableInUseException(input): + return Error_TableInUseException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_TableNotFoundException(input): + return Error_TableNotFoundException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_TransactionCanceledException(input): + return Error_TransactionCanceledException( + Message=Seq(input["Error"]["Message"]), + CancellationReasons=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CancellationReason( + list_element + ) + for list_element in input["CancellationReasons"] + ] + ), + ) + + +def com_amazonaws_dynamodb_CancellationReason(input): + return DafnyCancellationReason( + Item=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Item"].items() + } + ) + ) + if "Item" in input.keys() + else Option_None() + ), + Code=( + Option_Some(Seq(input["Code"])) if "Code" in input.keys() else Option_None() + ), + Message=( + Option_Some(Seq(input["Message"])) + if "Message" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AttributeValue(input): + if "S" in input.keys(): + AttributeValue_union_value = AttributeValue_S(Seq(input["S"])) + elif "N" in input.keys(): + AttributeValue_union_value = AttributeValue_N(Seq(input["N"])) + elif "B" in input.keys(): + AttributeValue_union_value = AttributeValue_B(Seq(input["B"])) + elif "SS" in input.keys(): + AttributeValue_union_value = AttributeValue_SS( + Seq([Seq(list_element) for list_element in input["SS"]]) + ) + elif "NS" in input.keys(): + AttributeValue_union_value = AttributeValue_NS( + Seq([Seq(list_element) for list_element in input["NS"]]) + ) + elif "BS" in input.keys(): + AttributeValue_union_value = AttributeValue_BS( + Seq([Seq(list_element) for list_element in input["BS"]]) + ) + elif "M" in input.keys(): + AttributeValue_union_value = AttributeValue_M( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["M"].items() + } + ) + ) + elif "L" in input.keys(): + AttributeValue_union_value = AttributeValue_L( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input["L"] + ] + ) + ) + elif "NULL" in input.keys(): + AttributeValue_union_value = AttributeValue_NULL(input["NULL"]) + elif "BOOL" in input.keys(): + AttributeValue_union_value = AttributeValue_BOOL(input["BOOL"]) + else: + raise ValueError("No recognized union value in union type: " + str(input)) + + return AttributeValue_union_value + + +def com_amazonaws_dynamodb_TransactionConflictException(input): + return Error_TransactionConflictException( + message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_TransactionInProgressException(input): + return Error_TransactionInProgressException( + Message=Seq(input["Error"]["Message"]), + ) + + +def com_amazonaws_dynamodb_BatchExecuteStatementInput(input): + return DafnyBatchExecuteStatementInput( + Statements=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BatchStatementRequest( + list_element + ) + for list_element in input["Statements"] + ] + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BatchStatementRequest(input): + return DafnyBatchStatementRequest( + Statement=Seq(input["Statement"]), + Parameters=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input["Parameters"] + ] + ) + ) + if "Parameters" in input.keys() + else Option_None() + ), + ConsistentRead=( + Option_Some(input["ConsistentRead"]) + if "ConsistentRead" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReturnConsumedCapacity(input): + # Convert ReturnConsumedCapacity + if input == "INDEXES": + return ReturnConsumedCapacity_INDEXES() + elif input == "TOTAL": + return ReturnConsumedCapacity_TOTAL() + elif input == "NONE": + return ReturnConsumedCapacity_NONE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_BatchExecuteStatementOutput(input): + return DafnyBatchExecuteStatementOutput( + Responses=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BatchStatementResponse( + list_element + ) + for list_element in input["Responses"] + ] + ) + ) + if "Responses" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input["ConsumedCapacity"] + ] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BatchStatementResponse(input): + return DafnyBatchStatementResponse( + Error=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BatchStatementError( + input["Error"] + ) + ) + if "Error" in input.keys() + else Option_None() + ), + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + Item=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Item"].items() + } + ) + ) + if "Item" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BatchStatementError(input): + return DafnyBatchStatementError( + Code=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BatchStatementErrorCodeEnum( + input["Code"] + ) + ) + if "Code" in input.keys() + else Option_None() + ), + Message=( + Option_Some(Seq(input["Message"])) + if "Message" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BatchStatementErrorCodeEnum(input): + # Convert BatchStatementErrorCodeEnum + if input == "ConditionalCheckFailed": + return BatchStatementErrorCodeEnum_ConditionalCheckFailed() + elif input == "ItemCollectionSizeLimitExceeded": + return BatchStatementErrorCodeEnum_ItemCollectionSizeLimitExceeded() + elif input == "RequestLimitExceeded": + return BatchStatementErrorCodeEnum_RequestLimitExceeded() + elif input == "ValidationError": + return BatchStatementErrorCodeEnum_ValidationError() + elif input == "ProvisionedThroughputExceeded": + return BatchStatementErrorCodeEnum_ProvisionedThroughputExceeded() + elif input == "TransactionConflict": + return BatchStatementErrorCodeEnum_TransactionConflict() + elif input == "ThrottlingError": + return BatchStatementErrorCodeEnum_ThrottlingError() + elif input == "InternalServerError": + return BatchStatementErrorCodeEnum_InternalServerError() + elif input == "ResourceNotFound": + return BatchStatementErrorCodeEnum_ResourceNotFound() + elif input == "AccessDenied": + return BatchStatementErrorCodeEnum_AccessDenied() + elif input == "DuplicateItem": + return BatchStatementErrorCodeEnum_DuplicateItem() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ConsumedCapacity(input): + return DafnyConsumedCapacity( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + CapacityUnits=( + Option_Some(input["CapacityUnits"]) + if "CapacityUnits" in input.keys() + else Option_None() + ), + ReadCapacityUnits=( + Option_Some(input["ReadCapacityUnits"]) + if "ReadCapacityUnits" in input.keys() + else Option_None() + ), + WriteCapacityUnits=( + Option_Some(input["WriteCapacityUnits"]) + if "WriteCapacityUnits" in input.keys() + else Option_None() + ), + Table=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Capacity( + input["Table"] + ) + ) + if "Table" in input.keys() + else Option_None() + ), + LocalSecondaryIndexes=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Capacity( + value + ) + for (key, value) in input["LocalSecondaryIndexes"].items() + } + ) + ) + if "LocalSecondaryIndexes" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Capacity( + value + ) + for (key, value) in input["GlobalSecondaryIndexes"].items() + } + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_Capacity(input): + return DafnyCapacity( + ReadCapacityUnits=( + Option_Some(input["ReadCapacityUnits"]) + if "ReadCapacityUnits" in input.keys() + else Option_None() + ), + WriteCapacityUnits=( + Option_Some(input["WriteCapacityUnits"]) + if "WriteCapacityUnits" in input.keys() + else Option_None() + ), + CapacityUnits=( + Option_Some(input["CapacityUnits"]) + if "CapacityUnits" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BatchGetItemInput(input): + return DafnyBatchGetItemInput( + RequestItems=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeysAndAttributes( + value + ) + for (key, value) in input["RequestItems"].items() + } + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_KeysAndAttributes(input): + return DafnyKeysAndAttributes( + Keys=Seq( + [ + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items() + } + ) + for list_element in input["Keys"] + ] + ), + AttributesToGet=( + Option_Some( + Seq([Seq(list_element) for list_element in input["AttributesToGet"]]) + ) + if "AttributesToGet" in input.keys() + else Option_None() + ), + ConsistentRead=( + Option_Some(input["ConsistentRead"]) + if "ConsistentRead" in input.keys() + else Option_None() + ), + ProjectionExpression=( + Option_Some(Seq(input["ProjectionExpression"])) + if "ProjectionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BatchGetItemOutput(input): + return DafnyBatchGetItemOutput( + Responses=( + Option_Some( + Map( + { + Seq(key): Seq( + [ + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items() + } + ) + for list_element in value + ] + ) + for (key, value) in input["Responses"].items() + } + ) + ) + if "Responses" in input.keys() + else Option_None() + ), + UnprocessedKeys=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeysAndAttributes( + value + ) + for (key, value) in input["UnprocessedKeys"].items() + } + ) + ) + if "UnprocessedKeys" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input["ConsumedCapacity"] + ] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BatchWriteItemInput(input): + return DafnyBatchWriteItemInput( + RequestItems=Map( + { + Seq(key): Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_WriteRequest( + list_element + ) + for list_element in value + ] + ) + for (key, value) in input["RequestItems"].items() + } + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ReturnItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input["ReturnItemCollectionMetrics"] + ) + ) + if "ReturnItemCollectionMetrics" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_WriteRequest(input): + return DafnyWriteRequest( + PutRequest=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_PutRequest( + input["PutRequest"] + ) + ) + if "PutRequest" in input.keys() + else Option_None() + ), + DeleteRequest=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DeleteRequest( + input["DeleteRequest"] + ) + ) + if "DeleteRequest" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_PutRequest(input): + return DafnyPutRequest( + Item=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Item"].items() + } + ), + ) + + +def com_amazonaws_dynamodb_DeleteRequest(input): + return DafnyDeleteRequest( + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + ) + + +def com_amazonaws_dynamodb_ReturnItemCollectionMetrics(input): + # Convert ReturnItemCollectionMetrics + if input == "SIZE": + return ReturnItemCollectionMetrics_SIZE() + elif input == "NONE": + return ReturnItemCollectionMetrics_NONE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_BatchWriteItemOutput(input): + return DafnyBatchWriteItemOutput( + UnprocessedItems=( + Option_Some( + Map( + { + Seq(key): Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_WriteRequest( + list_element + ) + for list_element in value + ] + ) + for (key, value) in input["UnprocessedItems"].items() + } + ) + ) + if "UnprocessedItems" in input.keys() + else Option_None() + ), + ItemCollectionMetrics=( + Option_Some( + Map( + { + Seq(key): Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemCollectionMetrics( + list_element + ) + for list_element in value + ] + ) + for (key, value) in input["ItemCollectionMetrics"].items() + } + ) + ) + if "ItemCollectionMetrics" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input["ConsumedCapacity"] + ] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ItemCollectionMetrics(input): + return DafnyItemCollectionMetrics( + ItemCollectionKey=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ItemCollectionKey"].items() + } + ) + ) + if "ItemCollectionKey" in input.keys() + else Option_None() + ), + SizeEstimateRangeGB=( + Option_Some( + Seq([list_element for list_element in input["SizeEstimateRangeGB"]]) + ) + if "SizeEstimateRangeGB" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_CreateBackupInput(input): + return DafnyCreateBackupInput( + TableName=Seq(input["TableName"]), + BackupName=Seq(input["BackupName"]), + ) + + +def com_amazonaws_dynamodb_CreateBackupOutput(input): + return DafnyCreateBackupOutput( + BackupDetails=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupDetails( + input["BackupDetails"] + ) + ) + if "BackupDetails" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BackupDetails(input): + return DafnyBackupDetails( + BackupArn=Seq(input["BackupArn"]), + BackupName=Seq(input["BackupName"]), + BackupSizeBytes=( + Option_Some(input["BackupSizeBytes"]) + if "BackupSizeBytes" in input.keys() + else Option_None() + ), + BackupStatus=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupStatus( + input["BackupStatus"] + ), + BackupType=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupType( + input["BackupType"] + ), + BackupCreationDateTime=TypeError("TimestampShape not supported"), + BackupExpiryDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "BackupExpiryDateTime" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BackupStatus(input): + # Convert BackupStatus + if input == "CREATING": + return BackupStatus_CREATING() + elif input == "DELETED": + return BackupStatus_DELETED() + elif input == "AVAILABLE": + return BackupStatus_AVAILABLE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_BackupType(input): + # Convert BackupType + if input == "USER": + return BackupType_USER() + elif input == "SYSTEM": + return BackupType_SYSTEM() + elif input == "AWS_BACKUP": + return BackupType_AWS__BACKUP() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_CreateGlobalTableInput(input): + return DafnyCreateGlobalTableInput( + GlobalTableName=Seq(input["GlobalTableName"]), + ReplicationGroup=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Replica( + list_element + ) + for list_element in input["ReplicationGroup"] + ] + ), + ) + + +def com_amazonaws_dynamodb_Replica(input): + return DafnyReplica( + RegionName=( + Option_Some(Seq(input["RegionName"])) + if "RegionName" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_CreateGlobalTableOutput(input): + return DafnyCreateGlobalTableOutput( + GlobalTableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTableDescription( + input["GlobalTableDescription"] + ) + ) + if "GlobalTableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GlobalTableDescription(input): + return DafnyGlobalTableDescription( + ReplicationGroup=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaDescription( + list_element + ) + for list_element in input["ReplicationGroup"] + ] + ) + ) + if "ReplicationGroup" in input.keys() + else Option_None() + ), + GlobalTableArn=( + Option_Some(Seq(input["GlobalTableArn"])) + if "GlobalTableArn" in input.keys() + else Option_None() + ), + CreationDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "CreationDateTime" in input.keys() + else Option_None() + ), + GlobalTableStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTableStatus( + input["GlobalTableStatus"] + ) + ) + if "GlobalTableStatus" in input.keys() + else Option_None() + ), + GlobalTableName=( + Option_Some(Seq(input["GlobalTableName"])) + if "GlobalTableName" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaDescription(input): + return DafnyReplicaDescription( + RegionName=( + Option_Some(Seq(input["RegionName"])) + if "RegionName" in input.keys() + else Option_None() + ), + ReplicaStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaStatus( + input["ReplicaStatus"] + ) + ) + if "ReplicaStatus" in input.keys() + else Option_None() + ), + ReplicaStatusDescription=( + Option_Some(Seq(input["ReplicaStatusDescription"])) + if "ReplicaStatusDescription" in input.keys() + else Option_None() + ), + ReplicaStatusPercentProgress=( + Option_Some(Seq(input["ReplicaStatusPercentProgress"])) + if "ReplicaStatusPercentProgress" in input.keys() + else Option_None() + ), + KMSMasterKeyId=( + Option_Some(Seq(input["KMSMasterKeyId"])) + if "KMSMasterKeyId" in input.keys() + else Option_None() + ), + ProvisionedThroughputOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input["ProvisionedThroughputOverride"] + ) + ) + if "ProvisionedThroughputOverride" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + ReplicaInaccessibleDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "ReplicaInaccessibleDateTime" in input.keys() + else Option_None() + ), + ReplicaTableClassSummary=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClassSummary( + input["ReplicaTableClassSummary"] + ) + ) + if "ReplicaTableClassSummary" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GlobalTableStatus(input): + # Convert GlobalTableStatus + if input == "CREATING": + return GlobalTableStatus_CREATING() + elif input == "ACTIVE": + return GlobalTableStatus_ACTIVE() + elif input == "DELETING": + return GlobalTableStatus_DELETING() + elif input == "UPDATING": + return GlobalTableStatus_UPDATING() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ReplicaStatus(input): + # Convert ReplicaStatus + if input == "CREATING": + return ReplicaStatus_CREATING() + elif input == "CREATION_FAILED": + return ReplicaStatus_CREATION__FAILED() + elif input == "UPDATING": + return ReplicaStatus_UPDATING() + elif input == "DELETING": + return ReplicaStatus_DELETING() + elif input == "ACTIVE": + return ReplicaStatus_ACTIVE() + elif input == "REGION_DISABLED": + return ReplicaStatus_REGION__DISABLED() + elif input == "INACCESSIBLE_ENCRYPTION_CREDENTIALS": + return ReplicaStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ProvisionedThroughputOverride(input): + return DafnyProvisionedThroughputOverride( + ReadCapacityUnits=( + Option_Some(input["ReadCapacityUnits"]) + if "ReadCapacityUnits" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription(input): + return DafnyReplicaGlobalSecondaryIndexDescription( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ProvisionedThroughputOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input["ProvisionedThroughputOverride"] + ) + ) + if "ProvisionedThroughputOverride" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TableClassSummary(input): + return DafnyTableClassSummary( + TableClass=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClass( + input["TableClass"] + ) + ) + if "TableClass" in input.keys() + else Option_None() + ), + LastUpdateDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "LastUpdateDateTime" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TableClass(input): + # Convert TableClass + if input == "STANDARD": + return TableClass_STANDARD() + elif input == "STANDARD_INFREQUENT_ACCESS": + return TableClass_STANDARD__INFREQUENT__ACCESS() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_CreateTableInput(input): + return DafnyCreateTableInput( + AttributeDefinitions=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input["AttributeDefinitions"] + ] + ), + TableName=Seq(input["TableName"]), + KeySchema=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ), + LocalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_LocalSecondaryIndex( + list_element + ) + for list_element in input["LocalSecondaryIndexes"] + ] + ) + ) + if "LocalSecondaryIndexes" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + BillingMode=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["BillingMode"] + ) + ) + if "BillingMode" in input.keys() + else Option_None() + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + StreamSpecification=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_StreamSpecification( + input["StreamSpecification"] + ) + ) + if "StreamSpecification" in input.keys() + else Option_None() + ), + SSESpecification=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSESpecification( + input["SSESpecification"] + ) + ) + if "SSESpecification" in input.keys() + else Option_None() + ), + Tags=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Tag( + list_element + ) + for list_element in input["Tags"] + ] + ) + ) + if "Tags" in input.keys() + else Option_None() + ), + TableClass=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClass( + input["TableClass"] + ) + ) + if "TableClass" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AttributeDefinition(input): + return DafnyAttributeDefinition( + AttributeName=Seq(input["AttributeName"]), + AttributeType=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ScalarAttributeType( + input["AttributeType"] + ), + ) + + +def com_amazonaws_dynamodb_ScalarAttributeType(input): + # Convert ScalarAttributeType + if input == "S": + return ScalarAttributeType_S() + elif input == "N": + return ScalarAttributeType_N() + elif input == "B": + return ScalarAttributeType_B() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_KeySchemaElement(input): + return DafnyKeySchemaElement( + AttributeName=Seq(input["AttributeName"]), + KeyType=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeyType( + input["KeyType"] + ), + ) + + +def com_amazonaws_dynamodb_KeyType(input): + # Convert KeyType + if input == "HASH": + return KeyType_HASH() + elif input == "RANGE": + return KeyType_RANGE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_LocalSecondaryIndex(input): + return DafnyLocalSecondaryIndex( + IndexName=Seq(input["IndexName"]), + KeySchema=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ), + Projection=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Projection( + input["Projection"] + ), + ) + + +def com_amazonaws_dynamodb_Projection(input): + return DafnyProjection( + ProjectionType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProjectionType( + input["ProjectionType"] + ) + ) + if "ProjectionType" in input.keys() + else Option_None() + ), + NonKeyAttributes=( + Option_Some( + Seq([Seq(list_element) for list_element in input["NonKeyAttributes"]]) + ) + if "NonKeyAttributes" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ProjectionType(input): + # Convert ProjectionType + if input == "ALL": + return ProjectionType_ALL() + elif input == "KEYS_ONLY": + return ProjectionType_KEYS__ONLY() + elif input == "INCLUDE": + return ProjectionType_INCLUDE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_GlobalSecondaryIndex(input): + return DafnyGlobalSecondaryIndex( + IndexName=Seq(input["IndexName"]), + KeySchema=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ), + Projection=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Projection( + input["Projection"] + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ProvisionedThroughput(input): + return DafnyProvisionedThroughput( + ReadCapacityUnits=input["ReadCapacityUnits"], + WriteCapacityUnits=input["WriteCapacityUnits"], + ) + + +def com_amazonaws_dynamodb_BillingMode(input): + # Convert BillingMode + if input == "PROVISIONED": + return BillingMode_PROVISIONED() + elif input == "PAY_PER_REQUEST": + return BillingMode_PAY__PER__REQUEST() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_StreamSpecification(input): + return DafnyStreamSpecification( + StreamEnabled=input["StreamEnabled"], + StreamViewType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_StreamViewType( + input["StreamViewType"] + ) + ) + if "StreamViewType" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_StreamViewType(input): + # Convert StreamViewType + if input == "NEW_IMAGE": + return StreamViewType_NEW__IMAGE() + elif input == "OLD_IMAGE": + return StreamViewType_OLD__IMAGE() + elif input == "NEW_AND_OLD_IMAGES": + return StreamViewType_NEW__AND__OLD__IMAGES() + elif input == "KEYS_ONLY": + return StreamViewType_KEYS__ONLY() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_SSESpecification(input): + return DafnySSESpecification( + Enabled=( + Option_Some(input["Enabled"]) + if "Enabled" in input.keys() + else Option_None() + ), + SSEType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSEType( + input["SSEType"] + ) + ) + if "SSEType" in input.keys() + else Option_None() + ), + KMSMasterKeyId=( + Option_Some(Seq(input["KMSMasterKeyId"])) + if "KMSMasterKeyId" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_SSEType(input): + # Convert SSEType + if input == "AES256": + return SSEType_AES256() + elif input == "KMS": + return SSEType_KMS() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_Tag(input): + return DafnyTag( + Key=Seq(input["Key"]), + Value=Seq(input["Value"]), + ) + + +def com_amazonaws_dynamodb_CreateTableOutput(input): + return DafnyCreateTableOutput( + TableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableDescription( + input["TableDescription"] + ) + ) + if "TableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TableDescription(input): + return DafnyTableDescription( + AttributeDefinitions=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input["AttributeDefinitions"] + ] + ) + ) + if "AttributeDefinitions" in input.keys() + else Option_None() + ), + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + KeySchema=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ) + ) + if "KeySchema" in input.keys() + else Option_None() + ), + TableStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableStatus( + input["TableStatus"] + ) + ) + if "TableStatus" in input.keys() + else Option_None() + ), + CreationDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "CreationDateTime" in input.keys() + else Option_None() + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputDescription( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + TableSizeBytes=( + Option_Some(input["TableSizeBytes"]) + if "TableSizeBytes" in input.keys() + else Option_None() + ), + ItemCount=( + Option_Some(input["ItemCount"]) + if "ItemCount" in input.keys() + else Option_None() + ), + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + TableId=( + Option_Some(Seq(input["TableId"])) + if "TableId" in input.keys() + else Option_None() + ), + BillingModeSummary=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingModeSummary( + input["BillingModeSummary"] + ) + ) + if "BillingModeSummary" in input.keys() + else Option_None() + ), + LocalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_LocalSecondaryIndexDescription( + list_element + ) + for list_element in input["LocalSecondaryIndexes"] + ] + ) + ) + if "LocalSecondaryIndexes" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndexDescription( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + StreamSpecification=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_StreamSpecification( + input["StreamSpecification"] + ) + ) + if "StreamSpecification" in input.keys() + else Option_None() + ), + LatestStreamLabel=( + Option_Some(Seq(input["LatestStreamLabel"])) + if "LatestStreamLabel" in input.keys() + else Option_None() + ), + LatestStreamArn=( + Option_Some(Seq(input["LatestStreamArn"])) + if "LatestStreamArn" in input.keys() + else Option_None() + ), + GlobalTableVersion=( + Option_Some(Seq(input["GlobalTableVersion"])) + if "GlobalTableVersion" in input.keys() + else Option_None() + ), + Replicas=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaDescription( + list_element + ) + for list_element in input["Replicas"] + ] + ) + ) + if "Replicas" in input.keys() + else Option_None() + ), + RestoreSummary=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_RestoreSummary( + input["RestoreSummary"] + ) + ) + if "RestoreSummary" in input.keys() + else Option_None() + ), + SSEDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSEDescription( + input["SSEDescription"] + ) + ) + if "SSEDescription" in input.keys() + else Option_None() + ), + ArchivalSummary=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ArchivalSummary( + input["ArchivalSummary"] + ) + ) + if "ArchivalSummary" in input.keys() + else Option_None() + ), + TableClassSummary=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClassSummary( + input["TableClassSummary"] + ) + ) + if "TableClassSummary" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TableStatus(input): + # Convert TableStatus + if input == "CREATING": + return TableStatus_CREATING() + elif input == "UPDATING": + return TableStatus_UPDATING() + elif input == "DELETING": + return TableStatus_DELETING() + elif input == "ACTIVE": + return TableStatus_ACTIVE() + elif input == "INACCESSIBLE_ENCRYPTION_CREDENTIALS": + return TableStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS() + elif input == "ARCHIVING": + return TableStatus_ARCHIVING() + elif input == "ARCHIVED": + return TableStatus_ARCHIVED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ProvisionedThroughputDescription(input): + return DafnyProvisionedThroughputDescription( + LastIncreaseDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "LastIncreaseDateTime" in input.keys() + else Option_None() + ), + LastDecreaseDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "LastDecreaseDateTime" in input.keys() + else Option_None() + ), + NumberOfDecreasesToday=( + Option_Some(input["NumberOfDecreasesToday"]) + if "NumberOfDecreasesToday" in input.keys() + else Option_None() + ), + ReadCapacityUnits=( + Option_Some(input["ReadCapacityUnits"]) + if "ReadCapacityUnits" in input.keys() + else Option_None() + ), + WriteCapacityUnits=( + Option_Some(input["WriteCapacityUnits"]) + if "WriteCapacityUnits" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BillingModeSummary(input): + return DafnyBillingModeSummary( + BillingMode=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["BillingMode"] + ) + ) + if "BillingMode" in input.keys() + else Option_None() + ), + LastUpdateToPayPerRequestDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "LastUpdateToPayPerRequestDateTime" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_LocalSecondaryIndexDescription(input): + return DafnyLocalSecondaryIndexDescription( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + KeySchema=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ) + ) + if "KeySchema" in input.keys() + else Option_None() + ), + Projection=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Projection( + input["Projection"] + ) + ) + if "Projection" in input.keys() + else Option_None() + ), + IndexSizeBytes=( + Option_Some(input["IndexSizeBytes"]) + if "IndexSizeBytes" in input.keys() + else Option_None() + ), + ItemCount=( + Option_Some(input["ItemCount"]) + if "ItemCount" in input.keys() + else Option_None() + ), + IndexArn=( + Option_Some(Seq(input["IndexArn"])) + if "IndexArn" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexDescription(input): + return DafnyGlobalSecondaryIndexDescription( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + KeySchema=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ) + ) + if "KeySchema" in input.keys() + else Option_None() + ), + Projection=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Projection( + input["Projection"] + ) + ) + if "Projection" in input.keys() + else Option_None() + ), + IndexStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_IndexStatus( + input["IndexStatus"] + ) + ) + if "IndexStatus" in input.keys() + else Option_None() + ), + Backfilling=( + Option_Some(input["Backfilling"]) + if "Backfilling" in input.keys() + else Option_None() + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputDescription( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + IndexSizeBytes=( + Option_Some(input["IndexSizeBytes"]) + if "IndexSizeBytes" in input.keys() + else Option_None() + ), + ItemCount=( + Option_Some(input["ItemCount"]) + if "ItemCount" in input.keys() + else Option_None() + ), + IndexArn=( + Option_Some(Seq(input["IndexArn"])) + if "IndexArn" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_RestoreSummary(input): + return DafnyRestoreSummary( + SourceBackupArn=( + Option_Some(Seq(input["SourceBackupArn"])) + if "SourceBackupArn" in input.keys() + else Option_None() + ), + SourceTableArn=( + Option_Some(Seq(input["SourceTableArn"])) + if "SourceTableArn" in input.keys() + else Option_None() + ), + RestoreDateTime=TypeError("TimestampShape not supported"), + RestoreInProgress=input["RestoreInProgress"], + ) + + +def com_amazonaws_dynamodb_SSEDescription(input): + return DafnySSEDescription( + Status=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSEStatus( + input["Status"] + ) + ) + if "Status" in input.keys() + else Option_None() + ), + SSEType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSEType( + input["SSEType"] + ) + ) + if "SSEType" in input.keys() + else Option_None() + ), + KMSMasterKeyArn=( + Option_Some(Seq(input["KMSMasterKeyArn"])) + if "KMSMasterKeyArn" in input.keys() + else Option_None() + ), + InaccessibleEncryptionDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "InaccessibleEncryptionDateTime" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ArchivalSummary(input): + return DafnyArchivalSummary( + ArchivalDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "ArchivalDateTime" in input.keys() + else Option_None() + ), + ArchivalReason=( + Option_Some(Seq(input["ArchivalReason"])) + if "ArchivalReason" in input.keys() + else Option_None() + ), + ArchivalBackupArn=( + Option_Some(Seq(input["ArchivalBackupArn"])) + if "ArchivalBackupArn" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_IndexStatus(input): + # Convert IndexStatus + if input == "CREATING": + return IndexStatus_CREATING() + elif input == "UPDATING": + return IndexStatus_UPDATING() + elif input == "DELETING": + return IndexStatus_DELETING() + elif input == "ACTIVE": + return IndexStatus_ACTIVE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_SSEStatus(input): + # Convert SSEStatus + if input == "ENABLING": + return SSEStatus_ENABLING() + elif input == "ENABLED": + return SSEStatus_ENABLED() + elif input == "DISABLING": + return SSEStatus_DISABLING() + elif input == "DISABLED": + return SSEStatus_DISABLED() + elif input == "UPDATING": + return SSEStatus_UPDATING() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DeleteBackupInput(input): + return DafnyDeleteBackupInput( + BackupArn=Seq(input["BackupArn"]), + ) + + +def com_amazonaws_dynamodb_DeleteBackupOutput(input): + return DafnyDeleteBackupOutput( + BackupDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupDescription( + input["BackupDescription"] + ) + ) + if "BackupDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BackupDescription(input): + return DafnyBackupDescription( + BackupDetails=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupDetails( + input["BackupDetails"] + ) + ) + if "BackupDetails" in input.keys() + else Option_None() + ), + SourceTableDetails=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SourceTableDetails( + input["SourceTableDetails"] + ) + ) + if "SourceTableDetails" in input.keys() + else Option_None() + ), + SourceTableFeatureDetails=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SourceTableFeatureDetails( + input["SourceTableFeatureDetails"] + ) + ) + if "SourceTableFeatureDetails" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_SourceTableDetails(input): + return DafnySourceTableDetails( + TableName=Seq(input["TableName"]), + TableId=Seq(input["TableId"]), + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + TableSizeBytes=( + Option_Some(input["TableSizeBytes"]) + if "TableSizeBytes" in input.keys() + else Option_None() + ), + KeySchema=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ), + TableCreationDateTime=TypeError("TimestampShape not supported"), + ProvisionedThroughput=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ), + ItemCount=( + Option_Some(input["ItemCount"]) + if "ItemCount" in input.keys() + else Option_None() + ), + BillingMode=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["BillingMode"] + ) + ) + if "BillingMode" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_SourceTableFeatureDetails(input): + return DafnySourceTableFeatureDetails( + LocalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_LocalSecondaryIndexInfo( + list_element + ) + for list_element in input["LocalSecondaryIndexes"] + ] + ) + ) + if "LocalSecondaryIndexes" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndexInfo( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + StreamDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_StreamSpecification( + input["StreamDescription"] + ) + ) + if "StreamDescription" in input.keys() + else Option_None() + ), + TimeToLiveDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TimeToLiveDescription( + input["TimeToLiveDescription"] + ) + ) + if "TimeToLiveDescription" in input.keys() + else Option_None() + ), + SSEDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSEDescription( + input["SSEDescription"] + ) + ) + if "SSEDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_LocalSecondaryIndexInfo(input): + return DafnyLocalSecondaryIndexInfo( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + KeySchema=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ) + ) + if "KeySchema" in input.keys() + else Option_None() + ), + Projection=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Projection( + input["Projection"] + ) + ) + if "Projection" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexInfo(input): + return DafnyGlobalSecondaryIndexInfo( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + KeySchema=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ) + ) + if "KeySchema" in input.keys() + else Option_None() + ), + Projection=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Projection( + input["Projection"] + ) + ) + if "Projection" in input.keys() + else Option_None() + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TimeToLiveDescription(input): + return DafnyTimeToLiveDescription( + TimeToLiveStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TimeToLiveStatus( + input["TimeToLiveStatus"] + ) + ) + if "TimeToLiveStatus" in input.keys() + else Option_None() + ), + AttributeName=( + Option_Some(Seq(input["AttributeName"])) + if "AttributeName" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TimeToLiveStatus(input): + # Convert TimeToLiveStatus + if input == "ENABLING": + return TimeToLiveStatus_ENABLING() + elif input == "DISABLING": + return TimeToLiveStatus_DISABLING() + elif input == "ENABLED": + return TimeToLiveStatus_ENABLED() + elif input == "DISABLED": + return TimeToLiveStatus_DISABLED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DeleteItemInput(input): + return DafnyDeleteItemInput( + TableName=Seq(input["TableName"]), + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + Expected=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExpectedAttributeValue( + value + ) + for (key, value) in input["Expected"].items() + } + ) + ) + if "Expected" in input.keys() + else Option_None() + ), + ConditionalOperator=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConditionalOperator( + input["ConditionalOperator"] + ) + ) + if "ConditionalOperator" in input.keys() + else Option_None() + ), + ReturnValues=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnValue( + input["ReturnValues"] + ) + ) + if "ReturnValues" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ReturnItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input["ReturnItemCollectionMetrics"] + ) + ) + if "ReturnItemCollectionMetrics" in input.keys() + else Option_None() + ), + ConditionExpression=( + Option_Some(Seq(input["ConditionExpression"])) + if "ConditionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExpectedAttributeValue(input): + return DafnyExpectedAttributeValue( + Value=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + input["Value"] + ) + ) + if "Value" in input.keys() + else Option_None() + ), + Exists=( + Option_Some(input["Exists"]) if "Exists" in input.keys() else Option_None() + ), + ComparisonOperator=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ComparisonOperator( + input["ComparisonOperator"] + ) + ) + if "ComparisonOperator" in input.keys() + else Option_None() + ), + AttributeValueList=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input["AttributeValueList"] + ] + ) + ) + if "AttributeValueList" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ComparisonOperator(input): + # Convert ComparisonOperator + if input == "EQ": + return ComparisonOperator_EQ() + elif input == "NE": + return ComparisonOperator_NE() + elif input == "IN": + return ComparisonOperator_IN() + elif input == "LE": + return ComparisonOperator_LE() + elif input == "LT": + return ComparisonOperator_LT() + elif input == "GE": + return ComparisonOperator_GE() + elif input == "GT": + return ComparisonOperator_GT() + elif input == "BETWEEN": + return ComparisonOperator_BETWEEN() + elif input == "NOT_NULL": + return ComparisonOperator_NOT__NULL() + elif input == "NULL": + return ComparisonOperator_NULL() + elif input == "CONTAINS": + return ComparisonOperator_CONTAINS() + elif input == "NOT_CONTAINS": + return ComparisonOperator_NOT__CONTAINS() + elif input == "BEGINS_WITH": + return ComparisonOperator_BEGINS__WITH() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ConditionalOperator(input): + # Convert ConditionalOperator + if input == "AND": + return ConditionalOperator_AND() + elif input == "OR": + return ConditionalOperator_OR() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ReturnValue(input): + # Convert ReturnValue + if input == "NONE": + return ReturnValue_NONE() + elif input == "ALL_OLD": + return ReturnValue_ALL__OLD() + elif input == "UPDATED_OLD": + return ReturnValue_UPDATED__OLD() + elif input == "ALL_NEW": + return ReturnValue_ALL__NEW() + elif input == "UPDATED_NEW": + return ReturnValue_UPDATED__NEW() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DeleteItemOutput(input): + return DafnyDeleteItemOutput( + Attributes=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Attributes"].items() + } + ) + ) + if "Attributes" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + input["ConsumedCapacity"] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemCollectionMetrics( + input["ItemCollectionMetrics"] + ) + ) + if "ItemCollectionMetrics" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DeleteTableInput(input): + return DafnyDeleteTableInput( + TableName=Seq(input["TableName"]), + ) + + +def com_amazonaws_dynamodb_DeleteTableOutput(input): + return DafnyDeleteTableOutput( + TableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableDescription( + input["TableDescription"] + ) + ) + if "TableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeBackupInput(input): + return DafnyDescribeBackupInput( + BackupArn=Seq(input["BackupArn"]), + ) + + +def com_amazonaws_dynamodb_DescribeBackupOutput(input): + return DafnyDescribeBackupOutput( + BackupDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupDescription( + input["BackupDescription"] + ) + ) + if "BackupDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeContinuousBackupsInput(input): + return DafnyDescribeContinuousBackupsInput( + TableName=Seq(input["TableName"]), + ) + + +def com_amazonaws_dynamodb_DescribeContinuousBackupsOutput(input): + return DafnyDescribeContinuousBackupsOutput( + ContinuousBackupsDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContinuousBackupsDescription( + input["ContinuousBackupsDescription"] + ) + ) + if "ContinuousBackupsDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ContinuousBackupsDescription(input): + return DafnyContinuousBackupsDescription( + ContinuousBackupsStatus=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContinuousBackupsStatus( + input["ContinuousBackupsStatus"] + ), + PointInTimeRecoveryDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_PointInTimeRecoveryDescription( + input["PointInTimeRecoveryDescription"] + ) + ) + if "PointInTimeRecoveryDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ContinuousBackupsStatus(input): + # Convert ContinuousBackupsStatus + if input == "ENABLED": + return ContinuousBackupsStatus_ENABLED() + elif input == "DISABLED": + return ContinuousBackupsStatus_DISABLED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_PointInTimeRecoveryDescription(input): + return DafnyPointInTimeRecoveryDescription( + PointInTimeRecoveryStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_PointInTimeRecoveryStatus( + input["PointInTimeRecoveryStatus"] + ) + ) + if "PointInTimeRecoveryStatus" in input.keys() + else Option_None() + ), + EarliestRestorableDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "EarliestRestorableDateTime" in input.keys() + else Option_None() + ), + LatestRestorableDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "LatestRestorableDateTime" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_PointInTimeRecoveryStatus(input): + # Convert PointInTimeRecoveryStatus + if input == "ENABLED": + return PointInTimeRecoveryStatus_ENABLED() + elif input == "DISABLED": + return PointInTimeRecoveryStatus_DISABLED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DescribeContributorInsightsInput(input): + return DafnyDescribeContributorInsightsInput( + TableName=Seq(input["TableName"]), + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeContributorInsightsOutput(input): + return DafnyDescribeContributorInsightsOutput( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ContributorInsightsRuleList=( + Option_Some( + Seq( + [ + Seq(list_element) + for list_element in input["ContributorInsightsRuleList"] + ] + ) + ) + if "ContributorInsightsRuleList" in input.keys() + else Option_None() + ), + ContributorInsightsStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContributorInsightsStatus( + input["ContributorInsightsStatus"] + ) + ) + if "ContributorInsightsStatus" in input.keys() + else Option_None() + ), + LastUpdateDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "LastUpdateDateTime" in input.keys() + else Option_None() + ), + FailureException=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_FailureException( + input["FailureException"] + ) + ) + if "FailureException" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ContributorInsightsStatus(input): + # Convert ContributorInsightsStatus + if input == "ENABLING": + return ContributorInsightsStatus_ENABLING() + elif input == "ENABLED": + return ContributorInsightsStatus_ENABLED() + elif input == "DISABLING": + return ContributorInsightsStatus_DISABLING() + elif input == "DISABLED": + return ContributorInsightsStatus_DISABLED() + elif input == "FAILED": + return ContributorInsightsStatus_FAILED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_FailureException(input): + return DafnyFailureException( + ExceptionName=( + Option_Some(Seq(input["ExceptionName"])) + if "ExceptionName" in input.keys() + else Option_None() + ), + ExceptionDescription=( + Option_Some(Seq(input["ExceptionDescription"])) + if "ExceptionDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeEndpointsRequest(input): + return DafnyDescribeEndpointsRequest() + + +def com_amazonaws_dynamodb_DescribeEndpointsResponse(input): + return DafnyDescribeEndpointsResponse( + Endpoints=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Endpoint( + list_element + ) + for list_element in input["Endpoints"] + ] + ), + ) + + +def com_amazonaws_dynamodb_Endpoint(input): + return DafnyEndpoint( + Address=Seq(input["Address"]), + CachePeriodInMinutes=input["CachePeriodInMinutes"], + ) + + +def com_amazonaws_dynamodb_DescribeExportInput(input): + return DafnyDescribeExportInput( + ExportArn=Seq(input["ExportArn"]), + ) + + +def com_amazonaws_dynamodb_DescribeExportOutput(input): + return DafnyDescribeExportOutput( + ExportDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportDescription( + input["ExportDescription"] + ) + ) + if "ExportDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExportDescription(input): + return DafnyExportDescription( + ExportArn=( + Option_Some(Seq(input["ExportArn"])) + if "ExportArn" in input.keys() + else Option_None() + ), + ExportStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportStatus( + input["ExportStatus"] + ) + ) + if "ExportStatus" in input.keys() + else Option_None() + ), + StartTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "StartTime" in input.keys() + else Option_None() + ), + EndTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "EndTime" in input.keys() + else Option_None() + ), + ExportManifest=( + Option_Some(Seq(input["ExportManifest"])) + if "ExportManifest" in input.keys() + else Option_None() + ), + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + TableId=( + Option_Some(Seq(input["TableId"])) + if "TableId" in input.keys() + else Option_None() + ), + ExportTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "ExportTime" in input.keys() + else Option_None() + ), + ClientToken=( + Option_Some(Seq(input["ClientToken"])) + if "ClientToken" in input.keys() + else Option_None() + ), + S3Bucket=( + Option_Some(Seq(input["S3Bucket"])) + if "S3Bucket" in input.keys() + else Option_None() + ), + S3BucketOwner=( + Option_Some(Seq(input["S3BucketOwner"])) + if "S3BucketOwner" in input.keys() + else Option_None() + ), + S3Prefix=( + Option_Some(Seq(input["S3Prefix"])) + if "S3Prefix" in input.keys() + else Option_None() + ), + S3SseAlgorithm=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_S3SseAlgorithm( + input["S3SseAlgorithm"] + ) + ) + if "S3SseAlgorithm" in input.keys() + else Option_None() + ), + S3SseKmsKeyId=( + Option_Some(Seq(input["S3SseKmsKeyId"])) + if "S3SseKmsKeyId" in input.keys() + else Option_None() + ), + FailureCode=( + Option_Some(Seq(input["FailureCode"])) + if "FailureCode" in input.keys() + else Option_None() + ), + FailureMessage=( + Option_Some(Seq(input["FailureMessage"])) + if "FailureMessage" in input.keys() + else Option_None() + ), + ExportFormat=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportFormat( + input["ExportFormat"] + ) + ) + if "ExportFormat" in input.keys() + else Option_None() + ), + BilledSizeBytes=( + Option_Some(input["BilledSizeBytes"]) + if "BilledSizeBytes" in input.keys() + else Option_None() + ), + ItemCount=( + Option_Some(input["ItemCount"]) + if "ItemCount" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExportStatus(input): + # Convert ExportStatus + if input == "IN_PROGRESS": + return ExportStatus_IN__PROGRESS() + elif input == "COMPLETED": + return ExportStatus_COMPLETED() + elif input == "FAILED": + return ExportStatus_FAILED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_S3SseAlgorithm(input): + # Convert S3SseAlgorithm + if input == "AES256": + return S3SseAlgorithm_AES256() + elif input == "KMS": + return S3SseAlgorithm_KMS() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ExportFormat(input): + # Convert ExportFormat + if input == "DYNAMODB_JSON": + return ExportFormat_DYNAMODB__JSON() + elif input == "ION": + return ExportFormat_ION() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DescribeGlobalTableInput(input): + return DafnyDescribeGlobalTableInput( + GlobalTableName=Seq(input["GlobalTableName"]), + ) + + +def com_amazonaws_dynamodb_DescribeGlobalTableOutput(input): + return DafnyDescribeGlobalTableOutput( + GlobalTableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTableDescription( + input["GlobalTableDescription"] + ) + ) + if "GlobalTableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput(input): + return DafnyDescribeGlobalTableSettingsInput( + GlobalTableName=Seq(input["GlobalTableName"]), + ) + + +def com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput(input): + return DafnyDescribeGlobalTableSettingsOutput( + GlobalTableName=( + Option_Some(Seq(input["GlobalTableName"])) + if "GlobalTableName" in input.keys() + else Option_None() + ), + ReplicaSettings=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaSettingsDescription( + list_element + ) + for list_element in input["ReplicaSettings"] + ] + ) + ) + if "ReplicaSettings" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaSettingsDescription(input): + return DafnyReplicaSettingsDescription( + RegionName=Seq(input["RegionName"]), + ReplicaStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaStatus( + input["ReplicaStatus"] + ) + ) + if "ReplicaStatus" in input.keys() + else Option_None() + ), + ReplicaBillingModeSummary=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingModeSummary( + input["ReplicaBillingModeSummary"] + ) + ) + if "ReplicaBillingModeSummary" in input.keys() + else Option_None() + ), + ReplicaProvisionedReadCapacityUnits=( + Option_Some(input["ReplicaProvisionedReadCapacityUnits"]) + if "ReplicaProvisionedReadCapacityUnits" in input.keys() + else Option_None() + ), + ReplicaProvisionedReadCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ReplicaProvisionedReadCapacityAutoScalingSettings"] + ) + ) + if "ReplicaProvisionedReadCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ReplicaProvisionedWriteCapacityUnits=( + Option_Some(input["ReplicaProvisionedWriteCapacityUnits"]) + if "ReplicaProvisionedWriteCapacityUnits" in input.keys() + else Option_None() + ), + ReplicaProvisionedWriteCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ReplicaProvisionedWriteCapacityAutoScalingSettings"] + ) + ) + if "ReplicaProvisionedWriteCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ReplicaGlobalSecondaryIndexSettings=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription( + list_element + ) + for list_element in input["ReplicaGlobalSecondaryIndexSettings"] + ] + ) + ) + if "ReplicaGlobalSecondaryIndexSettings" in input.keys() + else Option_None() + ), + ReplicaTableClassSummary=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClassSummary( + input["ReplicaTableClassSummary"] + ) + ) + if "ReplicaTableClassSummary" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AutoScalingSettingsDescription(input): + return DafnyAutoScalingSettingsDescription( + MinimumUnits=( + Option_Some(input["MinimumUnits"]) + if "MinimumUnits" in input.keys() + else Option_None() + ), + MaximumUnits=( + Option_Some(input["MaximumUnits"]) + if "MaximumUnits" in input.keys() + else Option_None() + ), + AutoScalingDisabled=( + Option_Some(input["AutoScalingDisabled"]) + if "AutoScalingDisabled" in input.keys() + else Option_None() + ), + AutoScalingRoleArn=( + Option_Some(Seq(input["AutoScalingRoleArn"])) + if "AutoScalingRoleArn" in input.keys() + else Option_None() + ), + ScalingPolicies=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingPolicyDescription( + list_element + ) + for list_element in input["ScalingPolicies"] + ] + ) + ) + if "ScalingPolicies" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription(input): + return DafnyReplicaGlobalSecondaryIndexSettingsDescription( + IndexName=Seq(input["IndexName"]), + IndexStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_IndexStatus( + input["IndexStatus"] + ) + ) + if "IndexStatus" in input.keys() + else Option_None() + ), + ProvisionedReadCapacityUnits=( + Option_Some(input["ProvisionedReadCapacityUnits"]) + if "ProvisionedReadCapacityUnits" in input.keys() + else Option_None() + ), + ProvisionedReadCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ProvisionedReadCapacityAutoScalingSettings"] + ) + ) + if "ProvisionedReadCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ProvisionedWriteCapacityUnits=( + Option_Some(input["ProvisionedWriteCapacityUnits"]) + if "ProvisionedWriteCapacityUnits" in input.keys() + else Option_None() + ), + ProvisionedWriteCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ProvisionedWriteCapacityAutoScalingSettings"] + ) + ) + if "ProvisionedWriteCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AutoScalingPolicyDescription(input): + return DafnyAutoScalingPolicyDescription( + PolicyName=( + Option_Some(Seq(input["PolicyName"])) + if "PolicyName" in input.keys() + else Option_None() + ), + TargetTrackingScalingPolicyConfiguration=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription( + input["TargetTrackingScalingPolicyConfiguration"] + ) + ) + if "TargetTrackingScalingPolicyConfiguration" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription( + input, +): + return DafnyAutoScalingTargetTrackingScalingPolicyConfigurationDescription( + DisableScaleIn=( + Option_Some(input["DisableScaleIn"]) + if "DisableScaleIn" in input.keys() + else Option_None() + ), + ScaleInCooldown=( + Option_Some(input["ScaleInCooldown"]) + if "ScaleInCooldown" in input.keys() + else Option_None() + ), + ScaleOutCooldown=( + Option_Some(input["ScaleOutCooldown"]) + if "ScaleOutCooldown" in input.keys() + else Option_None() + ), + TargetValue=input["TargetValue"], + ) + + +def com_amazonaws_dynamodb_DescribeImportInput(input): + return DafnyDescribeImportInput( + ImportArn=Seq(input["ImportArn"]), + ) + + +def com_amazonaws_dynamodb_DescribeImportOutput(input): + return DafnyDescribeImportOutput( + ImportTableDescription=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportTableDescription( + input["ImportTableDescription"] + ), + ) + + +def com_amazonaws_dynamodb_ImportTableDescription(input): + return DafnyImportTableDescription( + ImportArn=( + Option_Some(Seq(input["ImportArn"])) + if "ImportArn" in input.keys() + else Option_None() + ), + ImportStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportStatus( + input["ImportStatus"] + ) + ) + if "ImportStatus" in input.keys() + else Option_None() + ), + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + TableId=( + Option_Some(Seq(input["TableId"])) + if "TableId" in input.keys() + else Option_None() + ), + ClientToken=( + Option_Some(Seq(input["ClientToken"])) + if "ClientToken" in input.keys() + else Option_None() + ), + S3BucketSource=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_S3BucketSource( + input["S3BucketSource"] + ) + ) + if "S3BucketSource" in input.keys() + else Option_None() + ), + ErrorCount=( + Option_Some(input["ErrorCount"]) + if "ErrorCount" in input.keys() + else Option_None() + ), + CloudWatchLogGroupArn=( + Option_Some(Seq(input["CloudWatchLogGroupArn"])) + if "CloudWatchLogGroupArn" in input.keys() + else Option_None() + ), + InputFormat=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InputFormat( + input["InputFormat"] + ) + ) + if "InputFormat" in input.keys() + else Option_None() + ), + InputFormatOptions=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InputFormatOptions( + input["InputFormatOptions"] + ) + ) + if "InputFormatOptions" in input.keys() + else Option_None() + ), + InputCompressionType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InputCompressionType( + input["InputCompressionType"] + ) + ) + if "InputCompressionType" in input.keys() + else Option_None() + ), + TableCreationParameters=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableCreationParameters( + input["TableCreationParameters"] + ) + ) + if "TableCreationParameters" in input.keys() + else Option_None() + ), + StartTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "StartTime" in input.keys() + else Option_None() + ), + EndTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "EndTime" in input.keys() + else Option_None() + ), + ProcessedSizeBytes=( + Option_Some(input["ProcessedSizeBytes"]) + if "ProcessedSizeBytes" in input.keys() + else Option_None() + ), + ProcessedItemCount=( + Option_Some(input["ProcessedItemCount"]) + if "ProcessedItemCount" in input.keys() + else Option_None() + ), + ImportedItemCount=( + Option_Some(input["ImportedItemCount"]) + if "ImportedItemCount" in input.keys() + else Option_None() + ), + FailureCode=( + Option_Some(Seq(input["FailureCode"])) + if "FailureCode" in input.keys() + else Option_None() + ), + FailureMessage=( + Option_Some(Seq(input["FailureMessage"])) + if "FailureMessage" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ImportStatus(input): + # Convert ImportStatus + if input == "IN_PROGRESS": + return ImportStatus_IN__PROGRESS() + elif input == "COMPLETED": + return ImportStatus_COMPLETED() + elif input == "CANCELLING": + return ImportStatus_CANCELLING() + elif input == "CANCELLED": + return ImportStatus_CANCELLED() + elif input == "FAILED": + return ImportStatus_FAILED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_S3BucketSource(input): + return DafnyS3BucketSource( + S3BucketOwner=( + Option_Some(Seq(input["S3BucketOwner"])) + if "S3BucketOwner" in input.keys() + else Option_None() + ), + S3Bucket=Seq(input["S3Bucket"]), + S3KeyPrefix=( + Option_Some(Seq(input["S3KeyPrefix"])) + if "S3KeyPrefix" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_InputFormat(input): + # Convert InputFormat + if input == "DYNAMODB_JSON": + return InputFormat_DYNAMODB__JSON() + elif input == "ION": + return InputFormat_ION() + elif input == "CSV": + return InputFormat_CSV() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_InputFormatOptions(input): + return DafnyInputFormatOptions( + Csv=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CsvOptions( + input["Csv"] + ) + ) + if "Csv" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_InputCompressionType(input): + # Convert InputCompressionType + if input == "GZIP": + return InputCompressionType_GZIP() + elif input == "ZSTD": + return InputCompressionType_ZSTD() + elif input == "NONE": + return InputCompressionType_NONE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_TableCreationParameters(input): + return DafnyTableCreationParameters( + TableName=Seq(input["TableName"]), + AttributeDefinitions=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input["AttributeDefinitions"] + ] + ), + KeySchema=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ), + BillingMode=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["BillingMode"] + ) + ) + if "BillingMode" in input.keys() + else Option_None() + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + SSESpecification=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSESpecification( + input["SSESpecification"] + ) + ) + if "SSESpecification" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_CsvOptions(input): + return DafnyCsvOptions( + Delimiter=( + Option_Some(Seq(input["Delimiter"])) + if "Delimiter" in input.keys() + else Option_None() + ), + HeaderList=( + Option_Some( + Seq([Seq(list_element) for list_element in input["HeaderList"]]) + ) + if "HeaderList" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput(input): + return DafnyDescribeKinesisStreamingDestinationInput( + TableName=Seq(input["TableName"]), + ) + + +def com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput(input): + return DafnyDescribeKinesisStreamingDestinationOutput( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + KinesisDataStreamDestinations=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KinesisDataStreamDestination( + list_element + ) + for list_element in input["KinesisDataStreamDestinations"] + ] + ) + ) + if "KinesisDataStreamDestinations" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_KinesisDataStreamDestination(input): + return DafnyKinesisDataStreamDestination( + StreamArn=( + Option_Some(Seq(input["StreamArn"])) + if "StreamArn" in input.keys() + else Option_None() + ), + DestinationStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DestinationStatus( + input["DestinationStatus"] + ) + ) + if "DestinationStatus" in input.keys() + else Option_None() + ), + DestinationStatusDescription=( + Option_Some(Seq(input["DestinationStatusDescription"])) + if "DestinationStatusDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DestinationStatus(input): + # Convert DestinationStatus + if input == "ENABLING": + return DestinationStatus_ENABLING() + elif input == "ACTIVE": + return DestinationStatus_ACTIVE() + elif input == "DISABLING": + return DestinationStatus_DISABLING() + elif input == "DISABLED": + return DestinationStatus_DISABLED() + elif input == "ENABLE_FAILED": + return DestinationStatus_ENABLE__FAILED() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DescribeLimitsInput(input): + return DafnyDescribeLimitsInput() + + +def com_amazonaws_dynamodb_DescribeLimitsOutput(input): + return DafnyDescribeLimitsOutput( + AccountMaxReadCapacityUnits=( + Option_Some(input["AccountMaxReadCapacityUnits"]) + if "AccountMaxReadCapacityUnits" in input.keys() + else Option_None() + ), + AccountMaxWriteCapacityUnits=( + Option_Some(input["AccountMaxWriteCapacityUnits"]) + if "AccountMaxWriteCapacityUnits" in input.keys() + else Option_None() + ), + TableMaxReadCapacityUnits=( + Option_Some(input["TableMaxReadCapacityUnits"]) + if "TableMaxReadCapacityUnits" in input.keys() + else Option_None() + ), + TableMaxWriteCapacityUnits=( + Option_Some(input["TableMaxWriteCapacityUnits"]) + if "TableMaxWriteCapacityUnits" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeTableInput(input): + return DafnyDescribeTableInput( + TableName=Seq(input["TableName"]), + ) + + +def com_amazonaws_dynamodb_DescribeTableOutput(input): + return DafnyDescribeTableOutput( + Table=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableDescription( + input["Table"] + ) + ) + if "Table" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput(input): + return DafnyDescribeTableReplicaAutoScalingInput( + TableName=Seq(input["TableName"]), + ) + + +def com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput(input): + return DafnyDescribeTableReplicaAutoScalingOutput( + TableAutoScalingDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableAutoScalingDescription( + input["TableAutoScalingDescription"] + ) + ) + if "TableAutoScalingDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TableAutoScalingDescription(input): + return DafnyTableAutoScalingDescription( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + TableStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableStatus( + input["TableStatus"] + ) + ) + if "TableStatus" in input.keys() + else Option_None() + ), + Replicas=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaAutoScalingDescription( + list_element + ) + for list_element in input["Replicas"] + ] + ) + ) + if "Replicas" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaAutoScalingDescription(input): + return DafnyReplicaAutoScalingDescription( + RegionName=( + Option_Some(Seq(input["RegionName"])) + if "RegionName" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + ReplicaProvisionedReadCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ReplicaProvisionedReadCapacityAutoScalingSettings"] + ) + ) + if "ReplicaProvisionedReadCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ReplicaProvisionedWriteCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ReplicaProvisionedWriteCapacityAutoScalingSettings"] + ) + ) + if "ReplicaProvisionedWriteCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ReplicaStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaStatus( + input["ReplicaStatus"] + ) + ) + if "ReplicaStatus" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription(input): + return DafnyReplicaGlobalSecondaryIndexAutoScalingDescription( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + IndexStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_IndexStatus( + input["IndexStatus"] + ) + ) + if "IndexStatus" in input.keys() + else Option_None() + ), + ProvisionedReadCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ProvisionedReadCapacityAutoScalingSettings"] + ) + ) + if "ProvisionedReadCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ProvisionedWriteCapacityAutoScalingSettings=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input["ProvisionedWriteCapacityAutoScalingSettings"] + ) + ) + if "ProvisionedWriteCapacityAutoScalingSettings" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DescribeTimeToLiveInput(input): + return DafnyDescribeTimeToLiveInput( + TableName=Seq(input["TableName"]), + ) + + +def com_amazonaws_dynamodb_DescribeTimeToLiveOutput(input): + return DafnyDescribeTimeToLiveOutput( + TimeToLiveDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TimeToLiveDescription( + input["TimeToLiveDescription"] + ) + ) + if "TimeToLiveDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput(input): + return DafnyDisableKinesisStreamingDestinationInput( + TableName=Seq(input["TableName"]), + StreamArn=Seq(input["StreamArn"]), + ) + + +def com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput(input): + return DafnyDisableKinesisStreamingDestinationOutput( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + StreamArn=( + Option_Some(Seq(input["StreamArn"])) + if "StreamArn" in input.keys() + else Option_None() + ), + DestinationStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DestinationStatus( + input["DestinationStatus"] + ) + ) + if "DestinationStatus" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput(input): + return DafnyEnableKinesisStreamingDestinationInput( + TableName=Seq(input["TableName"]), + StreamArn=Seq(input["StreamArn"]), + ) + + +def com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput(input): + return DafnyEnableKinesisStreamingDestinationOutput( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + StreamArn=( + Option_Some(Seq(input["StreamArn"])) + if "StreamArn" in input.keys() + else Option_None() + ), + DestinationStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DestinationStatus( + input["DestinationStatus"] + ) + ) + if "DestinationStatus" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExecuteStatementInput(input): + return DafnyExecuteStatementInput( + Statement=Seq(input["Statement"]), + Parameters=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input["Parameters"] + ] + ) + ) + if "Parameters" in input.keys() + else Option_None() + ), + ConsistentRead=( + Option_Some(input["ConsistentRead"]) + if "ConsistentRead" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + Limit=Option_Some(input["Limit"]) if "Limit" in input.keys() else Option_None(), + ) + + +def com_amazonaws_dynamodb_ExecuteStatementOutput(input): + return DafnyExecuteStatementOutput( + Items=( + Option_Some( + Seq( + [ + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items() + } + ) + for list_element in input["Items"] + ] + ) + ) + if "Items" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + input["ConsumedCapacity"] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + LastEvaluatedKey=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["LastEvaluatedKey"].items() + } + ) + ) + if "LastEvaluatedKey" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExecuteTransactionInput(input): + return DafnyExecuteTransactionInput( + TransactStatements=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ParameterizedStatement( + list_element + ) + for list_element in input["TransactStatements"] + ] + ), + ClientRequestToken=( + Option_Some(Seq(input["ClientRequestToken"])) + if "ClientRequestToken" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ParameterizedStatement(input): + return DafnyParameterizedStatement( + Statement=Seq(input["Statement"]), + Parameters=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input["Parameters"] + ] + ) + ) + if "Parameters" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExecuteTransactionOutput(input): + return DafnyExecuteTransactionOutput( + Responses=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemResponse( + list_element + ) + for list_element in input["Responses"] + ] + ) + ) + if "Responses" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input["ConsumedCapacity"] + ] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ItemResponse(input): + return DafnyItemResponse( + Item=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Item"].items() + } + ) + ) + if "Item" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExportTableToPointInTimeInput(input): + return DafnyExportTableToPointInTimeInput( + TableArn=Seq(input["TableArn"]), + ExportTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "ExportTime" in input.keys() + else Option_None() + ), + ClientToken=( + Option_Some(Seq(input["ClientToken"])) + if "ClientToken" in input.keys() + else Option_None() + ), + S3Bucket=Seq(input["S3Bucket"]), + S3BucketOwner=( + Option_Some(Seq(input["S3BucketOwner"])) + if "S3BucketOwner" in input.keys() + else Option_None() + ), + S3Prefix=( + Option_Some(Seq(input["S3Prefix"])) + if "S3Prefix" in input.keys() + else Option_None() + ), + S3SseAlgorithm=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_S3SseAlgorithm( + input["S3SseAlgorithm"] + ) + ) + if "S3SseAlgorithm" in input.keys() + else Option_None() + ), + S3SseKmsKeyId=( + Option_Some(Seq(input["S3SseKmsKeyId"])) + if "S3SseKmsKeyId" in input.keys() + else Option_None() + ), + ExportFormat=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportFormat( + input["ExportFormat"] + ) + ) + if "ExportFormat" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExportTableToPointInTimeOutput(input): + return DafnyExportTableToPointInTimeOutput( + ExportDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportDescription( + input["ExportDescription"] + ) + ) + if "ExportDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GetItemInput(input): + return DafnyGetItemInput( + TableName=Seq(input["TableName"]), + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + AttributesToGet=( + Option_Some( + Seq([Seq(list_element) for list_element in input["AttributesToGet"]]) + ) + if "AttributesToGet" in input.keys() + else Option_None() + ), + ConsistentRead=( + Option_Some(input["ConsistentRead"]) + if "ConsistentRead" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ProjectionExpression=( + Option_Some(Seq(input["ProjectionExpression"])) + if "ProjectionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GetItemOutput(input): + return DafnyGetItemOutput( + Item=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Item"].items() + } + ) + ) + if "Item" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + input["ConsumedCapacity"] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ImportTableInput(input): + return DafnyImportTableInput( + ClientToken=( + Option_Some(Seq(input["ClientToken"])) + if "ClientToken" in input.keys() + else Option_None() + ), + S3BucketSource=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_S3BucketSource( + input["S3BucketSource"] + ), + InputFormat=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InputFormat( + input["InputFormat"] + ), + InputFormatOptions=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InputFormatOptions( + input["InputFormatOptions"] + ) + ) + if "InputFormatOptions" in input.keys() + else Option_None() + ), + InputCompressionType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InputCompressionType( + input["InputCompressionType"] + ) + ) + if "InputCompressionType" in input.keys() + else Option_None() + ), + TableCreationParameters=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableCreationParameters( + input["TableCreationParameters"] + ), + ) + + +def com_amazonaws_dynamodb_ImportTableOutput(input): + return DafnyImportTableOutput( + ImportTableDescription=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportTableDescription( + input["ImportTableDescription"] + ), + ) + + +def com_amazonaws_dynamodb_ListBackupsInput(input): + return DafnyListBackupsInput( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + Limit=Option_Some(input["Limit"]) if "Limit" in input.keys() else Option_None(), + TimeRangeLowerBound=( + Option_Some(TypeError("TimestampShape not supported")) + if "TimeRangeLowerBound" in input.keys() + else Option_None() + ), + TimeRangeUpperBound=( + Option_Some(TypeError("TimestampShape not supported")) + if "TimeRangeUpperBound" in input.keys() + else Option_None() + ), + ExclusiveStartBackupArn=( + Option_Some(Seq(input["ExclusiveStartBackupArn"])) + if "ExclusiveStartBackupArn" in input.keys() + else Option_None() + ), + BackupType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupTypeFilter( + input["BackupType"] + ) + ) + if "BackupType" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BackupTypeFilter(input): + # Convert BackupTypeFilter + if input == "USER": + return BackupTypeFilter_USER() + elif input == "SYSTEM": + return BackupTypeFilter_SYSTEM() + elif input == "AWS_BACKUP": + return BackupTypeFilter_AWS__BACKUP() + elif input == "ALL": + return BackupTypeFilter_ALL() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ListBackupsOutput(input): + return DafnyListBackupsOutput( + BackupSummaries=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupSummary( + list_element + ) + for list_element in input["BackupSummaries"] + ] + ) + ) + if "BackupSummaries" in input.keys() + else Option_None() + ), + LastEvaluatedBackupArn=( + Option_Some(Seq(input["LastEvaluatedBackupArn"])) + if "LastEvaluatedBackupArn" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_BackupSummary(input): + return DafnyBackupSummary( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + TableId=( + Option_Some(Seq(input["TableId"])) + if "TableId" in input.keys() + else Option_None() + ), + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + BackupArn=( + Option_Some(Seq(input["BackupArn"])) + if "BackupArn" in input.keys() + else Option_None() + ), + BackupName=( + Option_Some(Seq(input["BackupName"])) + if "BackupName" in input.keys() + else Option_None() + ), + BackupCreationDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "BackupCreationDateTime" in input.keys() + else Option_None() + ), + BackupExpiryDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "BackupExpiryDateTime" in input.keys() + else Option_None() + ), + BackupStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupStatus( + input["BackupStatus"] + ) + ) + if "BackupStatus" in input.keys() + else Option_None() + ), + BackupType=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupType( + input["BackupType"] + ) + ) + if "BackupType" in input.keys() + else Option_None() + ), + BackupSizeBytes=( + Option_Some(input["BackupSizeBytes"]) + if "BackupSizeBytes" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListContributorInsightsInput(input): + return DafnyListContributorInsightsInput( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + MaxResults=( + Option_Some(input["MaxResults"]) + if "MaxResults" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListContributorInsightsOutput(input): + return DafnyListContributorInsightsOutput( + ContributorInsightsSummaries=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContributorInsightsSummary( + list_element + ) + for list_element in input["ContributorInsightsSummaries"] + ] + ) + ) + if "ContributorInsightsSummaries" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ContributorInsightsSummary(input): + return DafnyContributorInsightsSummary( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ContributorInsightsStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContributorInsightsStatus( + input["ContributorInsightsStatus"] + ) + ) + if "ContributorInsightsStatus" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListExportsInput(input): + return DafnyListExportsInput( + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + MaxResults=( + Option_Some(input["MaxResults"]) + if "MaxResults" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListExportsOutput(input): + return DafnyListExportsOutput( + ExportSummaries=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportSummary( + list_element + ) + for list_element in input["ExportSummaries"] + ] + ) + ) + if "ExportSummaries" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ExportSummary(input): + return DafnyExportSummary( + ExportArn=( + Option_Some(Seq(input["ExportArn"])) + if "ExportArn" in input.keys() + else Option_None() + ), + ExportStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportStatus( + input["ExportStatus"] + ) + ) + if "ExportStatus" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListGlobalTablesInput(input): + return DafnyListGlobalTablesInput( + ExclusiveStartGlobalTableName=( + Option_Some(Seq(input["ExclusiveStartGlobalTableName"])) + if "ExclusiveStartGlobalTableName" in input.keys() + else Option_None() + ), + Limit=Option_Some(input["Limit"]) if "Limit" in input.keys() else Option_None(), + RegionName=( + Option_Some(Seq(input["RegionName"])) + if "RegionName" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListGlobalTablesOutput(input): + return DafnyListGlobalTablesOutput( + GlobalTables=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTable( + list_element + ) + for list_element in input["GlobalTables"] + ] + ) + ) + if "GlobalTables" in input.keys() + else Option_None() + ), + LastEvaluatedGlobalTableName=( + Option_Some(Seq(input["LastEvaluatedGlobalTableName"])) + if "LastEvaluatedGlobalTableName" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GlobalTable(input): + return DafnyGlobalTable( + GlobalTableName=( + Option_Some(Seq(input["GlobalTableName"])) + if "GlobalTableName" in input.keys() + else Option_None() + ), + ReplicationGroup=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Replica( + list_element + ) + for list_element in input["ReplicationGroup"] + ] + ) + ) + if "ReplicationGroup" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListImportsInput(input): + return DafnyListImportsInput( + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + PageSize=( + Option_Some(input["PageSize"]) + if "PageSize" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListImportsOutput(input): + return DafnyListImportsOutput( + ImportSummaryList=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportSummary( + list_element + ) + for list_element in input["ImportSummaryList"] + ] + ) + ) + if "ImportSummaryList" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ImportSummary(input): + return DafnyImportSummary( + ImportArn=( + Option_Some(Seq(input["ImportArn"])) + if "ImportArn" in input.keys() + else Option_None() + ), + ImportStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportStatus( + input["ImportStatus"] + ) + ) + if "ImportStatus" in input.keys() + else Option_None() + ), + TableArn=( + Option_Some(Seq(input["TableArn"])) + if "TableArn" in input.keys() + else Option_None() + ), + S3BucketSource=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_S3BucketSource( + input["S3BucketSource"] + ) + ) + if "S3BucketSource" in input.keys() + else Option_None() + ), + CloudWatchLogGroupArn=( + Option_Some(Seq(input["CloudWatchLogGroupArn"])) + if "CloudWatchLogGroupArn" in input.keys() + else Option_None() + ), + InputFormat=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InputFormat( + input["InputFormat"] + ) + ) + if "InputFormat" in input.keys() + else Option_None() + ), + StartTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "StartTime" in input.keys() + else Option_None() + ), + EndTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "EndTime" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListTablesInput(input): + return DafnyListTablesInput( + ExclusiveStartTableName=( + Option_Some(Seq(input["ExclusiveStartTableName"])) + if "ExclusiveStartTableName" in input.keys() + else Option_None() + ), + Limit=Option_Some(input["Limit"]) if "Limit" in input.keys() else Option_None(), + ) + + +def com_amazonaws_dynamodb_ListTablesOutput(input): + return DafnyListTablesOutput( + TableNames=( + Option_Some( + Seq([Seq(list_element) for list_element in input["TableNames"]]) + ) + if "TableNames" in input.keys() + else Option_None() + ), + LastEvaluatedTableName=( + Option_Some(Seq(input["LastEvaluatedTableName"])) + if "LastEvaluatedTableName" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListTagsOfResourceInput(input): + return DafnyListTagsOfResourceInput( + ResourceArn=Seq(input["ResourceArn"]), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ListTagsOfResourceOutput(input): + return DafnyListTagsOfResourceOutput( + Tags=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Tag( + list_element + ) + for list_element in input["Tags"] + ] + ) + ) + if "Tags" in input.keys() + else Option_None() + ), + NextToken=( + Option_Some(Seq(input["NextToken"])) + if "NextToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_PutItemInput(input): + return DafnyPutItemInput( + TableName=Seq(input["TableName"]), + Item=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Item"].items() + } + ), + Expected=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExpectedAttributeValue( + value + ) + for (key, value) in input["Expected"].items() + } + ) + ) + if "Expected" in input.keys() + else Option_None() + ), + ReturnValues=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnValue( + input["ReturnValues"] + ) + ) + if "ReturnValues" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ReturnItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input["ReturnItemCollectionMetrics"] + ) + ) + if "ReturnItemCollectionMetrics" in input.keys() + else Option_None() + ), + ConditionalOperator=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConditionalOperator( + input["ConditionalOperator"] + ) + ) + if "ConditionalOperator" in input.keys() + else Option_None() + ), + ConditionExpression=( + Option_Some(Seq(input["ConditionExpression"])) + if "ConditionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_PutItemOutput(input): + return DafnyPutItemOutput( + Attributes=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Attributes"].items() + } + ) + ) + if "Attributes" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + input["ConsumedCapacity"] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemCollectionMetrics( + input["ItemCollectionMetrics"] + ) + ) + if "ItemCollectionMetrics" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_QueryInput(input): + return DafnyQueryInput( + TableName=Seq(input["TableName"]), + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + Select=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Select( + input["Select"] + ) + ) + if "Select" in input.keys() + else Option_None() + ), + AttributesToGet=( + Option_Some( + Seq([Seq(list_element) for list_element in input["AttributesToGet"]]) + ) + if "AttributesToGet" in input.keys() + else Option_None() + ), + Limit=Option_Some(input["Limit"]) if "Limit" in input.keys() else Option_None(), + ConsistentRead=( + Option_Some(input["ConsistentRead"]) + if "ConsistentRead" in input.keys() + else Option_None() + ), + KeyConditions=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Condition( + value + ) + for (key, value) in input["KeyConditions"].items() + } + ) + ) + if "KeyConditions" in input.keys() + else Option_None() + ), + QueryFilter=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Condition( + value + ) + for (key, value) in input["QueryFilter"].items() + } + ) + ) + if "QueryFilter" in input.keys() + else Option_None() + ), + ConditionalOperator=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConditionalOperator( + input["ConditionalOperator"] + ) + ) + if "ConditionalOperator" in input.keys() + else Option_None() + ), + ScanIndexForward=( + Option_Some(input["ScanIndexForward"]) + if "ScanIndexForward" in input.keys() + else Option_None() + ), + ExclusiveStartKey=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExclusiveStartKey"].items() + } + ) + ) + if "ExclusiveStartKey" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ProjectionExpression=( + Option_Some(Seq(input["ProjectionExpression"])) + if "ProjectionExpression" in input.keys() + else Option_None() + ), + FilterExpression=( + Option_Some(Seq(input["FilterExpression"])) + if "FilterExpression" in input.keys() + else Option_None() + ), + KeyConditionExpression=( + Option_Some(Seq(input["KeyConditionExpression"])) + if "KeyConditionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_Select(input): + # Convert Select + if input == "ALL_ATTRIBUTES": + return Select_ALL__ATTRIBUTES() + elif input == "ALL_PROJECTED_ATTRIBUTES": + return Select_ALL__PROJECTED__ATTRIBUTES() + elif input == "SPECIFIC_ATTRIBUTES": + return Select_SPECIFIC__ATTRIBUTES() + elif input == "COUNT": + return Select_COUNT() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_Condition(input): + return DafnyCondition( + AttributeValueList=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input["AttributeValueList"] + ] + ) + ) + if "AttributeValueList" in input.keys() + else Option_None() + ), + ComparisonOperator=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ComparisonOperator( + input["ComparisonOperator"] + ), + ) + + +def com_amazonaws_dynamodb_QueryOutput(input): + return DafnyQueryOutput( + Items=( + Option_Some( + Seq( + [ + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items() + } + ) + for list_element in input["Items"] + ] + ) + ) + if "Items" in input.keys() + else Option_None() + ), + Count=Option_Some(input["Count"]) if "Count" in input.keys() else Option_None(), + ScannedCount=( + Option_Some(input["ScannedCount"]) + if "ScannedCount" in input.keys() + else Option_None() + ), + LastEvaluatedKey=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["LastEvaluatedKey"].items() + } + ) + ) + if "LastEvaluatedKey" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + input["ConsumedCapacity"] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_RestoreTableFromBackupInput(input): + return DafnyRestoreTableFromBackupInput( + TargetTableName=Seq(input["TargetTableName"]), + BackupArn=Seq(input["BackupArn"]), + BillingModeOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["BillingModeOverride"] + ) + ) + if "BillingModeOverride" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexOverride=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input["GlobalSecondaryIndexOverride"] + ] + ) + ) + if "GlobalSecondaryIndexOverride" in input.keys() + else Option_None() + ), + LocalSecondaryIndexOverride=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_LocalSecondaryIndex( + list_element + ) + for list_element in input["LocalSecondaryIndexOverride"] + ] + ) + ) + if "LocalSecondaryIndexOverride" in input.keys() + else Option_None() + ), + ProvisionedThroughputOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughputOverride"] + ) + ) + if "ProvisionedThroughputOverride" in input.keys() + else Option_None() + ), + SSESpecificationOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSESpecification( + input["SSESpecificationOverride"] + ) + ) + if "SSESpecificationOverride" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_RestoreTableFromBackupOutput(input): + return DafnyRestoreTableFromBackupOutput( + TableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableDescription( + input["TableDescription"] + ) + ) + if "TableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_RestoreTableToPointInTimeInput(input): + return DafnyRestoreTableToPointInTimeInput( + SourceTableArn=( + Option_Some(Seq(input["SourceTableArn"])) + if "SourceTableArn" in input.keys() + else Option_None() + ), + SourceTableName=( + Option_Some(Seq(input["SourceTableName"])) + if "SourceTableName" in input.keys() + else Option_None() + ), + TargetTableName=Seq(input["TargetTableName"]), + UseLatestRestorableTime=( + Option_Some(input["UseLatestRestorableTime"]) + if "UseLatestRestorableTime" in input.keys() + else Option_None() + ), + RestoreDateTime=( + Option_Some(TypeError("TimestampShape not supported")) + if "RestoreDateTime" in input.keys() + else Option_None() + ), + BillingModeOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["BillingModeOverride"] + ) + ) + if "BillingModeOverride" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexOverride=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input["GlobalSecondaryIndexOverride"] + ] + ) + ) + if "GlobalSecondaryIndexOverride" in input.keys() + else Option_None() + ), + LocalSecondaryIndexOverride=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_LocalSecondaryIndex( + list_element + ) + for list_element in input["LocalSecondaryIndexOverride"] + ] + ) + ) + if "LocalSecondaryIndexOverride" in input.keys() + else Option_None() + ), + ProvisionedThroughputOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughputOverride"] + ) + ) + if "ProvisionedThroughputOverride" in input.keys() + else Option_None() + ), + SSESpecificationOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSESpecification( + input["SSESpecificationOverride"] + ) + ) + if "SSESpecificationOverride" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput(input): + return DafnyRestoreTableToPointInTimeOutput( + TableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableDescription( + input["TableDescription"] + ) + ) + if "TableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ScanInput(input): + return DafnyScanInput( + TableName=Seq(input["TableName"]), + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + AttributesToGet=( + Option_Some( + Seq([Seq(list_element) for list_element in input["AttributesToGet"]]) + ) + if "AttributesToGet" in input.keys() + else Option_None() + ), + Limit=Option_Some(input["Limit"]) if "Limit" in input.keys() else Option_None(), + Select=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Select( + input["Select"] + ) + ) + if "Select" in input.keys() + else Option_None() + ), + ScanFilter=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Condition( + value + ) + for (key, value) in input["ScanFilter"].items() + } + ) + ) + if "ScanFilter" in input.keys() + else Option_None() + ), + ConditionalOperator=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConditionalOperator( + input["ConditionalOperator"] + ) + ) + if "ConditionalOperator" in input.keys() + else Option_None() + ), + ExclusiveStartKey=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExclusiveStartKey"].items() + } + ) + ) + if "ExclusiveStartKey" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + TotalSegments=( + Option_Some(input["TotalSegments"]) + if "TotalSegments" in input.keys() + else Option_None() + ), + Segment=( + Option_Some(input["Segment"]) + if "Segment" in input.keys() + else Option_None() + ), + ProjectionExpression=( + Option_Some(Seq(input["ProjectionExpression"])) + if "ProjectionExpression" in input.keys() + else Option_None() + ), + FilterExpression=( + Option_Some(Seq(input["FilterExpression"])) + if "FilterExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ConsistentRead=( + Option_Some(input["ConsistentRead"]) + if "ConsistentRead" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ScanOutput(input): + return DafnyScanOutput( + Items=( + Option_Some( + Seq( + [ + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items() + } + ) + for list_element in input["Items"] + ] + ) + ) + if "Items" in input.keys() + else Option_None() + ), + Count=Option_Some(input["Count"]) if "Count" in input.keys() else Option_None(), + ScannedCount=( + Option_Some(input["ScannedCount"]) + if "ScannedCount" in input.keys() + else Option_None() + ), + LastEvaluatedKey=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["LastEvaluatedKey"].items() + } + ) + ) + if "LastEvaluatedKey" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + input["ConsumedCapacity"] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TagResourceInput(input): + return DafnyTagResourceInput( + ResourceArn=Seq(input["ResourceArn"]), + Tags=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Tag( + list_element + ) + for list_element in input["Tags"] + ] + ), + ) + + +def com_amazonaws_dynamodb_TransactGetItemsInput(input): + return DafnyTransactGetItemsInput( + TransactItems=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TransactGetItem( + list_element + ) + for list_element in input["TransactItems"] + ] + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TransactGetItem(input): + return DafnyTransactGetItem( + Get=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Get( + input["Get"] + ), + ) + + +def com_amazonaws_dynamodb_Get(input): + return DafnyGet( + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + TableName=Seq(input["TableName"]), + ProjectionExpression=( + Option_Some(Seq(input["ProjectionExpression"])) + if "ProjectionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TransactGetItemsOutput(input): + return DafnyTransactGetItemsOutput( + ConsumedCapacity=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input["ConsumedCapacity"] + ] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + Responses=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemResponse( + list_element + ) + for list_element in input["Responses"] + ] + ) + ) + if "Responses" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TransactWriteItemsInput(input): + return DafnyTransactWriteItemsInput( + TransactItems=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TransactWriteItem( + list_element + ) + for list_element in input["TransactItems"] + ] + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ReturnItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input["ReturnItemCollectionMetrics"] + ) + ) + if "ReturnItemCollectionMetrics" in input.keys() + else Option_None() + ), + ClientRequestToken=( + Option_Some(Seq(input["ClientRequestToken"])) + if "ClientRequestToken" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_TransactWriteItem(input): + return DafnyTransactWriteItem( + ConditionCheck=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConditionCheck( + input["ConditionCheck"] + ) + ) + if "ConditionCheck" in input.keys() + else Option_None() + ), + Put=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Put( + input["Put"] + ) + ) + if "Put" in input.keys() + else Option_None() + ), + Delete=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Delete( + input["Delete"] + ) + ) + if "Delete" in input.keys() + else Option_None() + ), + Update=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Update( + input["Update"] + ) + ) + if "Update" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ConditionCheck(input): + return DafnyConditionCheck( + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + TableName=Seq(input["TableName"]), + ConditionExpression=Seq(input["ConditionExpression"]), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ReturnValuesOnConditionCheckFailure=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input["ReturnValuesOnConditionCheckFailure"] + ) + ) + if "ReturnValuesOnConditionCheckFailure" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_Put(input): + return DafnyPut( + Item=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Item"].items() + } + ), + TableName=Seq(input["TableName"]), + ConditionExpression=( + Option_Some(Seq(input["ConditionExpression"])) + if "ConditionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ReturnValuesOnConditionCheckFailure=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input["ReturnValuesOnConditionCheckFailure"] + ) + ) + if "ReturnValuesOnConditionCheckFailure" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_Delete(input): + return DafnyDelete( + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + TableName=Seq(input["TableName"]), + ConditionExpression=( + Option_Some(Seq(input["ConditionExpression"])) + if "ConditionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ReturnValuesOnConditionCheckFailure=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input["ReturnValuesOnConditionCheckFailure"] + ) + ) + if "ReturnValuesOnConditionCheckFailure" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_Update(input): + return DafnyUpdate( + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + UpdateExpression=Seq(input["UpdateExpression"]), + TableName=Seq(input["TableName"]), + ConditionExpression=( + Option_Some(Seq(input["ConditionExpression"])) + if "ConditionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ReturnValuesOnConditionCheckFailure=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input["ReturnValuesOnConditionCheckFailure"] + ) + ) + if "ReturnValuesOnConditionCheckFailure" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure(input): + # Convert ReturnValuesOnConditionCheckFailure + if input == "ALL_OLD": + return ReturnValuesOnConditionCheckFailure_ALL__OLD() + elif input == "NONE": + return ReturnValuesOnConditionCheckFailure_NONE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_TransactWriteItemsOutput(input): + return DafnyTransactWriteItemsOutput( + ConsumedCapacity=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input["ConsumedCapacity"] + ] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ItemCollectionMetrics=( + Option_Some( + Map( + { + Seq(key): Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemCollectionMetrics( + list_element + ) + for list_element in value + ] + ) + for (key, value) in input["ItemCollectionMetrics"].items() + } + ) + ) + if "ItemCollectionMetrics" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UntagResourceInput(input): + return DafnyUntagResourceInput( + ResourceArn=Seq(input["ResourceArn"]), + TagKeys=Seq([Seq(list_element) for list_element in input["TagKeys"]]), + ) + + +def com_amazonaws_dynamodb_UpdateContinuousBackupsInput(input): + return DafnyUpdateContinuousBackupsInput( + TableName=Seq(input["TableName"]), + PointInTimeRecoverySpecification=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_PointInTimeRecoverySpecification( + input["PointInTimeRecoverySpecification"] + ), + ) + + +def com_amazonaws_dynamodb_PointInTimeRecoverySpecification(input): + return DafnyPointInTimeRecoverySpecification( + PointInTimeRecoveryEnabled=input["PointInTimeRecoveryEnabled"], + ) + + +def com_amazonaws_dynamodb_UpdateContinuousBackupsOutput(input): + return DafnyUpdateContinuousBackupsOutput( + ContinuousBackupsDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContinuousBackupsDescription( + input["ContinuousBackupsDescription"] + ) + ) + if "ContinuousBackupsDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateContributorInsightsInput(input): + return DafnyUpdateContributorInsightsInput( + TableName=Seq(input["TableName"]), + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ContributorInsightsAction=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContributorInsightsAction( + input["ContributorInsightsAction"] + ), + ) + + +def com_amazonaws_dynamodb_ContributorInsightsAction(input): + # Convert ContributorInsightsAction + if input == "ENABLE": + return ContributorInsightsAction_ENABLE() + elif input == "DISABLE": + return ContributorInsightsAction_DISABLE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_UpdateContributorInsightsOutput(input): + return DafnyUpdateContributorInsightsOutput( + TableName=( + Option_Some(Seq(input["TableName"])) + if "TableName" in input.keys() + else Option_None() + ), + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ContributorInsightsStatus=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContributorInsightsStatus( + input["ContributorInsightsStatus"] + ) + ) + if "ContributorInsightsStatus" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateGlobalTableInput(input): + return DafnyUpdateGlobalTableInput( + GlobalTableName=Seq(input["GlobalTableName"]), + ReplicaUpdates=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaUpdate( + list_element + ) + for list_element in input["ReplicaUpdates"] + ] + ), + ) + + +def com_amazonaws_dynamodb_ReplicaUpdate(input): + return DafnyReplicaUpdate( + Create=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CreateReplicaAction( + input["Create"] + ) + ) + if "Create" in input.keys() + else Option_None() + ), + Delete=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DeleteReplicaAction( + input["Delete"] + ) + ) + if "Delete" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_CreateReplicaAction(input): + return DafnyCreateReplicaAction( + RegionName=Seq(input["RegionName"]), + ) + + +def com_amazonaws_dynamodb_DeleteReplicaAction(input): + return DafnyDeleteReplicaAction( + RegionName=Seq(input["RegionName"]), + ) + + +def com_amazonaws_dynamodb_UpdateGlobalTableOutput(input): + return DafnyUpdateGlobalTableOutput( + GlobalTableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTableDescription( + input["GlobalTableDescription"] + ) + ) + if "GlobalTableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput(input): + return DafnyUpdateGlobalTableSettingsInput( + GlobalTableName=Seq(input["GlobalTableName"]), + GlobalTableBillingMode=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["GlobalTableBillingMode"] + ) + ) + if "GlobalTableBillingMode" in input.keys() + else Option_None() + ), + GlobalTableProvisionedWriteCapacityUnits=( + Option_Some(input["GlobalTableProvisionedWriteCapacityUnits"]) + if "GlobalTableProvisionedWriteCapacityUnits" in input.keys() + else Option_None() + ), + GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input[ + "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate" + ] + ) + ) + if "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate" + in input.keys() + else Option_None() + ), + GlobalTableGlobalSecondaryIndexSettingsUpdate=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate( + list_element + ) + for list_element in input[ + "GlobalTableGlobalSecondaryIndexSettingsUpdate" + ] + ] + ) + ) + if "GlobalTableGlobalSecondaryIndexSettingsUpdate" in input.keys() + else Option_None() + ), + ReplicaSettingsUpdate=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaSettingsUpdate( + list_element + ) + for list_element in input["ReplicaSettingsUpdate"] + ] + ) + ) + if "ReplicaSettingsUpdate" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AutoScalingSettingsUpdate(input): + return DafnyAutoScalingSettingsUpdate( + MinimumUnits=( + Option_Some(input["MinimumUnits"]) + if "MinimumUnits" in input.keys() + else Option_None() + ), + MaximumUnits=( + Option_Some(input["MaximumUnits"]) + if "MaximumUnits" in input.keys() + else Option_None() + ), + AutoScalingDisabled=( + Option_Some(input["AutoScalingDisabled"]) + if "AutoScalingDisabled" in input.keys() + else Option_None() + ), + AutoScalingRoleArn=( + Option_Some(Seq(input["AutoScalingRoleArn"])) + if "AutoScalingRoleArn" in input.keys() + else Option_None() + ), + ScalingPolicyUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingPolicyUpdate( + input["ScalingPolicyUpdate"] + ) + ) + if "ScalingPolicyUpdate" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AutoScalingPolicyUpdate(input): + return DafnyAutoScalingPolicyUpdate( + PolicyName=( + Option_Some(Seq(input["PolicyName"])) + if "PolicyName" in input.keys() + else Option_None() + ), + TargetTrackingScalingPolicyConfiguration=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( + input["TargetTrackingScalingPolicyConfiguration"] + ), + ) + + +def com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( + input, +): + return DafnyAutoScalingTargetTrackingScalingPolicyConfigurationUpdate( + DisableScaleIn=( + Option_Some(input["DisableScaleIn"]) + if "DisableScaleIn" in input.keys() + else Option_None() + ), + ScaleInCooldown=( + Option_Some(input["ScaleInCooldown"]) + if "ScaleInCooldown" in input.keys() + else Option_None() + ), + ScaleOutCooldown=( + Option_Some(input["ScaleOutCooldown"]) + if "ScaleOutCooldown" in input.keys() + else Option_None() + ), + TargetValue=input["TargetValue"], + ) + + +def com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate(input): + return DafnyGlobalTableGlobalSecondaryIndexSettingsUpdate( + IndexName=Seq(input["IndexName"]), + ProvisionedWriteCapacityUnits=( + Option_Some(input["ProvisionedWriteCapacityUnits"]) + if "ProvisionedWriteCapacityUnits" in input.keys() + else Option_None() + ), + ProvisionedWriteCapacityAutoScalingSettingsUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input["ProvisionedWriteCapacityAutoScalingSettingsUpdate"] + ) + ) + if "ProvisionedWriteCapacityAutoScalingSettingsUpdate" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaSettingsUpdate(input): + return DafnyReplicaSettingsUpdate( + RegionName=Seq(input["RegionName"]), + ReplicaProvisionedReadCapacityUnits=( + Option_Some(input["ReplicaProvisionedReadCapacityUnits"]) + if "ReplicaProvisionedReadCapacityUnits" in input.keys() + else Option_None() + ), + ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input["ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate"] + ) + ) + if "ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate" in input.keys() + else Option_None() + ), + ReplicaGlobalSecondaryIndexSettingsUpdate=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate( + list_element + ) + for list_element in input[ + "ReplicaGlobalSecondaryIndexSettingsUpdate" + ] + ] + ) + ) + if "ReplicaGlobalSecondaryIndexSettingsUpdate" in input.keys() + else Option_None() + ), + ReplicaTableClass=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClass( + input["ReplicaTableClass"] + ) + ) + if "ReplicaTableClass" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate(input): + return DafnyReplicaGlobalSecondaryIndexSettingsUpdate( + IndexName=Seq(input["IndexName"]), + ProvisionedReadCapacityUnits=( + Option_Some(input["ProvisionedReadCapacityUnits"]) + if "ProvisionedReadCapacityUnits" in input.keys() + else Option_None() + ), + ProvisionedReadCapacityAutoScalingSettingsUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input["ProvisionedReadCapacityAutoScalingSettingsUpdate"] + ) + ) + if "ProvisionedReadCapacityAutoScalingSettingsUpdate" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput(input): + return DafnyUpdateGlobalTableSettingsOutput( + GlobalTableName=( + Option_Some(Seq(input["GlobalTableName"])) + if "GlobalTableName" in input.keys() + else Option_None() + ), + ReplicaSettings=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaSettingsDescription( + list_element + ) + for list_element in input["ReplicaSettings"] + ] + ) + ) + if "ReplicaSettings" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateItemInput(input): + return DafnyUpdateItemInput( + TableName=Seq(input["TableName"]), + Key=Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Key"].items() + } + ), + AttributeUpdates=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValueUpdate( + value + ) + for (key, value) in input["AttributeUpdates"].items() + } + ) + ) + if "AttributeUpdates" in input.keys() + else Option_None() + ), + Expected=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExpectedAttributeValue( + value + ) + for (key, value) in input["Expected"].items() + } + ) + ) + if "Expected" in input.keys() + else Option_None() + ), + ConditionalOperator=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConditionalOperator( + input["ConditionalOperator"] + ) + ) + if "ConditionalOperator" in input.keys() + else Option_None() + ), + ReturnValues=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnValue( + input["ReturnValues"] + ) + ) + if "ReturnValues" in input.keys() + else Option_None() + ), + ReturnConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input["ReturnConsumedCapacity"] + ) + ) + if "ReturnConsumedCapacity" in input.keys() + else Option_None() + ), + ReturnItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input["ReturnItemCollectionMetrics"] + ) + ) + if "ReturnItemCollectionMetrics" in input.keys() + else Option_None() + ), + UpdateExpression=( + Option_Some(Seq(input["UpdateExpression"])) + if "UpdateExpression" in input.keys() + else Option_None() + ), + ConditionExpression=( + Option_Some(Seq(input["ConditionExpression"])) + if "ConditionExpression" in input.keys() + else Option_None() + ), + ExpressionAttributeNames=( + Option_Some( + Map( + { + Seq(key): Seq(value) + for (key, value) in input["ExpressionAttributeNames"].items() + } + ) + ) + if "ExpressionAttributeNames" in input.keys() + else Option_None() + ), + ExpressionAttributeValues=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["ExpressionAttributeValues"].items() + } + ) + ) + if "ExpressionAttributeValues" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AttributeValueUpdate(input): + return DafnyAttributeValueUpdate( + Value=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + input["Value"] + ) + ) + if "Value" in input.keys() + else Option_None() + ), + Action=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeAction( + input["Action"] + ) + ) + if "Action" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_AttributeAction(input): + # Convert AttributeAction + if input == "ADD": + return AttributeAction_ADD() + elif input == "PUT": + return AttributeAction_PUT() + elif input == "DELETE": + return AttributeAction_DELETE() + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_UpdateItemOutput(input): + return DafnyUpdateItemOutput( + Attributes=( + Option_Some( + Map( + { + Seq( + key + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input["Attributes"].items() + } + ) + ) + if "Attributes" in input.keys() + else Option_None() + ), + ConsumedCapacity=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConsumedCapacity( + input["ConsumedCapacity"] + ) + ) + if "ConsumedCapacity" in input.keys() + else Option_None() + ), + ItemCollectionMetrics=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemCollectionMetrics( + input["ItemCollectionMetrics"] + ) + ) + if "ItemCollectionMetrics" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateTableInput(input): + return DafnyUpdateTableInput( + AttributeDefinitions=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input["AttributeDefinitions"] + ] + ) + ) + if "AttributeDefinitions" in input.keys() + else Option_None() + ), + TableName=Seq(input["TableName"]), + BillingMode=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BillingMode( + input["BillingMode"] + ) + ) + if "BillingMode" in input.keys() + else Option_None() + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexUpdates=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate( + list_element + ) + for list_element in input["GlobalSecondaryIndexUpdates"] + ] + ) + ) + if "GlobalSecondaryIndexUpdates" in input.keys() + else Option_None() + ), + StreamSpecification=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_StreamSpecification( + input["StreamSpecification"] + ) + ) + if "StreamSpecification" in input.keys() + else Option_None() + ), + SSESpecification=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_SSESpecification( + input["SSESpecification"] + ) + ) + if "SSESpecification" in input.keys() + else Option_None() + ), + ReplicaUpdates=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicationGroupUpdate( + list_element + ) + for list_element in input["ReplicaUpdates"] + ] + ) + ) + if "ReplicaUpdates" in input.keys() + else Option_None() + ), + TableClass=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClass( + input["TableClass"] + ) + ) + if "TableClass" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate(input): + return DafnyGlobalSecondaryIndexUpdate( + Update=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction( + input["Update"] + ) + ) + if "Update" in input.keys() + else Option_None() + ), + Create=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction( + input["Create"] + ) + ) + if "Create" in input.keys() + else Option_None() + ), + Delete=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction( + input["Delete"] + ) + ) + if "Delete" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction(input): + return DafnyUpdateGlobalSecondaryIndexAction( + IndexName=Seq(input["IndexName"]), + ProvisionedThroughput=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ), + ) + + +def com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction(input): + return DafnyCreateGlobalSecondaryIndexAction( + IndexName=Seq(input["IndexName"]), + KeySchema=Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input["KeySchema"] + ] + ), + Projection=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_Projection( + input["Projection"] + ), + ProvisionedThroughput=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughput( + input["ProvisionedThroughput"] + ) + ) + if "ProvisionedThroughput" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction(input): + return DafnyDeleteGlobalSecondaryIndexAction( + IndexName=Seq(input["IndexName"]), + ) + + +def com_amazonaws_dynamodb_ReplicationGroupUpdate(input): + return DafnyReplicationGroupUpdate( + Create=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CreateReplicationGroupMemberAction( + input["Create"] + ) + ) + if "Create" in input.keys() + else Option_None() + ), + Update=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction( + input["Update"] + ) + ) + if "Update" in input.keys() + else Option_None() + ), + Delete=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction( + input["Delete"] + ) + ) + if "Delete" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_CreateReplicationGroupMemberAction(input): + return DafnyCreateReplicationGroupMemberAction( + RegionName=Seq(input["RegionName"]), + KMSMasterKeyId=( + Option_Some(Seq(input["KMSMasterKeyId"])) + if "KMSMasterKeyId" in input.keys() + else Option_None() + ), + ProvisionedThroughputOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input["ProvisionedThroughputOverride"] + ) + ) + if "ProvisionedThroughputOverride" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + TableClassOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClass( + input["TableClassOverride"] + ) + ) + if "TableClassOverride" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction(input): + return DafnyUpdateReplicationGroupMemberAction( + RegionName=Seq(input["RegionName"]), + KMSMasterKeyId=( + Option_Some(Seq(input["KMSMasterKeyId"])) + if "KMSMasterKeyId" in input.keys() + else Option_None() + ), + ProvisionedThroughputOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input["ProvisionedThroughputOverride"] + ) + ) + if "ProvisionedThroughputOverride" in input.keys() + else Option_None() + ), + GlobalSecondaryIndexes=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex( + list_element + ) + for list_element in input["GlobalSecondaryIndexes"] + ] + ) + ) + if "GlobalSecondaryIndexes" in input.keys() + else Option_None() + ), + TableClassOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableClass( + input["TableClassOverride"] + ) + ) + if "TableClassOverride" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction(input): + return DafnyDeleteReplicationGroupMemberAction( + RegionName=Seq(input["RegionName"]), + ) + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex(input): + return DafnyReplicaGlobalSecondaryIndex( + IndexName=Seq(input["IndexName"]), + ProvisionedThroughputOverride=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input["ProvisionedThroughputOverride"] + ) + ) + if "ProvisionedThroughputOverride" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateTableOutput(input): + return DafnyUpdateTableOutput( + TableDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableDescription( + input["TableDescription"] + ) + ) + if "TableDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput(input): + return DafnyUpdateTableReplicaAutoScalingInput( + GlobalSecondaryIndexUpdates=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate( + list_element + ) + for list_element in input["GlobalSecondaryIndexUpdates"] + ] + ) + ) + if "GlobalSecondaryIndexUpdates" in input.keys() + else Option_None() + ), + TableName=Seq(input["TableName"]), + ProvisionedWriteCapacityAutoScalingUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input["ProvisionedWriteCapacityAutoScalingUpdate"] + ) + ) + if "ProvisionedWriteCapacityAutoScalingUpdate" in input.keys() + else Option_None() + ), + ReplicaUpdates=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaAutoScalingUpdate( + list_element + ) + for list_element in input["ReplicaUpdates"] + ] + ) + ) + if "ReplicaUpdates" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate(input): + return DafnyGlobalSecondaryIndexAutoScalingUpdate( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ProvisionedWriteCapacityAutoScalingUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input["ProvisionedWriteCapacityAutoScalingUpdate"] + ) + ) + if "ProvisionedWriteCapacityAutoScalingUpdate" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaAutoScalingUpdate(input): + return DafnyReplicaAutoScalingUpdate( + RegionName=Seq(input["RegionName"]), + ReplicaGlobalSecondaryIndexUpdates=( + Option_Some( + Seq( + [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate( + list_element + ) + for list_element in input["ReplicaGlobalSecondaryIndexUpdates"] + ] + ) + ) + if "ReplicaGlobalSecondaryIndexUpdates" in input.keys() + else Option_None() + ), + ReplicaProvisionedReadCapacityAutoScalingUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input["ReplicaProvisionedReadCapacityAutoScalingUpdate"] + ) + ) + if "ReplicaProvisionedReadCapacityAutoScalingUpdate" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate(input): + return DafnyReplicaGlobalSecondaryIndexAutoScalingUpdate( + IndexName=( + Option_Some(Seq(input["IndexName"])) + if "IndexName" in input.keys() + else Option_None() + ), + ProvisionedReadCapacityAutoScalingUpdate=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input["ProvisionedReadCapacityAutoScalingUpdate"] + ) + ) + if "ProvisionedReadCapacityAutoScalingUpdate" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput(input): + return DafnyUpdateTableReplicaAutoScalingOutput( + TableAutoScalingDescription=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableAutoScalingDescription( + input["TableAutoScalingDescription"] + ) + ) + if "TableAutoScalingDescription" in input.keys() + else Option_None() + ), + ) + + +def com_amazonaws_dynamodb_UpdateTimeToLiveInput(input): + return DafnyUpdateTimeToLiveInput( + TableName=Seq(input["TableName"]), + TimeToLiveSpecification=com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TimeToLiveSpecification( + input["TimeToLiveSpecification"] + ), + ) + + +def com_amazonaws_dynamodb_TimeToLiveSpecification(input): + return DafnyTimeToLiveSpecification( + Enabled=input["Enabled"], + AttributeName=Seq(input["AttributeName"]), + ) + + +def com_amazonaws_dynamodb_UpdateTimeToLiveOutput(input): + return DafnyUpdateTimeToLiveOutput( + TimeToLiveSpecification=( + Option_Some( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TimeToLiveSpecification( + input["TimeToLiveSpecification"] + ) + ) + if "TimeToLiveSpecification" in input.keys() + else Option_None() + ), + ) diff --git a/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/dafny_to_aws_sdk.py b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/dafny_to_aws_sdk.py new file mode 100644 index 000000000..676045f62 --- /dev/null +++ b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/dafny_to_aws_sdk.py @@ -0,0 +1,5770 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +import com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk +import module_ +from software_amazon_cryptography_services_dynamodb_internaldafny_types import ( + AttributeAction_ADD, + AttributeAction_DELETE, + AttributeAction_PUT, + AttributeValue_B, + AttributeValue_BOOL, + AttributeValue_BS, + AttributeValue_L, + AttributeValue_M, + AttributeValue_N, + AttributeValue_NS, + AttributeValue_NULL, + AttributeValue_S, + AttributeValue_SS, + BackupStatus_AVAILABLE, + BackupStatus_CREATING, + BackupStatus_DELETED, + BackupTypeFilter_ALL, + BackupTypeFilter_AWS__BACKUP, + BackupTypeFilter_SYSTEM, + BackupTypeFilter_USER, + BackupType_AWS__BACKUP, + BackupType_SYSTEM, + BackupType_USER, + BatchStatementErrorCodeEnum_AccessDenied, + BatchStatementErrorCodeEnum_ConditionalCheckFailed, + BatchStatementErrorCodeEnum_DuplicateItem, + BatchStatementErrorCodeEnum_InternalServerError, + BatchStatementErrorCodeEnum_ItemCollectionSizeLimitExceeded, + BatchStatementErrorCodeEnum_ProvisionedThroughputExceeded, + BatchStatementErrorCodeEnum_RequestLimitExceeded, + BatchStatementErrorCodeEnum_ResourceNotFound, + BatchStatementErrorCodeEnum_ThrottlingError, + BatchStatementErrorCodeEnum_TransactionConflict, + BatchStatementErrorCodeEnum_ValidationError, + BillingMode_PAY__PER__REQUEST, + BillingMode_PROVISIONED, + ComparisonOperator_BEGINS__WITH, + ComparisonOperator_BETWEEN, + ComparisonOperator_CONTAINS, + ComparisonOperator_EQ, + ComparisonOperator_GE, + ComparisonOperator_GT, + ComparisonOperator_IN, + ComparisonOperator_LE, + ComparisonOperator_LT, + ComparisonOperator_NE, + ComparisonOperator_NOT__CONTAINS, + ComparisonOperator_NOT__NULL, + ComparisonOperator_NULL, + ConditionalOperator_AND, + ConditionalOperator_OR, + ContinuousBackupsStatus_DISABLED, + ContinuousBackupsStatus_ENABLED, + ContributorInsightsAction_DISABLE, + ContributorInsightsAction_ENABLE, + ContributorInsightsStatus_DISABLED, + ContributorInsightsStatus_DISABLING, + ContributorInsightsStatus_ENABLED, + ContributorInsightsStatus_ENABLING, + ContributorInsightsStatus_FAILED, + DestinationStatus_ACTIVE, + DestinationStatus_DISABLED, + DestinationStatus_DISABLING, + DestinationStatus_ENABLE__FAILED, + DestinationStatus_ENABLING, + ExportFormat_DYNAMODB__JSON, + ExportFormat_ION, + ExportStatus_COMPLETED, + ExportStatus_FAILED, + ExportStatus_IN__PROGRESS, + GlobalTableStatus_ACTIVE, + GlobalTableStatus_CREATING, + GlobalTableStatus_DELETING, + GlobalTableStatus_UPDATING, + ImportStatus_CANCELLED, + ImportStatus_CANCELLING, + ImportStatus_COMPLETED, + ImportStatus_FAILED, + ImportStatus_IN__PROGRESS, + IndexStatus_ACTIVE, + IndexStatus_CREATING, + IndexStatus_DELETING, + IndexStatus_UPDATING, + InputCompressionType_GZIP, + InputCompressionType_NONE, + InputCompressionType_ZSTD, + InputFormat_CSV, + InputFormat_DYNAMODB__JSON, + InputFormat_ION, + KeyType_HASH, + KeyType_RANGE, + PointInTimeRecoveryStatus_DISABLED, + PointInTimeRecoveryStatus_ENABLED, + ProjectionType_ALL, + ProjectionType_INCLUDE, + ProjectionType_KEYS__ONLY, + ReplicaStatus_ACTIVE, + ReplicaStatus_CREATING, + ReplicaStatus_CREATION__FAILED, + ReplicaStatus_DELETING, + ReplicaStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS, + ReplicaStatus_REGION__DISABLED, + ReplicaStatus_UPDATING, + ReturnConsumedCapacity_INDEXES, + ReturnConsumedCapacity_NONE, + ReturnConsumedCapacity_TOTAL, + ReturnItemCollectionMetrics_NONE, + ReturnItemCollectionMetrics_SIZE, + ReturnValue_ALL__NEW, + ReturnValue_ALL__OLD, + ReturnValue_NONE, + ReturnValue_UPDATED__NEW, + ReturnValue_UPDATED__OLD, + ReturnValuesOnConditionCheckFailure_ALL__OLD, + ReturnValuesOnConditionCheckFailure_NONE, + S3SseAlgorithm_AES256, + S3SseAlgorithm_KMS, + SSEStatus_DISABLED, + SSEStatus_DISABLING, + SSEStatus_ENABLED, + SSEStatus_ENABLING, + SSEStatus_UPDATING, + SSEType_AES256, + SSEType_KMS, + ScalarAttributeType_B, + ScalarAttributeType_N, + ScalarAttributeType_S, + Select_ALL__ATTRIBUTES, + Select_ALL__PROJECTED__ATTRIBUTES, + Select_COUNT, + Select_SPECIFIC__ATTRIBUTES, + StreamViewType_KEYS__ONLY, + StreamViewType_NEW__AND__OLD__IMAGES, + StreamViewType_NEW__IMAGE, + StreamViewType_OLD__IMAGE, + TableClass_STANDARD, + TableClass_STANDARD__INFREQUENT__ACCESS, + TableStatus_ACTIVE, + TableStatus_ARCHIVED, + TableStatus_ARCHIVING, + TableStatus_CREATING, + TableStatus_DELETING, + TableStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS, + TableStatus_UPDATING, + TimeToLiveStatus_DISABLED, + TimeToLiveStatus_DISABLING, + TimeToLiveStatus_ENABLED, + TimeToLiveStatus_ENABLING, +) + + +def com_amazonaws_dynamodb_BackupInUseException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_BackupNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ConditionalCheckFailedException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ContinuousBackupsUnavailableException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_DuplicateItemException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ExportConflictException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ExportNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_GlobalTableAlreadyExistsException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_GlobalTableNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_IdempotentParameterMismatchException(input): + output = {} + if input.Message.is_Some: + output["Message"] = input.Message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ImportConflictException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ImportNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_IndexNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_InternalServerError(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_InvalidEndpointException(input): + output = {} + if input.Message.is_Some: + output["Message"] = input.Message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_InvalidExportTimeException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_InvalidRestoreTimeException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_LimitExceededException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ProvisionedThroughputExceededException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ReplicaAlreadyExistsException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ReplicaNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_RequestLimitExceeded(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ResourceInUseException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ResourceNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_TableAlreadyExistsException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_TableInUseException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_TableNotFoundException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_CancellationReason(input): + output = {} + if input.Item.is_Some: + output["Item"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Item.value.items + } + + if input.Code.is_Some: + output["Code"] = input.Code.value.VerbatimString(False) + + if input.Message.is_Some: + output["Message"] = input.Message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_AttributeValue(input): + # Convert AttributeValue + if isinstance(input, AttributeValue_S): + AttributeValue_union_value = {"S": input.S.VerbatimString(False)} + elif isinstance(input, AttributeValue_N): + AttributeValue_union_value = {"N": input.N.VerbatimString(False)} + elif isinstance(input, AttributeValue_B): + AttributeValue_union_value = {"B": bytes(input.B)} + elif isinstance(input, AttributeValue_SS): + AttributeValue_union_value = { + "SS": [list_element.VerbatimString(False) for list_element in input.SS] + } + elif isinstance(input, AttributeValue_NS): + AttributeValue_union_value = { + "NS": [list_element.VerbatimString(False) for list_element in input.NS] + } + elif isinstance(input, AttributeValue_BS): + AttributeValue_union_value = { + "BS": [bytes(list_element) for list_element in input.BS] + } + elif isinstance(input, AttributeValue_M): + AttributeValue_union_value = { + "M": { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.M.items + } + } + elif isinstance(input, AttributeValue_L): + AttributeValue_union_value = { + "L": [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input.L + ] + } + elif isinstance(input, AttributeValue_NULL): + AttributeValue_union_value = {"NULL": input.NULL} + elif isinstance(input, AttributeValue_BOOL): + AttributeValue_union_value = {"BOOL": input.BOOL} + else: + raise ValueError("No recognized union value in union type: " + str(input)) + + return AttributeValue_union_value + + +def com_amazonaws_dynamodb_TransactionCanceledException(input): + output = {} + if input.Message.is_Some: + output["Message"] = input.Message.value.VerbatimString(False) + + if input.CancellationReasons.is_Some: + output["CancellationReasons"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CancellationReason( + list_element + ) + for list_element in input.CancellationReasons.value + ] + + return output + + +def com_amazonaws_dynamodb_TransactionConflictException(input): + output = {} + if input.message.is_Some: + output["message"] = input.message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_TransactionInProgressException(input): + output = {} + if input.Message.is_Some: + output["Message"] = input.Message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_BatchStatementRequest(input): + output = {} + output["Statement"] = input.Statement.VerbatimString(False) + if input.Parameters.is_Some: + output["Parameters"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input.Parameters.value + ] + + if input.ConsistentRead.is_Some: + output["ConsistentRead"] = input.ConsistentRead.value + + return output + + +def com_amazonaws_dynamodb_ReturnConsumedCapacity(input): + # Convert ReturnConsumedCapacity + if isinstance(input, ReturnConsumedCapacity_INDEXES): + return "INDEXES" + + elif isinstance(input, ReturnConsumedCapacity_TOTAL): + return "TOTAL" + + elif isinstance(input, ReturnConsumedCapacity_NONE): + return "NONE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_BatchExecuteStatementInput(input): + output = {} + output["Statements"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BatchStatementRequest( + list_element + ) + for list_element in input.Statements + ] + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_BatchStatementResponse(input): + output = {} + if input.Error.is_Some: + output["Error"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BatchStatementError( + input.Error.value + ) + ) + + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.Item.is_Some: + output["Item"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Item.value.items + } + + return output + + +def com_amazonaws_dynamodb_BatchStatementError(input): + output = {} + if input.Code.is_Some: + output["Code"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BatchStatementErrorCodeEnum( + input.Code.value + ) + ) + + if input.Message.is_Some: + output["Message"] = input.Message.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_BatchStatementErrorCodeEnum(input): + # Convert BatchStatementErrorCodeEnum + if isinstance(input, BatchStatementErrorCodeEnum_ConditionalCheckFailed): + return "ConditionalCheckFailed" + + elif isinstance(input, BatchStatementErrorCodeEnum_ItemCollectionSizeLimitExceeded): + return "ItemCollectionSizeLimitExceeded" + + elif isinstance(input, BatchStatementErrorCodeEnum_RequestLimitExceeded): + return "RequestLimitExceeded" + + elif isinstance(input, BatchStatementErrorCodeEnum_ValidationError): + return "ValidationError" + + elif isinstance(input, BatchStatementErrorCodeEnum_ProvisionedThroughputExceeded): + return "ProvisionedThroughputExceeded" + + elif isinstance(input, BatchStatementErrorCodeEnum_TransactionConflict): + return "TransactionConflict" + + elif isinstance(input, BatchStatementErrorCodeEnum_ThrottlingError): + return "ThrottlingError" + + elif isinstance(input, BatchStatementErrorCodeEnum_InternalServerError): + return "InternalServerError" + + elif isinstance(input, BatchStatementErrorCodeEnum_ResourceNotFound): + return "ResourceNotFound" + + elif isinstance(input, BatchStatementErrorCodeEnum_AccessDenied): + return "AccessDenied" + + elif isinstance(input, BatchStatementErrorCodeEnum_DuplicateItem): + return "DuplicateItem" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ConsumedCapacity(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.CapacityUnits.is_Some: + output["CapacityUnits"] = input.CapacityUnits.value + + if input.ReadCapacityUnits.is_Some: + output["ReadCapacityUnits"] = input.ReadCapacityUnits.value + + if input.WriteCapacityUnits.is_Some: + output["WriteCapacityUnits"] = input.WriteCapacityUnits.value + + if input.Table.is_Some: + output["Table"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Capacity( + input.Table.value + ) + ) + + if input.LocalSecondaryIndexes.is_Some: + output["LocalSecondaryIndexes"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Capacity( + value + ) + for (key, value) in input.LocalSecondaryIndexes.value.items + } + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Capacity( + value + ) + for (key, value) in input.GlobalSecondaryIndexes.value.items + } + + return output + + +def com_amazonaws_dynamodb_Capacity(input): + output = {} + if input.ReadCapacityUnits.is_Some: + output["ReadCapacityUnits"] = input.ReadCapacityUnits.value + + if input.WriteCapacityUnits.is_Some: + output["WriteCapacityUnits"] = input.WriteCapacityUnits.value + + if input.CapacityUnits.is_Some: + output["CapacityUnits"] = input.CapacityUnits.value + + return output + + +def com_amazonaws_dynamodb_BatchExecuteStatementOutput(input): + output = {} + if input.Responses.is_Some: + output["Responses"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BatchStatementResponse( + list_element + ) + for list_element in input.Responses.value + ] + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input.ConsumedCapacity.value + ] + + return output + + +def com_amazonaws_dynamodb_KeysAndAttributes(input): + output = {} + output["Keys"] = [ + { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items + } + for list_element in input.Keys + ] + if input.AttributesToGet.is_Some: + output["AttributesToGet"] = [ + list_element.VerbatimString(False) + for list_element in input.AttributesToGet.value + ] + + if input.ConsistentRead.is_Some: + output["ConsistentRead"] = input.ConsistentRead.value + + if input.ProjectionExpression.is_Some: + output["ProjectionExpression"] = ( + input.ProjectionExpression.value.VerbatimString(False) + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + return output + + +def com_amazonaws_dynamodb_BatchGetItemInput(input): + output = {} + output["RequestItems"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeysAndAttributes( + value + ) + for (key, value) in input.RequestItems.items + } + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_BatchGetItemOutput(input): + output = {} + if input.Responses.is_Some: + output["Responses"] = { + key.VerbatimString(False): [ + { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items + } + for list_element in value + ] + for (key, value) in input.Responses.value.items + } + + if input.UnprocessedKeys.is_Some: + output["UnprocessedKeys"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeysAndAttributes( + value + ) + for (key, value) in input.UnprocessedKeys.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input.ConsumedCapacity.value + ] + + return output + + +def com_amazonaws_dynamodb_WriteRequest(input): + output = {} + if input.PutRequest.is_Some: + output["PutRequest"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_PutRequest( + input.PutRequest.value + ) + ) + + if input.DeleteRequest.is_Some: + output["DeleteRequest"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DeleteRequest( + input.DeleteRequest.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_PutRequest(input): + output = {} + output["Item"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Item.items + } + return output + + +def com_amazonaws_dynamodb_DeleteRequest(input): + output = {} + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + return output + + +def com_amazonaws_dynamodb_ReturnItemCollectionMetrics(input): + # Convert ReturnItemCollectionMetrics + if isinstance(input, ReturnItemCollectionMetrics_SIZE): + return "SIZE" + + elif isinstance(input, ReturnItemCollectionMetrics_NONE): + return "NONE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_BatchWriteItemInput(input): + output = {} + output["RequestItems"] = { + key.VerbatimString(False): [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_WriteRequest( + list_element + ) + for list_element in value + ] + for (key, value) in input.RequestItems.items + } + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.ReturnItemCollectionMetrics.is_Some: + output["ReturnItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input.ReturnItemCollectionMetrics.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ItemCollectionMetrics(input): + output = {} + if input.ItemCollectionKey.is_Some: + output["ItemCollectionKey"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ItemCollectionKey.value.items + } + + if input.SizeEstimateRangeGB.is_Some: + output["SizeEstimateRangeGB"] = [ + list_element for list_element in input.SizeEstimateRangeGB.value + ] + + return output + + +def com_amazonaws_dynamodb_BatchWriteItemOutput(input): + output = {} + if input.UnprocessedItems.is_Some: + output["UnprocessedItems"] = { + key.VerbatimString(False): [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_WriteRequest( + list_element + ) + for list_element in value + ] + for (key, value) in input.UnprocessedItems.value.items + } + + if input.ItemCollectionMetrics.is_Some: + output["ItemCollectionMetrics"] = { + key.VerbatimString(False): [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ItemCollectionMetrics( + list_element + ) + for list_element in value + ] + for (key, value) in input.ItemCollectionMetrics.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input.ConsumedCapacity.value + ] + + return output + + +def com_amazonaws_dynamodb_CreateBackupInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["BackupName"] = input.BackupName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_BackupDetails(input): + output = {} + output["BackupArn"] = input.BackupArn.VerbatimString(False) + output["BackupName"] = input.BackupName.VerbatimString(False) + if input.BackupSizeBytes.is_Some: + output["BackupSizeBytes"] = input.BackupSizeBytes.value + + output["BackupStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupStatus( + input.BackupStatus + ) + ) + output["BackupType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupType( + input.BackupType + ) + ) + output["BackupCreationDateTime"] = TypeError("TimestampShape not supported") + if input.BackupExpiryDateTime.is_Some: + output["BackupExpiryDateTime"] = TypeError("TimestampShape not supported") + + return output + + +def com_amazonaws_dynamodb_BackupStatus(input): + # Convert BackupStatus + if isinstance(input, BackupStatus_CREATING): + return "CREATING" + + elif isinstance(input, BackupStatus_DELETED): + return "DELETED" + + elif isinstance(input, BackupStatus_AVAILABLE): + return "AVAILABLE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_BackupType(input): + # Convert BackupType + if isinstance(input, BackupType_USER): + return "USER" + + elif isinstance(input, BackupType_SYSTEM): + return "SYSTEM" + + elif isinstance(input, BackupType_AWS__BACKUP): + return "AWS_BACKUP" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_CreateBackupOutput(input): + output = {} + if input.BackupDetails.is_Some: + output["BackupDetails"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupDetails( + input.BackupDetails.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_Replica(input): + output = {} + if input.RegionName.is_Some: + output["RegionName"] = input.RegionName.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_CreateGlobalTableInput(input): + output = {} + output["GlobalTableName"] = input.GlobalTableName.VerbatimString(False) + output["ReplicationGroup"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Replica( + list_element + ) + for list_element in input.ReplicationGroup + ] + return output + + +def com_amazonaws_dynamodb_GlobalTableDescription(input): + output = {} + if input.ReplicationGroup.is_Some: + output["ReplicationGroup"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaDescription( + list_element + ) + for list_element in input.ReplicationGroup.value + ] + + if input.GlobalTableArn.is_Some: + output["GlobalTableArn"] = input.GlobalTableArn.value.VerbatimString(False) + + if input.CreationDateTime.is_Some: + output["CreationDateTime"] = TypeError("TimestampShape not supported") + + if input.GlobalTableStatus.is_Some: + output["GlobalTableStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalTableStatus( + input.GlobalTableStatus.value + ) + ) + + if input.GlobalTableName.is_Some: + output["GlobalTableName"] = input.GlobalTableName.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ReplicaDescription(input): + output = {} + if input.RegionName.is_Some: + output["RegionName"] = input.RegionName.value.VerbatimString(False) + + if input.ReplicaStatus.is_Some: + output["ReplicaStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaStatus( + input.ReplicaStatus.value + ) + ) + + if input.ReplicaStatusDescription.is_Some: + output["ReplicaStatusDescription"] = ( + input.ReplicaStatusDescription.value.VerbatimString(False) + ) + + if input.ReplicaStatusPercentProgress.is_Some: + output["ReplicaStatusPercentProgress"] = ( + input.ReplicaStatusPercentProgress.value.VerbatimString(False) + ) + + if input.KMSMasterKeyId.is_Some: + output["KMSMasterKeyId"] = input.KMSMasterKeyId.value.VerbatimString(False) + + if input.ProvisionedThroughputOverride.is_Some: + output["ProvisionedThroughputOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride.value + ) + ) + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + if input.ReplicaInaccessibleDateTime.is_Some: + output["ReplicaInaccessibleDateTime"] = TypeError( + "TimestampShape not supported" + ) + + if input.ReplicaTableClassSummary.is_Some: + output["ReplicaTableClassSummary"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClassSummary( + input.ReplicaTableClassSummary.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_GlobalTableStatus(input): + # Convert GlobalTableStatus + if isinstance(input, GlobalTableStatus_CREATING): + return "CREATING" + + elif isinstance(input, GlobalTableStatus_ACTIVE): + return "ACTIVE" + + elif isinstance(input, GlobalTableStatus_DELETING): + return "DELETING" + + elif isinstance(input, GlobalTableStatus_UPDATING): + return "UPDATING" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ReplicaStatus(input): + # Convert ReplicaStatus + if isinstance(input, ReplicaStatus_CREATING): + return "CREATING" + + elif isinstance(input, ReplicaStatus_CREATION__FAILED): + return "CREATION_FAILED" + + elif isinstance(input, ReplicaStatus_UPDATING): + return "UPDATING" + + elif isinstance(input, ReplicaStatus_DELETING): + return "DELETING" + + elif isinstance(input, ReplicaStatus_ACTIVE): + return "ACTIVE" + + elif isinstance(input, ReplicaStatus_REGION__DISABLED): + return "REGION_DISABLED" + + elif isinstance(input, ReplicaStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS): + return "INACCESSIBLE_ENCRYPTION_CREDENTIALS" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ProvisionedThroughputOverride(input): + output = {} + if input.ReadCapacityUnits.is_Some: + output["ReadCapacityUnits"] = input.ReadCapacityUnits.value + + return output + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexDescription(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.ProvisionedThroughputOverride.is_Some: + output["ProvisionedThroughputOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_TableClassSummary(input): + output = {} + if input.TableClass.is_Some: + output["TableClass"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClass( + input.TableClass.value + ) + ) + + if input.LastUpdateDateTime.is_Some: + output["LastUpdateDateTime"] = TypeError("TimestampShape not supported") + + return output + + +def com_amazonaws_dynamodb_TableClass(input): + # Convert TableClass + if isinstance(input, TableClass_STANDARD): + return "STANDARD" + + elif isinstance(input, TableClass_STANDARD__INFREQUENT__ACCESS): + return "STANDARD_INFREQUENT_ACCESS" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_CreateGlobalTableOutput(input): + output = {} + if input.GlobalTableDescription.is_Some: + output["GlobalTableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalTableDescription( + input.GlobalTableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_AttributeDefinition(input): + output = {} + output["AttributeName"] = input.AttributeName.VerbatimString(False) + output["AttributeType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ScalarAttributeType( + input.AttributeType + ) + ) + return output + + +def com_amazonaws_dynamodb_ScalarAttributeType(input): + # Convert ScalarAttributeType + if isinstance(input, ScalarAttributeType_S): + return "S" + + elif isinstance(input, ScalarAttributeType_N): + return "N" + + elif isinstance(input, ScalarAttributeType_B): + return "B" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_KeySchemaElement(input): + output = {} + output["AttributeName"] = input.AttributeName.VerbatimString(False) + output["KeyType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeyType( + input.KeyType + ) + ) + return output + + +def com_amazonaws_dynamodb_KeyType(input): + # Convert KeyType + if isinstance(input, KeyType_HASH): + return "HASH" + + elif isinstance(input, KeyType_RANGE): + return "RANGE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_LocalSecondaryIndex(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema + ] + output["Projection"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Projection( + input.Projection + ) + ) + return output + + +def com_amazonaws_dynamodb_Projection(input): + output = {} + if input.ProjectionType.is_Some: + output["ProjectionType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProjectionType( + input.ProjectionType.value + ) + ) + + if input.NonKeyAttributes.is_Some: + output["NonKeyAttributes"] = [ + list_element.VerbatimString(False) + for list_element in input.NonKeyAttributes.value + ] + + return output + + +def com_amazonaws_dynamodb_ProjectionType(input): + # Convert ProjectionType + if isinstance(input, ProjectionType_ALL): + return "ALL" + + elif isinstance(input, ProjectionType_KEYS__ONLY): + return "KEYS_ONLY" + + elif isinstance(input, ProjectionType_INCLUDE): + return "INCLUDE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_GlobalSecondaryIndex(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema + ] + output["Projection"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Projection( + input.Projection + ) + ) + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ProvisionedThroughput(input): + output = {} + output["ReadCapacityUnits"] = input.ReadCapacityUnits + output["WriteCapacityUnits"] = input.WriteCapacityUnits + return output + + +def com_amazonaws_dynamodb_BillingMode(input): + # Convert BillingMode + if isinstance(input, BillingMode_PROVISIONED): + return "PROVISIONED" + + elif isinstance(input, BillingMode_PAY__PER__REQUEST): + return "PAY_PER_REQUEST" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_StreamSpecification(input): + output = {} + output["StreamEnabled"] = input.StreamEnabled + if input.StreamViewType.is_Some: + output["StreamViewType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_StreamViewType( + input.StreamViewType.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_StreamViewType(input): + # Convert StreamViewType + if isinstance(input, StreamViewType_NEW__IMAGE): + return "NEW_IMAGE" + + elif isinstance(input, StreamViewType_OLD__IMAGE): + return "OLD_IMAGE" + + elif isinstance(input, StreamViewType_NEW__AND__OLD__IMAGES): + return "NEW_AND_OLD_IMAGES" + + elif isinstance(input, StreamViewType_KEYS__ONLY): + return "KEYS_ONLY" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_SSESpecification(input): + output = {} + if input.Enabled.is_Some: + output["Enabled"] = input.Enabled.value + + if input.SSEType.is_Some: + output["SSEType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSEType( + input.SSEType.value + ) + ) + + if input.KMSMasterKeyId.is_Some: + output["KMSMasterKeyId"] = input.KMSMasterKeyId.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_SSEType(input): + # Convert SSEType + if isinstance(input, SSEType_AES256): + return "AES256" + + elif isinstance(input, SSEType_KMS): + return "KMS" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_Tag(input): + output = {} + output["Key"] = input.Key.VerbatimString(False) + output["Value"] = input.Value.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_CreateTableInput(input): + output = {} + output["AttributeDefinitions"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input.AttributeDefinitions + ] + output["TableName"] = input.TableName.VerbatimString(False) + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema + ] + if input.LocalSecondaryIndexes.is_Some: + output["LocalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_LocalSecondaryIndex( + list_element + ) + for list_element in input.LocalSecondaryIndexes.value + ] + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + if input.BillingMode.is_Some: + output["BillingMode"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.BillingMode.value + ) + ) + + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput.value + ) + ) + + if input.StreamSpecification.is_Some: + output["StreamSpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_StreamSpecification( + input.StreamSpecification.value + ) + ) + + if input.SSESpecification.is_Some: + output["SSESpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSESpecification( + input.SSESpecification.value + ) + ) + + if input.Tags.is_Some: + output["Tags"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Tag( + list_element + ) + for list_element in input.Tags.value + ] + + if input.TableClass.is_Some: + output["TableClass"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClass( + input.TableClass.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_TableDescription(input): + output = {} + if input.AttributeDefinitions.is_Some: + output["AttributeDefinitions"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input.AttributeDefinitions.value + ] + + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.KeySchema.is_Some: + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema.value + ] + + if input.TableStatus.is_Some: + output["TableStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableStatus( + input.TableStatus.value + ) + ) + + if input.CreationDateTime.is_Some: + output["CreationDateTime"] = TypeError("TimestampShape not supported") + + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughputDescription( + input.ProvisionedThroughput.value + ) + ) + + if input.TableSizeBytes.is_Some: + output["TableSizeBytes"] = input.TableSizeBytes.value + + if input.ItemCount.is_Some: + output["ItemCount"] = input.ItemCount.value + + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.TableId.is_Some: + output["TableId"] = input.TableId.value.VerbatimString(False) + + if input.BillingModeSummary.is_Some: + output["BillingModeSummary"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingModeSummary( + input.BillingModeSummary.value + ) + ) + + if input.LocalSecondaryIndexes.is_Some: + output["LocalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_LocalSecondaryIndexDescription( + list_element + ) + for list_element in input.LocalSecondaryIndexes.value + ] + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndexDescription( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + if input.StreamSpecification.is_Some: + output["StreamSpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_StreamSpecification( + input.StreamSpecification.value + ) + ) + + if input.LatestStreamLabel.is_Some: + output["LatestStreamLabel"] = input.LatestStreamLabel.value.VerbatimString( + False + ) + + if input.LatestStreamArn.is_Some: + output["LatestStreamArn"] = input.LatestStreamArn.value.VerbatimString(False) + + if input.GlobalTableVersion.is_Some: + output["GlobalTableVersion"] = input.GlobalTableVersion.value.VerbatimString( + False + ) + + if input.Replicas.is_Some: + output["Replicas"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaDescription( + list_element + ) + for list_element in input.Replicas.value + ] + + if input.RestoreSummary.is_Some: + output["RestoreSummary"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_RestoreSummary( + input.RestoreSummary.value + ) + ) + + if input.SSEDescription.is_Some: + output["SSEDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSEDescription( + input.SSEDescription.value + ) + ) + + if input.ArchivalSummary.is_Some: + output["ArchivalSummary"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ArchivalSummary( + input.ArchivalSummary.value + ) + ) + + if input.TableClassSummary.is_Some: + output["TableClassSummary"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClassSummary( + input.TableClassSummary.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_TableStatus(input): + # Convert TableStatus + if isinstance(input, TableStatus_CREATING): + return "CREATING" + + elif isinstance(input, TableStatus_UPDATING): + return "UPDATING" + + elif isinstance(input, TableStatus_DELETING): + return "DELETING" + + elif isinstance(input, TableStatus_ACTIVE): + return "ACTIVE" + + elif isinstance(input, TableStatus_INACCESSIBLE__ENCRYPTION__CREDENTIALS): + return "INACCESSIBLE_ENCRYPTION_CREDENTIALS" + + elif isinstance(input, TableStatus_ARCHIVING): + return "ARCHIVING" + + elif isinstance(input, TableStatus_ARCHIVED): + return "ARCHIVED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ProvisionedThroughputDescription(input): + output = {} + if input.LastIncreaseDateTime.is_Some: + output["LastIncreaseDateTime"] = TypeError("TimestampShape not supported") + + if input.LastDecreaseDateTime.is_Some: + output["LastDecreaseDateTime"] = TypeError("TimestampShape not supported") + + if input.NumberOfDecreasesToday.is_Some: + output["NumberOfDecreasesToday"] = input.NumberOfDecreasesToday.value + + if input.ReadCapacityUnits.is_Some: + output["ReadCapacityUnits"] = input.ReadCapacityUnits.value + + if input.WriteCapacityUnits.is_Some: + output["WriteCapacityUnits"] = input.WriteCapacityUnits.value + + return output + + +def com_amazonaws_dynamodb_BillingModeSummary(input): + output = {} + if input.BillingMode.is_Some: + output["BillingMode"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.BillingMode.value + ) + ) + + if input.LastUpdateToPayPerRequestDateTime.is_Some: + output["LastUpdateToPayPerRequestDateTime"] = TypeError( + "TimestampShape not supported" + ) + + return output + + +def com_amazonaws_dynamodb_LocalSecondaryIndexDescription(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.KeySchema.is_Some: + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema.value + ] + + if input.Projection.is_Some: + output["Projection"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Projection( + input.Projection.value + ) + ) + + if input.IndexSizeBytes.is_Some: + output["IndexSizeBytes"] = input.IndexSizeBytes.value + + if input.ItemCount.is_Some: + output["ItemCount"] = input.ItemCount.value + + if input.IndexArn.is_Some: + output["IndexArn"] = input.IndexArn.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexDescription(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.KeySchema.is_Some: + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema.value + ] + + if input.Projection.is_Some: + output["Projection"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Projection( + input.Projection.value + ) + ) + + if input.IndexStatus.is_Some: + output["IndexStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_IndexStatus( + input.IndexStatus.value + ) + ) + + if input.Backfilling.is_Some: + output["Backfilling"] = input.Backfilling.value + + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughputDescription( + input.ProvisionedThroughput.value + ) + ) + + if input.IndexSizeBytes.is_Some: + output["IndexSizeBytes"] = input.IndexSizeBytes.value + + if input.ItemCount.is_Some: + output["ItemCount"] = input.ItemCount.value + + if input.IndexArn.is_Some: + output["IndexArn"] = input.IndexArn.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_RestoreSummary(input): + output = {} + if input.SourceBackupArn.is_Some: + output["SourceBackupArn"] = input.SourceBackupArn.value.VerbatimString(False) + + if input.SourceTableArn.is_Some: + output["SourceTableArn"] = input.SourceTableArn.value.VerbatimString(False) + + output["RestoreDateTime"] = TypeError("TimestampShape not supported") + output["RestoreInProgress"] = input.RestoreInProgress + return output + + +def com_amazonaws_dynamodb_SSEDescription(input): + output = {} + if input.Status.is_Some: + output["Status"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSEStatus( + input.Status.value + ) + ) + + if input.SSEType.is_Some: + output["SSEType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSEType( + input.SSEType.value + ) + ) + + if input.KMSMasterKeyArn.is_Some: + output["KMSMasterKeyArn"] = input.KMSMasterKeyArn.value.VerbatimString(False) + + if input.InaccessibleEncryptionDateTime.is_Some: + output["InaccessibleEncryptionDateTime"] = TypeError( + "TimestampShape not supported" + ) + + return output + + +def com_amazonaws_dynamodb_ArchivalSummary(input): + output = {} + if input.ArchivalDateTime.is_Some: + output["ArchivalDateTime"] = TypeError("TimestampShape not supported") + + if input.ArchivalReason.is_Some: + output["ArchivalReason"] = input.ArchivalReason.value.VerbatimString(False) + + if input.ArchivalBackupArn.is_Some: + output["ArchivalBackupArn"] = input.ArchivalBackupArn.value.VerbatimString( + False + ) + + return output + + +def com_amazonaws_dynamodb_IndexStatus(input): + # Convert IndexStatus + if isinstance(input, IndexStatus_CREATING): + return "CREATING" + + elif isinstance(input, IndexStatus_UPDATING): + return "UPDATING" + + elif isinstance(input, IndexStatus_DELETING): + return "DELETING" + + elif isinstance(input, IndexStatus_ACTIVE): + return "ACTIVE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_SSEStatus(input): + # Convert SSEStatus + if isinstance(input, SSEStatus_ENABLING): + return "ENABLING" + + elif isinstance(input, SSEStatus_ENABLED): + return "ENABLED" + + elif isinstance(input, SSEStatus_DISABLING): + return "DISABLING" + + elif isinstance(input, SSEStatus_DISABLED): + return "DISABLED" + + elif isinstance(input, SSEStatus_UPDATING): + return "UPDATING" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_CreateTableOutput(input): + output = {} + if input.TableDescription.is_Some: + output["TableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableDescription( + input.TableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DeleteBackupInput(input): + output = {} + output["BackupArn"] = input.BackupArn.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_BackupDescription(input): + output = {} + if input.BackupDetails.is_Some: + output["BackupDetails"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupDetails( + input.BackupDetails.value + ) + ) + + if input.SourceTableDetails.is_Some: + output["SourceTableDetails"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SourceTableDetails( + input.SourceTableDetails.value + ) + ) + + if input.SourceTableFeatureDetails.is_Some: + output["SourceTableFeatureDetails"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SourceTableFeatureDetails( + input.SourceTableFeatureDetails.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_SourceTableDetails(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["TableId"] = input.TableId.VerbatimString(False) + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.TableSizeBytes.is_Some: + output["TableSizeBytes"] = input.TableSizeBytes.value + + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema + ] + output["TableCreationDateTime"] = TypeError("TimestampShape not supported") + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput + ) + ) + if input.ItemCount.is_Some: + output["ItemCount"] = input.ItemCount.value + + if input.BillingMode.is_Some: + output["BillingMode"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.BillingMode.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_SourceTableFeatureDetails(input): + output = {} + if input.LocalSecondaryIndexes.is_Some: + output["LocalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_LocalSecondaryIndexInfo( + list_element + ) + for list_element in input.LocalSecondaryIndexes.value + ] + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndexInfo( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + if input.StreamDescription.is_Some: + output["StreamDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_StreamSpecification( + input.StreamDescription.value + ) + ) + + if input.TimeToLiveDescription.is_Some: + output["TimeToLiveDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TimeToLiveDescription( + input.TimeToLiveDescription.value + ) + ) + + if input.SSEDescription.is_Some: + output["SSEDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSEDescription( + input.SSEDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_LocalSecondaryIndexInfo(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.KeySchema.is_Some: + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema.value + ] + + if input.Projection.is_Some: + output["Projection"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Projection( + input.Projection.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexInfo(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.KeySchema.is_Some: + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema.value + ] + + if input.Projection.is_Some: + output["Projection"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Projection( + input.Projection.value + ) + ) + + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_TimeToLiveDescription(input): + output = {} + if input.TimeToLiveStatus.is_Some: + output["TimeToLiveStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TimeToLiveStatus( + input.TimeToLiveStatus.value + ) + ) + + if input.AttributeName.is_Some: + output["AttributeName"] = input.AttributeName.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_TimeToLiveStatus(input): + # Convert TimeToLiveStatus + if isinstance(input, TimeToLiveStatus_ENABLING): + return "ENABLING" + + elif isinstance(input, TimeToLiveStatus_DISABLING): + return "DISABLING" + + elif isinstance(input, TimeToLiveStatus_ENABLED): + return "ENABLED" + + elif isinstance(input, TimeToLiveStatus_DISABLED): + return "DISABLED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DeleteBackupOutput(input): + output = {} + if input.BackupDescription.is_Some: + output["BackupDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupDescription( + input.BackupDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ExpectedAttributeValue(input): + output = {} + if input.Value.is_Some: + output["Value"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + input.Value.value + ) + ) + + if input.Exists.is_Some: + output["Exists"] = input.Exists.value + + if input.ComparisonOperator.is_Some: + output["ComparisonOperator"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ComparisonOperator( + input.ComparisonOperator.value + ) + ) + + if input.AttributeValueList.is_Some: + output["AttributeValueList"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input.AttributeValueList.value + ] + + return output + + +def com_amazonaws_dynamodb_ComparisonOperator(input): + # Convert ComparisonOperator + if isinstance(input, ComparisonOperator_EQ): + return "EQ" + + elif isinstance(input, ComparisonOperator_NE): + return "NE" + + elif isinstance(input, ComparisonOperator_IN): + return "IN" + + elif isinstance(input, ComparisonOperator_LE): + return "LE" + + elif isinstance(input, ComparisonOperator_LT): + return "LT" + + elif isinstance(input, ComparisonOperator_GE): + return "GE" + + elif isinstance(input, ComparisonOperator_GT): + return "GT" + + elif isinstance(input, ComparisonOperator_BETWEEN): + return "BETWEEN" + + elif isinstance(input, ComparisonOperator_NOT__NULL): + return "NOT_NULL" + + elif isinstance(input, ComparisonOperator_NULL): + return "NULL" + + elif isinstance(input, ComparisonOperator_CONTAINS): + return "CONTAINS" + + elif isinstance(input, ComparisonOperator_NOT__CONTAINS): + return "NOT_CONTAINS" + + elif isinstance(input, ComparisonOperator_BEGINS__WITH): + return "BEGINS_WITH" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ConditionalOperator(input): + # Convert ConditionalOperator + if isinstance(input, ConditionalOperator_AND): + return "AND" + + elif isinstance(input, ConditionalOperator_OR): + return "OR" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ReturnValue(input): + # Convert ReturnValue + if isinstance(input, ReturnValue_NONE): + return "NONE" + + elif isinstance(input, ReturnValue_ALL__OLD): + return "ALL_OLD" + + elif isinstance(input, ReturnValue_UPDATED__OLD): + return "UPDATED_OLD" + + elif isinstance(input, ReturnValue_ALL__NEW): + return "ALL_NEW" + + elif isinstance(input, ReturnValue_UPDATED__NEW): + return "UPDATED_NEW" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DeleteItemInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + if input.Expected.is_Some: + output["Expected"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExpectedAttributeValue( + value + ) + for (key, value) in input.Expected.value.items + } + + if input.ConditionalOperator.is_Some: + output["ConditionalOperator"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConditionalOperator( + input.ConditionalOperator.value + ) + ) + + if input.ReturnValues.is_Some: + output["ReturnValues"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnValue( + input.ReturnValues.value + ) + ) + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.ReturnItemCollectionMetrics.is_Some: + output["ReturnItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input.ReturnItemCollectionMetrics.value + ) + ) + + if input.ConditionExpression.is_Some: + output["ConditionExpression"] = input.ConditionExpression.value.VerbatimString( + False + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + return output + + +def com_amazonaws_dynamodb_DeleteItemOutput(input): + output = {} + if input.Attributes.is_Some: + output["Attributes"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Attributes.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + input.ConsumedCapacity.value + ) + ) + + if input.ItemCollectionMetrics.is_Some: + output["ItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ItemCollectionMetrics( + input.ItemCollectionMetrics.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DeleteTableInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_DeleteTableOutput(input): + output = {} + if input.TableDescription.is_Some: + output["TableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableDescription( + input.TableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeBackupInput(input): + output = {} + output["BackupArn"] = input.BackupArn.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_DescribeBackupOutput(input): + output = {} + if input.BackupDescription.is_Some: + output["BackupDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupDescription( + input.BackupDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeContinuousBackupsInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_ContinuousBackupsDescription(input): + output = {} + output["ContinuousBackupsStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContinuousBackupsStatus( + input.ContinuousBackupsStatus + ) + ) + if input.PointInTimeRecoveryDescription.is_Some: + output["PointInTimeRecoveryDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_PointInTimeRecoveryDescription( + input.PointInTimeRecoveryDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ContinuousBackupsStatus(input): + # Convert ContinuousBackupsStatus + if isinstance(input, ContinuousBackupsStatus_ENABLED): + return "ENABLED" + + elif isinstance(input, ContinuousBackupsStatus_DISABLED): + return "DISABLED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_PointInTimeRecoveryDescription(input): + output = {} + if input.PointInTimeRecoveryStatus.is_Some: + output["PointInTimeRecoveryStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_PointInTimeRecoveryStatus( + input.PointInTimeRecoveryStatus.value + ) + ) + + if input.EarliestRestorableDateTime.is_Some: + output["EarliestRestorableDateTime"] = TypeError("TimestampShape not supported") + + if input.LatestRestorableDateTime.is_Some: + output["LatestRestorableDateTime"] = TypeError("TimestampShape not supported") + + return output + + +def com_amazonaws_dynamodb_PointInTimeRecoveryStatus(input): + # Convert PointInTimeRecoveryStatus + if isinstance(input, PointInTimeRecoveryStatus_ENABLED): + return "ENABLED" + + elif isinstance(input, PointInTimeRecoveryStatus_DISABLED): + return "DISABLED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DescribeContinuousBackupsOutput(input): + output = {} + if input.ContinuousBackupsDescription.is_Some: + output["ContinuousBackupsDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContinuousBackupsDescription( + input.ContinuousBackupsDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeContributorInsightsInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ContributorInsightsStatus(input): + # Convert ContributorInsightsStatus + if isinstance(input, ContributorInsightsStatus_ENABLING): + return "ENABLING" + + elif isinstance(input, ContributorInsightsStatus_ENABLED): + return "ENABLED" + + elif isinstance(input, ContributorInsightsStatus_DISABLING): + return "DISABLING" + + elif isinstance(input, ContributorInsightsStatus_DISABLED): + return "DISABLED" + + elif isinstance(input, ContributorInsightsStatus_FAILED): + return "FAILED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_FailureException(input): + output = {} + if input.ExceptionName.is_Some: + output["ExceptionName"] = input.ExceptionName.value.VerbatimString(False) + + if input.ExceptionDescription.is_Some: + output["ExceptionDescription"] = ( + input.ExceptionDescription.value.VerbatimString(False) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeContributorInsightsOutput(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.ContributorInsightsRuleList.is_Some: + output["ContributorInsightsRuleList"] = [ + list_element.VerbatimString(False) + for list_element in input.ContributorInsightsRuleList.value + ] + + if input.ContributorInsightsStatus.is_Some: + output["ContributorInsightsStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContributorInsightsStatus( + input.ContributorInsightsStatus.value + ) + ) + + if input.LastUpdateDateTime.is_Some: + output["LastUpdateDateTime"] = TypeError("TimestampShape not supported") + + if input.FailureException.is_Some: + output["FailureException"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_FailureException( + input.FailureException.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeEndpointsRequest(input): + output = {} + return output + + +def com_amazonaws_dynamodb_Endpoint(input): + output = {} + output["Address"] = input.Address.VerbatimString(False) + output["CachePeriodInMinutes"] = input.CachePeriodInMinutes + return output + + +def com_amazonaws_dynamodb_DescribeEndpointsResponse(input): + output = {} + output["Endpoints"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Endpoint( + list_element + ) + for list_element in input.Endpoints + ] + return output + + +def com_amazonaws_dynamodb_DescribeExportInput(input): + output = {} + output["ExportArn"] = input.ExportArn.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_ExportDescription(input): + output = {} + if input.ExportArn.is_Some: + output["ExportArn"] = input.ExportArn.value.VerbatimString(False) + + if input.ExportStatus.is_Some: + output["ExportStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportStatus( + input.ExportStatus.value + ) + ) + + if input.StartTime.is_Some: + output["StartTime"] = TypeError("TimestampShape not supported") + + if input.EndTime.is_Some: + output["EndTime"] = TypeError("TimestampShape not supported") + + if input.ExportManifest.is_Some: + output["ExportManifest"] = input.ExportManifest.value.VerbatimString(False) + + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.TableId.is_Some: + output["TableId"] = input.TableId.value.VerbatimString(False) + + if input.ExportTime.is_Some: + output["ExportTime"] = TypeError("TimestampShape not supported") + + if input.ClientToken.is_Some: + output["ClientToken"] = input.ClientToken.value.VerbatimString(False) + + if input.S3Bucket.is_Some: + output["S3Bucket"] = input.S3Bucket.value.VerbatimString(False) + + if input.S3BucketOwner.is_Some: + output["S3BucketOwner"] = input.S3BucketOwner.value.VerbatimString(False) + + if input.S3Prefix.is_Some: + output["S3Prefix"] = input.S3Prefix.value.VerbatimString(False) + + if input.S3SseAlgorithm.is_Some: + output["S3SseAlgorithm"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_S3SseAlgorithm( + input.S3SseAlgorithm.value + ) + ) + + if input.S3SseKmsKeyId.is_Some: + output["S3SseKmsKeyId"] = input.S3SseKmsKeyId.value.VerbatimString(False) + + if input.FailureCode.is_Some: + output["FailureCode"] = input.FailureCode.value.VerbatimString(False) + + if input.FailureMessage.is_Some: + output["FailureMessage"] = input.FailureMessage.value.VerbatimString(False) + + if input.ExportFormat.is_Some: + output["ExportFormat"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportFormat( + input.ExportFormat.value + ) + ) + + if input.BilledSizeBytes.is_Some: + output["BilledSizeBytes"] = input.BilledSizeBytes.value + + if input.ItemCount.is_Some: + output["ItemCount"] = input.ItemCount.value + + return output + + +def com_amazonaws_dynamodb_ExportStatus(input): + # Convert ExportStatus + if isinstance(input, ExportStatus_IN__PROGRESS): + return "IN_PROGRESS" + + elif isinstance(input, ExportStatus_COMPLETED): + return "COMPLETED" + + elif isinstance(input, ExportStatus_FAILED): + return "FAILED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_S3SseAlgorithm(input): + # Convert S3SseAlgorithm + if isinstance(input, S3SseAlgorithm_AES256): + return "AES256" + + elif isinstance(input, S3SseAlgorithm_KMS): + return "KMS" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ExportFormat(input): + # Convert ExportFormat + if isinstance(input, ExportFormat_DYNAMODB__JSON): + return "DYNAMODB_JSON" + + elif isinstance(input, ExportFormat_ION): + return "ION" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DescribeExportOutput(input): + output = {} + if input.ExportDescription.is_Some: + output["ExportDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportDescription( + input.ExportDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeGlobalTableInput(input): + output = {} + output["GlobalTableName"] = input.GlobalTableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_DescribeGlobalTableOutput(input): + output = {} + if input.GlobalTableDescription.is_Some: + output["GlobalTableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalTableDescription( + input.GlobalTableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput(input): + output = {} + output["GlobalTableName"] = input.GlobalTableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_ReplicaSettingsDescription(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + if input.ReplicaStatus.is_Some: + output["ReplicaStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaStatus( + input.ReplicaStatus.value + ) + ) + + if input.ReplicaBillingModeSummary.is_Some: + output["ReplicaBillingModeSummary"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingModeSummary( + input.ReplicaBillingModeSummary.value + ) + ) + + if input.ReplicaProvisionedReadCapacityUnits.is_Some: + output["ReplicaProvisionedReadCapacityUnits"] = ( + input.ReplicaProvisionedReadCapacityUnits.value + ) + + if input.ReplicaProvisionedReadCapacityAutoScalingSettings.is_Some: + output["ReplicaProvisionedReadCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ReplicaProvisionedReadCapacityAutoScalingSettings.value + ) + ) + + if input.ReplicaProvisionedWriteCapacityUnits.is_Some: + output["ReplicaProvisionedWriteCapacityUnits"] = ( + input.ReplicaProvisionedWriteCapacityUnits.value + ) + + if input.ReplicaProvisionedWriteCapacityAutoScalingSettings.is_Some: + output["ReplicaProvisionedWriteCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ReplicaProvisionedWriteCapacityAutoScalingSettings.value + ) + ) + + if input.ReplicaGlobalSecondaryIndexSettings.is_Some: + output["ReplicaGlobalSecondaryIndexSettings"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription( + list_element + ) + for list_element in input.ReplicaGlobalSecondaryIndexSettings.value + ] + + if input.ReplicaTableClassSummary.is_Some: + output["ReplicaTableClassSummary"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClassSummary( + input.ReplicaTableClassSummary.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_AutoScalingSettingsDescription(input): + output = {} + if input.MinimumUnits.is_Some: + output["MinimumUnits"] = input.MinimumUnits.value + + if input.MaximumUnits.is_Some: + output["MaximumUnits"] = input.MaximumUnits.value + + if input.AutoScalingDisabled.is_Some: + output["AutoScalingDisabled"] = input.AutoScalingDisabled.value + + if input.AutoScalingRoleArn.is_Some: + output["AutoScalingRoleArn"] = input.AutoScalingRoleArn.value.VerbatimString( + False + ) + + if input.ScalingPolicies.is_Some: + output["ScalingPolicies"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingPolicyDescription( + list_element + ) + for list_element in input.ScalingPolicies.value + ] + + return output + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsDescription(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + if input.IndexStatus.is_Some: + output["IndexStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_IndexStatus( + input.IndexStatus.value + ) + ) + + if input.ProvisionedReadCapacityUnits.is_Some: + output["ProvisionedReadCapacityUnits"] = ( + input.ProvisionedReadCapacityUnits.value + ) + + if input.ProvisionedReadCapacityAutoScalingSettings.is_Some: + output["ProvisionedReadCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ProvisionedReadCapacityAutoScalingSettings.value + ) + ) + + if input.ProvisionedWriteCapacityUnits.is_Some: + output["ProvisionedWriteCapacityUnits"] = ( + input.ProvisionedWriteCapacityUnits.value + ) + + if input.ProvisionedWriteCapacityAutoScalingSettings.is_Some: + output["ProvisionedWriteCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ProvisionedWriteCapacityAutoScalingSettings.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_AutoScalingPolicyDescription(input): + output = {} + if input.PolicyName.is_Some: + output["PolicyName"] = input.PolicyName.value.VerbatimString(False) + + if input.TargetTrackingScalingPolicyConfiguration.is_Some: + output["TargetTrackingScalingPolicyConfiguration"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription( + input.TargetTrackingScalingPolicyConfiguration.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationDescription( + input, +): + output = {} + if input.DisableScaleIn.is_Some: + output["DisableScaleIn"] = input.DisableScaleIn.value + + if input.ScaleInCooldown.is_Some: + output["ScaleInCooldown"] = input.ScaleInCooldown.value + + if input.ScaleOutCooldown.is_Some: + output["ScaleOutCooldown"] = input.ScaleOutCooldown.value + + output["TargetValue"] = input.TargetValue + return output + + +def com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput(input): + output = {} + if input.GlobalTableName.is_Some: + output["GlobalTableName"] = input.GlobalTableName.value.VerbatimString(False) + + if input.ReplicaSettings.is_Some: + output["ReplicaSettings"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaSettingsDescription( + list_element + ) + for list_element in input.ReplicaSettings.value + ] + + return output + + +def com_amazonaws_dynamodb_DescribeImportInput(input): + output = {} + output["ImportArn"] = input.ImportArn.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_ImportTableDescription(input): + output = {} + if input.ImportArn.is_Some: + output["ImportArn"] = input.ImportArn.value.VerbatimString(False) + + if input.ImportStatus.is_Some: + output["ImportStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ImportStatus( + input.ImportStatus.value + ) + ) + + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.TableId.is_Some: + output["TableId"] = input.TableId.value.VerbatimString(False) + + if input.ClientToken.is_Some: + output["ClientToken"] = input.ClientToken.value.VerbatimString(False) + + if input.S3BucketSource.is_Some: + output["S3BucketSource"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_S3BucketSource( + input.S3BucketSource.value + ) + ) + + if input.ErrorCount.is_Some: + output["ErrorCount"] = input.ErrorCount.value + + if input.CloudWatchLogGroupArn.is_Some: + output["CloudWatchLogGroupArn"] = ( + input.CloudWatchLogGroupArn.value.VerbatimString(False) + ) + + if input.InputFormat.is_Some: + output["InputFormat"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_InputFormat( + input.InputFormat.value + ) + ) + + if input.InputFormatOptions.is_Some: + output["InputFormatOptions"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_InputFormatOptions( + input.InputFormatOptions.value + ) + ) + + if input.InputCompressionType.is_Some: + output["InputCompressionType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_InputCompressionType( + input.InputCompressionType.value + ) + ) + + if input.TableCreationParameters.is_Some: + output["TableCreationParameters"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableCreationParameters( + input.TableCreationParameters.value + ) + ) + + if input.StartTime.is_Some: + output["StartTime"] = TypeError("TimestampShape not supported") + + if input.EndTime.is_Some: + output["EndTime"] = TypeError("TimestampShape not supported") + + if input.ProcessedSizeBytes.is_Some: + output["ProcessedSizeBytes"] = input.ProcessedSizeBytes.value + + if input.ProcessedItemCount.is_Some: + output["ProcessedItemCount"] = input.ProcessedItemCount.value + + if input.ImportedItemCount.is_Some: + output["ImportedItemCount"] = input.ImportedItemCount.value + + if input.FailureCode.is_Some: + output["FailureCode"] = input.FailureCode.value.VerbatimString(False) + + if input.FailureMessage.is_Some: + output["FailureMessage"] = input.FailureMessage.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ImportStatus(input): + # Convert ImportStatus + if isinstance(input, ImportStatus_IN__PROGRESS): + return "IN_PROGRESS" + + elif isinstance(input, ImportStatus_COMPLETED): + return "COMPLETED" + + elif isinstance(input, ImportStatus_CANCELLING): + return "CANCELLING" + + elif isinstance(input, ImportStatus_CANCELLED): + return "CANCELLED" + + elif isinstance(input, ImportStatus_FAILED): + return "FAILED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_S3BucketSource(input): + output = {} + if input.S3BucketOwner.is_Some: + output["S3BucketOwner"] = input.S3BucketOwner.value.VerbatimString(False) + + output["S3Bucket"] = input.S3Bucket.VerbatimString(False) + if input.S3KeyPrefix.is_Some: + output["S3KeyPrefix"] = input.S3KeyPrefix.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_InputFormat(input): + # Convert InputFormat + if isinstance(input, InputFormat_DYNAMODB__JSON): + return "DYNAMODB_JSON" + + elif isinstance(input, InputFormat_ION): + return "ION" + + elif isinstance(input, InputFormat_CSV): + return "CSV" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_InputFormatOptions(input): + output = {} + if input.Csv.is_Some: + output["Csv"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CsvOptions( + input.Csv.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_InputCompressionType(input): + # Convert InputCompressionType + if isinstance(input, InputCompressionType_GZIP): + return "GZIP" + + elif isinstance(input, InputCompressionType_ZSTD): + return "ZSTD" + + elif isinstance(input, InputCompressionType_NONE): + return "NONE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_TableCreationParameters(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["AttributeDefinitions"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input.AttributeDefinitions + ] + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema + ] + if input.BillingMode.is_Some: + output["BillingMode"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.BillingMode.value + ) + ) + + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput.value + ) + ) + + if input.SSESpecification.is_Some: + output["SSESpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSESpecification( + input.SSESpecification.value + ) + ) + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + return output + + +def com_amazonaws_dynamodb_CsvOptions(input): + output = {} + if input.Delimiter.is_Some: + output["Delimiter"] = input.Delimiter.value.VerbatimString(False) + + if input.HeaderList.is_Some: + output["HeaderList"] = [ + list_element.VerbatimString(False) + for list_element in input.HeaderList.value + ] + + return output + + +def com_amazonaws_dynamodb_DescribeImportOutput(input): + output = {} + output["ImportTableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ImportTableDescription( + input.ImportTableDescription + ) + ) + return output + + +def com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_KinesisDataStreamDestination(input): + output = {} + if input.StreamArn.is_Some: + output["StreamArn"] = input.StreamArn.value.VerbatimString(False) + + if input.DestinationStatus.is_Some: + output["DestinationStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DestinationStatus( + input.DestinationStatus.value + ) + ) + + if input.DestinationStatusDescription.is_Some: + output["DestinationStatusDescription"] = ( + input.DestinationStatusDescription.value.VerbatimString(False) + ) + + return output + + +def com_amazonaws_dynamodb_DestinationStatus(input): + # Convert DestinationStatus + if isinstance(input, DestinationStatus_ENABLING): + return "ENABLING" + + elif isinstance(input, DestinationStatus_ACTIVE): + return "ACTIVE" + + elif isinstance(input, DestinationStatus_DISABLING): + return "DISABLING" + + elif isinstance(input, DestinationStatus_DISABLED): + return "DISABLED" + + elif isinstance(input, DestinationStatus_ENABLE__FAILED): + return "ENABLE_FAILED" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.KinesisDataStreamDestinations.is_Some: + output["KinesisDataStreamDestinations"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KinesisDataStreamDestination( + list_element + ) + for list_element in input.KinesisDataStreamDestinations.value + ] + + return output + + +def com_amazonaws_dynamodb_DescribeLimitsInput(input): + output = {} + return output + + +def com_amazonaws_dynamodb_DescribeLimitsOutput(input): + output = {} + if input.AccountMaxReadCapacityUnits.is_Some: + output["AccountMaxReadCapacityUnits"] = input.AccountMaxReadCapacityUnits.value + + if input.AccountMaxWriteCapacityUnits.is_Some: + output["AccountMaxWriteCapacityUnits"] = ( + input.AccountMaxWriteCapacityUnits.value + ) + + if input.TableMaxReadCapacityUnits.is_Some: + output["TableMaxReadCapacityUnits"] = input.TableMaxReadCapacityUnits.value + + if input.TableMaxWriteCapacityUnits.is_Some: + output["TableMaxWriteCapacityUnits"] = input.TableMaxWriteCapacityUnits.value + + return output + + +def com_amazonaws_dynamodb_DescribeTableInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_DescribeTableOutput(input): + output = {} + if input.Table.is_Some: + output["Table"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableDescription( + input.Table.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_TableAutoScalingDescription(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.TableStatus.is_Some: + output["TableStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableStatus( + input.TableStatus.value + ) + ) + + if input.Replicas.is_Some: + output["Replicas"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaAutoScalingDescription( + list_element + ) + for list_element in input.Replicas.value + ] + + return output + + +def com_amazonaws_dynamodb_ReplicaAutoScalingDescription(input): + output = {} + if input.RegionName.is_Some: + output["RegionName"] = input.RegionName.value.VerbatimString(False) + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + if input.ReplicaProvisionedReadCapacityAutoScalingSettings.is_Some: + output["ReplicaProvisionedReadCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ReplicaProvisionedReadCapacityAutoScalingSettings.value + ) + ) + + if input.ReplicaProvisionedWriteCapacityAutoScalingSettings.is_Some: + output["ReplicaProvisionedWriteCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ReplicaProvisionedWriteCapacityAutoScalingSettings.value + ) + ) + + if input.ReplicaStatus.is_Some: + output["ReplicaStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaStatus( + input.ReplicaStatus.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingDescription(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.IndexStatus.is_Some: + output["IndexStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_IndexStatus( + input.IndexStatus.value + ) + ) + + if input.ProvisionedReadCapacityAutoScalingSettings.is_Some: + output["ProvisionedReadCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ProvisionedReadCapacityAutoScalingSettings.value + ) + ) + + if input.ProvisionedWriteCapacityAutoScalingSettings.is_Some: + output["ProvisionedWriteCapacityAutoScalingSettings"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsDescription( + input.ProvisionedWriteCapacityAutoScalingSettings.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput(input): + output = {} + if input.TableAutoScalingDescription.is_Some: + output["TableAutoScalingDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableAutoScalingDescription( + input.TableAutoScalingDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DescribeTimeToLiveInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_DescribeTimeToLiveOutput(input): + output = {} + if input.TimeToLiveDescription.is_Some: + output["TimeToLiveDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TimeToLiveDescription( + input.TimeToLiveDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["StreamArn"] = input.StreamArn.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.StreamArn.is_Some: + output["StreamArn"] = input.StreamArn.value.VerbatimString(False) + + if input.DestinationStatus.is_Some: + output["DestinationStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DestinationStatus( + input.DestinationStatus.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["StreamArn"] = input.StreamArn.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.StreamArn.is_Some: + output["StreamArn"] = input.StreamArn.value.VerbatimString(False) + + if input.DestinationStatus.is_Some: + output["DestinationStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DestinationStatus( + input.DestinationStatus.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ExecuteStatementInput(input): + output = {} + output["Statement"] = input.Statement.VerbatimString(False) + if input.Parameters.is_Some: + output["Parameters"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input.Parameters.value + ] + + if input.ConsistentRead.is_Some: + output["ConsistentRead"] = input.ConsistentRead.value + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.Limit.is_Some: + output["Limit"] = input.Limit.value + + return output + + +def com_amazonaws_dynamodb_ExecuteStatementOutput(input): + output = {} + if input.Items.is_Some: + output["Items"] = [ + { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items + } + for list_element in input.Items.value + ] + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + input.ConsumedCapacity.value + ) + ) + + if input.LastEvaluatedKey.is_Some: + output["LastEvaluatedKey"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.LastEvaluatedKey.value.items + } + + return output + + +def com_amazonaws_dynamodb_ParameterizedStatement(input): + output = {} + output["Statement"] = input.Statement.VerbatimString(False) + if input.Parameters.is_Some: + output["Parameters"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input.Parameters.value + ] + + return output + + +def com_amazonaws_dynamodb_ExecuteTransactionInput(input): + output = {} + output["TransactStatements"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ParameterizedStatement( + list_element + ) + for list_element in input.TransactStatements + ] + if input.ClientRequestToken.is_Some: + output["ClientRequestToken"] = input.ClientRequestToken.value.VerbatimString( + False + ) + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ItemResponse(input): + output = {} + if input.Item.is_Some: + output["Item"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Item.value.items + } + + return output + + +def com_amazonaws_dynamodb_ExecuteTransactionOutput(input): + output = {} + if input.Responses.is_Some: + output["Responses"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ItemResponse( + list_element + ) + for list_element in input.Responses.value + ] + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input.ConsumedCapacity.value + ] + + return output + + +def com_amazonaws_dynamodb_ExportTableToPointInTimeInput(input): + output = {} + output["TableArn"] = input.TableArn.VerbatimString(False) + if input.ExportTime.is_Some: + output["ExportTime"] = TypeError("TimestampShape not supported") + + if input.ClientToken.is_Some: + output["ClientToken"] = input.ClientToken.value.VerbatimString(False) + + output["S3Bucket"] = input.S3Bucket.VerbatimString(False) + if input.S3BucketOwner.is_Some: + output["S3BucketOwner"] = input.S3BucketOwner.value.VerbatimString(False) + + if input.S3Prefix.is_Some: + output["S3Prefix"] = input.S3Prefix.value.VerbatimString(False) + + if input.S3SseAlgorithm.is_Some: + output["S3SseAlgorithm"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_S3SseAlgorithm( + input.S3SseAlgorithm.value + ) + ) + + if input.S3SseKmsKeyId.is_Some: + output["S3SseKmsKeyId"] = input.S3SseKmsKeyId.value.VerbatimString(False) + + if input.ExportFormat.is_Some: + output["ExportFormat"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportFormat( + input.ExportFormat.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ExportTableToPointInTimeOutput(input): + output = {} + if input.ExportDescription.is_Some: + output["ExportDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportDescription( + input.ExportDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_GetItemInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + if input.AttributesToGet.is_Some: + output["AttributesToGet"] = [ + list_element.VerbatimString(False) + for list_element in input.AttributesToGet.value + ] + + if input.ConsistentRead.is_Some: + output["ConsistentRead"] = input.ConsistentRead.value + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.ProjectionExpression.is_Some: + output["ProjectionExpression"] = ( + input.ProjectionExpression.value.VerbatimString(False) + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + return output + + +def com_amazonaws_dynamodb_GetItemOutput(input): + output = {} + if input.Item.is_Some: + output["Item"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Item.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + input.ConsumedCapacity.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ImportTableInput(input): + output = {} + if input.ClientToken.is_Some: + output["ClientToken"] = input.ClientToken.value.VerbatimString(False) + + output["S3BucketSource"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_S3BucketSource( + input.S3BucketSource + ) + ) + output["InputFormat"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_InputFormat( + input.InputFormat + ) + ) + if input.InputFormatOptions.is_Some: + output["InputFormatOptions"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_InputFormatOptions( + input.InputFormatOptions.value + ) + ) + + if input.InputCompressionType.is_Some: + output["InputCompressionType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_InputCompressionType( + input.InputCompressionType.value + ) + ) + + output["TableCreationParameters"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableCreationParameters( + input.TableCreationParameters + ) + ) + return output + + +def com_amazonaws_dynamodb_ImportTableOutput(input): + output = {} + output["ImportTableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ImportTableDescription( + input.ImportTableDescription + ) + ) + return output + + +def com_amazonaws_dynamodb_BackupTypeFilter(input): + # Convert BackupTypeFilter + if isinstance(input, BackupTypeFilter_USER): + return "USER" + + elif isinstance(input, BackupTypeFilter_SYSTEM): + return "SYSTEM" + + elif isinstance(input, BackupTypeFilter_AWS__BACKUP): + return "AWS_BACKUP" + + elif isinstance(input, BackupTypeFilter_ALL): + return "ALL" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_ListBackupsInput(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.Limit.is_Some: + output["Limit"] = input.Limit.value + + if input.TimeRangeLowerBound.is_Some: + output["TimeRangeLowerBound"] = TypeError("TimestampShape not supported") + + if input.TimeRangeUpperBound.is_Some: + output["TimeRangeUpperBound"] = TypeError("TimestampShape not supported") + + if input.ExclusiveStartBackupArn.is_Some: + output["ExclusiveStartBackupArn"] = ( + input.ExclusiveStartBackupArn.value.VerbatimString(False) + ) + + if input.BackupType.is_Some: + output["BackupType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupTypeFilter( + input.BackupType.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_BackupSummary(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.TableId.is_Some: + output["TableId"] = input.TableId.value.VerbatimString(False) + + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.BackupArn.is_Some: + output["BackupArn"] = input.BackupArn.value.VerbatimString(False) + + if input.BackupName.is_Some: + output["BackupName"] = input.BackupName.value.VerbatimString(False) + + if input.BackupCreationDateTime.is_Some: + output["BackupCreationDateTime"] = TypeError("TimestampShape not supported") + + if input.BackupExpiryDateTime.is_Some: + output["BackupExpiryDateTime"] = TypeError("TimestampShape not supported") + + if input.BackupStatus.is_Some: + output["BackupStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupStatus( + input.BackupStatus.value + ) + ) + + if input.BackupType.is_Some: + output["BackupType"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupType( + input.BackupType.value + ) + ) + + if input.BackupSizeBytes.is_Some: + output["BackupSizeBytes"] = input.BackupSizeBytes.value + + return output + + +def com_amazonaws_dynamodb_ListBackupsOutput(input): + output = {} + if input.BackupSummaries.is_Some: + output["BackupSummaries"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BackupSummary( + list_element + ) + for list_element in input.BackupSummaries.value + ] + + if input.LastEvaluatedBackupArn.is_Some: + output["LastEvaluatedBackupArn"] = ( + input.LastEvaluatedBackupArn.value.VerbatimString(False) + ) + + return output + + +def com_amazonaws_dynamodb_ListContributorInsightsInput(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + if input.MaxResults.is_Some: + output["MaxResults"] = input.MaxResults.value + + return output + + +def com_amazonaws_dynamodb_ContributorInsightsSummary(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.ContributorInsightsStatus.is_Some: + output["ContributorInsightsStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContributorInsightsStatus( + input.ContributorInsightsStatus.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ListContributorInsightsOutput(input): + output = {} + if input.ContributorInsightsSummaries.is_Some: + output["ContributorInsightsSummaries"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContributorInsightsSummary( + list_element + ) + for list_element in input.ContributorInsightsSummaries.value + ] + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ListExportsInput(input): + output = {} + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.MaxResults.is_Some: + output["MaxResults"] = input.MaxResults.value + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ExportSummary(input): + output = {} + if input.ExportArn.is_Some: + output["ExportArn"] = input.ExportArn.value.VerbatimString(False) + + if input.ExportStatus.is_Some: + output["ExportStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportStatus( + input.ExportStatus.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ListExportsOutput(input): + output = {} + if input.ExportSummaries.is_Some: + output["ExportSummaries"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportSummary( + list_element + ) + for list_element in input.ExportSummaries.value + ] + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ListGlobalTablesInput(input): + output = {} + if input.ExclusiveStartGlobalTableName.is_Some: + output["ExclusiveStartGlobalTableName"] = ( + input.ExclusiveStartGlobalTableName.value.VerbatimString(False) + ) + + if input.Limit.is_Some: + output["Limit"] = input.Limit.value + + if input.RegionName.is_Some: + output["RegionName"] = input.RegionName.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_GlobalTable(input): + output = {} + if input.GlobalTableName.is_Some: + output["GlobalTableName"] = input.GlobalTableName.value.VerbatimString(False) + + if input.ReplicationGroup.is_Some: + output["ReplicationGroup"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Replica( + list_element + ) + for list_element in input.ReplicationGroup.value + ] + + return output + + +def com_amazonaws_dynamodb_ListGlobalTablesOutput(input): + output = {} + if input.GlobalTables.is_Some: + output["GlobalTables"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalTable( + list_element + ) + for list_element in input.GlobalTables.value + ] + + if input.LastEvaluatedGlobalTableName.is_Some: + output["LastEvaluatedGlobalTableName"] = ( + input.LastEvaluatedGlobalTableName.value.VerbatimString(False) + ) + + return output + + +def com_amazonaws_dynamodb_ListImportsInput(input): + output = {} + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.PageSize.is_Some: + output["PageSize"] = input.PageSize.value + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ImportSummary(input): + output = {} + if input.ImportArn.is_Some: + output["ImportArn"] = input.ImportArn.value.VerbatimString(False) + + if input.ImportStatus.is_Some: + output["ImportStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ImportStatus( + input.ImportStatus.value + ) + ) + + if input.TableArn.is_Some: + output["TableArn"] = input.TableArn.value.VerbatimString(False) + + if input.S3BucketSource.is_Some: + output["S3BucketSource"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_S3BucketSource( + input.S3BucketSource.value + ) + ) + + if input.CloudWatchLogGroupArn.is_Some: + output["CloudWatchLogGroupArn"] = ( + input.CloudWatchLogGroupArn.value.VerbatimString(False) + ) + + if input.InputFormat.is_Some: + output["InputFormat"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_InputFormat( + input.InputFormat.value + ) + ) + + if input.StartTime.is_Some: + output["StartTime"] = TypeError("TimestampShape not supported") + + if input.EndTime.is_Some: + output["EndTime"] = TypeError("TimestampShape not supported") + + return output + + +def com_amazonaws_dynamodb_ListImportsOutput(input): + output = {} + if input.ImportSummaryList.is_Some: + output["ImportSummaryList"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ImportSummary( + list_element + ) + for list_element in input.ImportSummaryList.value + ] + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ListTablesInput(input): + output = {} + if input.ExclusiveStartTableName.is_Some: + output["ExclusiveStartTableName"] = ( + input.ExclusiveStartTableName.value.VerbatimString(False) + ) + + if input.Limit.is_Some: + output["Limit"] = input.Limit.value + + return output + + +def com_amazonaws_dynamodb_ListTablesOutput(input): + output = {} + if input.TableNames.is_Some: + output["TableNames"] = [ + list_element.VerbatimString(False) + for list_element in input.TableNames.value + ] + + if input.LastEvaluatedTableName.is_Some: + output["LastEvaluatedTableName"] = ( + input.LastEvaluatedTableName.value.VerbatimString(False) + ) + + return output + + +def com_amazonaws_dynamodb_ListTagsOfResourceInput(input): + output = {} + output["ResourceArn"] = input.ResourceArn.VerbatimString(False) + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_ListTagsOfResourceOutput(input): + output = {} + if input.Tags.is_Some: + output["Tags"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Tag( + list_element + ) + for list_element in input.Tags.value + ] + + if input.NextToken.is_Some: + output["NextToken"] = input.NextToken.value.VerbatimString(False) + + return output + + +def com_amazonaws_dynamodb_PutItemInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["Item"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Item.items + } + if input.Expected.is_Some: + output["Expected"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExpectedAttributeValue( + value + ) + for (key, value) in input.Expected.value.items + } + + if input.ReturnValues.is_Some: + output["ReturnValues"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnValue( + input.ReturnValues.value + ) + ) + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.ReturnItemCollectionMetrics.is_Some: + output["ReturnItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input.ReturnItemCollectionMetrics.value + ) + ) + + if input.ConditionalOperator.is_Some: + output["ConditionalOperator"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConditionalOperator( + input.ConditionalOperator.value + ) + ) + + if input.ConditionExpression.is_Some: + output["ConditionExpression"] = input.ConditionExpression.value.VerbatimString( + False + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + return output + + +def com_amazonaws_dynamodb_PutItemOutput(input): + output = {} + if input.Attributes.is_Some: + output["Attributes"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Attributes.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + input.ConsumedCapacity.value + ) + ) + + if input.ItemCollectionMetrics.is_Some: + output["ItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ItemCollectionMetrics( + input.ItemCollectionMetrics.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_Select(input): + # Convert Select + if isinstance(input, Select_ALL__ATTRIBUTES): + return "ALL_ATTRIBUTES" + + elif isinstance(input, Select_ALL__PROJECTED__ATTRIBUTES): + return "ALL_PROJECTED_ATTRIBUTES" + + elif isinstance(input, Select_SPECIFIC__ATTRIBUTES): + return "SPECIFIC_ATTRIBUTES" + + elif isinstance(input, Select_COUNT): + return "COUNT" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_Condition(input): + output = {} + if input.AttributeValueList.is_Some: + output["AttributeValueList"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + list_element + ) + for list_element in input.AttributeValueList.value + ] + + output["ComparisonOperator"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ComparisonOperator( + input.ComparisonOperator + ) + ) + return output + + +def com_amazonaws_dynamodb_QueryInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.Select.is_Some: + output["Select"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Select( + input.Select.value + ) + ) + + if input.AttributesToGet.is_Some: + output["AttributesToGet"] = [ + list_element.VerbatimString(False) + for list_element in input.AttributesToGet.value + ] + + if input.Limit.is_Some: + output["Limit"] = input.Limit.value + + if input.ConsistentRead.is_Some: + output["ConsistentRead"] = input.ConsistentRead.value + + if input.KeyConditions.is_Some: + output["KeyConditions"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Condition( + value + ) + for (key, value) in input.KeyConditions.value.items + } + + if input.QueryFilter.is_Some: + output["QueryFilter"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Condition( + value + ) + for (key, value) in input.QueryFilter.value.items + } + + if input.ConditionalOperator.is_Some: + output["ConditionalOperator"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConditionalOperator( + input.ConditionalOperator.value + ) + ) + + if input.ScanIndexForward.is_Some: + output["ScanIndexForward"] = input.ScanIndexForward.value + + if input.ExclusiveStartKey.is_Some: + output["ExclusiveStartKey"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExclusiveStartKey.value.items + } + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.ProjectionExpression.is_Some: + output["ProjectionExpression"] = ( + input.ProjectionExpression.value.VerbatimString(False) + ) + + if input.FilterExpression.is_Some: + output["FilterExpression"] = input.FilterExpression.value.VerbatimString(False) + + if input.KeyConditionExpression.is_Some: + output["KeyConditionExpression"] = ( + input.KeyConditionExpression.value.VerbatimString(False) + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + return output + + +def com_amazonaws_dynamodb_QueryOutput(input): + output = {} + if input.Items.is_Some: + output["Items"] = [ + { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items + } + for list_element in input.Items.value + ] + + if input.Count.is_Some: + output["Count"] = input.Count.value + + if input.ScannedCount.is_Some: + output["ScannedCount"] = input.ScannedCount.value + + if input.LastEvaluatedKey.is_Some: + output["LastEvaluatedKey"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.LastEvaluatedKey.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + input.ConsumedCapacity.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_RestoreTableFromBackupInput(input): + output = {} + output["TargetTableName"] = input.TargetTableName.VerbatimString(False) + output["BackupArn"] = input.BackupArn.VerbatimString(False) + if input.BillingModeOverride.is_Some: + output["BillingModeOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.BillingModeOverride.value + ) + ) + + if input.GlobalSecondaryIndexOverride.is_Some: + output["GlobalSecondaryIndexOverride"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input.GlobalSecondaryIndexOverride.value + ] + + if input.LocalSecondaryIndexOverride.is_Some: + output["LocalSecondaryIndexOverride"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_LocalSecondaryIndex( + list_element + ) + for list_element in input.LocalSecondaryIndexOverride.value + ] + + if input.ProvisionedThroughputOverride.is_Some: + output["ProvisionedThroughputOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughputOverride.value + ) + ) + + if input.SSESpecificationOverride.is_Some: + output["SSESpecificationOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSESpecification( + input.SSESpecificationOverride.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_RestoreTableFromBackupOutput(input): + output = {} + if input.TableDescription.is_Some: + output["TableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableDescription( + input.TableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_RestoreTableToPointInTimeInput(input): + output = {} + if input.SourceTableArn.is_Some: + output["SourceTableArn"] = input.SourceTableArn.value.VerbatimString(False) + + if input.SourceTableName.is_Some: + output["SourceTableName"] = input.SourceTableName.value.VerbatimString(False) + + output["TargetTableName"] = input.TargetTableName.VerbatimString(False) + if input.UseLatestRestorableTime.is_Some: + output["UseLatestRestorableTime"] = input.UseLatestRestorableTime.value + + if input.RestoreDateTime.is_Some: + output["RestoreDateTime"] = TypeError("TimestampShape not supported") + + if input.BillingModeOverride.is_Some: + output["BillingModeOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.BillingModeOverride.value + ) + ) + + if input.GlobalSecondaryIndexOverride.is_Some: + output["GlobalSecondaryIndexOverride"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndex( + list_element + ) + for list_element in input.GlobalSecondaryIndexOverride.value + ] + + if input.LocalSecondaryIndexOverride.is_Some: + output["LocalSecondaryIndexOverride"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_LocalSecondaryIndex( + list_element + ) + for list_element in input.LocalSecondaryIndexOverride.value + ] + + if input.ProvisionedThroughputOverride.is_Some: + output["ProvisionedThroughputOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughputOverride.value + ) + ) + + if input.SSESpecificationOverride.is_Some: + output["SSESpecificationOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSESpecification( + input.SSESpecificationOverride.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput(input): + output = {} + if input.TableDescription.is_Some: + output["TableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableDescription( + input.TableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ScanInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.AttributesToGet.is_Some: + output["AttributesToGet"] = [ + list_element.VerbatimString(False) + for list_element in input.AttributesToGet.value + ] + + if input.Limit.is_Some: + output["Limit"] = input.Limit.value + + if input.Select.is_Some: + output["Select"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Select( + input.Select.value + ) + ) + + if input.ScanFilter.is_Some: + output["ScanFilter"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Condition( + value + ) + for (key, value) in input.ScanFilter.value.items + } + + if input.ConditionalOperator.is_Some: + output["ConditionalOperator"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConditionalOperator( + input.ConditionalOperator.value + ) + ) + + if input.ExclusiveStartKey.is_Some: + output["ExclusiveStartKey"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExclusiveStartKey.value.items + } + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.TotalSegments.is_Some: + output["TotalSegments"] = input.TotalSegments.value + + if input.Segment.is_Some: + output["Segment"] = input.Segment.value + + if input.ProjectionExpression.is_Some: + output["ProjectionExpression"] = ( + input.ProjectionExpression.value.VerbatimString(False) + ) + + if input.FilterExpression.is_Some: + output["FilterExpression"] = input.FilterExpression.value.VerbatimString(False) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + if input.ConsistentRead.is_Some: + output["ConsistentRead"] = input.ConsistentRead.value + + return output + + +def com_amazonaws_dynamodb_ScanOutput(input): + output = {} + if input.Items.is_Some: + output["Items"] = [ + { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in list_element.items + } + for list_element in input.Items.value + ] + + if input.Count.is_Some: + output["Count"] = input.Count.value + + if input.ScannedCount.is_Some: + output["ScannedCount"] = input.ScannedCount.value + + if input.LastEvaluatedKey.is_Some: + output["LastEvaluatedKey"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.LastEvaluatedKey.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + input.ConsumedCapacity.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_TagResourceInput(input): + output = {} + output["ResourceArn"] = input.ResourceArn.VerbatimString(False) + output["Tags"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Tag( + list_element + ) + for list_element in input.Tags + ] + return output + + +def com_amazonaws_dynamodb_TransactGetItem(input): + output = {} + output["Get"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Get( + input.Get + ) + ) + return output + + +def com_amazonaws_dynamodb_Get(input): + output = {} + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + output["TableName"] = input.TableName.VerbatimString(False) + if input.ProjectionExpression.is_Some: + output["ProjectionExpression"] = ( + input.ProjectionExpression.value.VerbatimString(False) + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + return output + + +def com_amazonaws_dynamodb_TransactGetItemsInput(input): + output = {} + output["TransactItems"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TransactGetItem( + list_element + ) + for list_element in input.TransactItems + ] + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_TransactGetItemsOutput(input): + output = {} + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input.ConsumedCapacity.value + ] + + if input.Responses.is_Some: + output["Responses"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ItemResponse( + list_element + ) + for list_element in input.Responses.value + ] + + return output + + +def com_amazonaws_dynamodb_TransactWriteItem(input): + output = {} + if input.ConditionCheck.is_Some: + output["ConditionCheck"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConditionCheck( + input.ConditionCheck.value + ) + ) + + if input.Put.is_Some: + output["Put"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Put( + input.Put.value + ) + ) + + if input.Delete.is_Some: + output["Delete"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Delete( + input.Delete.value + ) + ) + + if input.Update.is_Some: + output["Update"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Update( + input.Update.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ConditionCheck(input): + output = {} + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + output["TableName"] = input.TableName.VerbatimString(False) + output["ConditionExpression"] = input.ConditionExpression.VerbatimString(False) + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + if input.ReturnValuesOnConditionCheckFailure.is_Some: + output["ReturnValuesOnConditionCheckFailure"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input.ReturnValuesOnConditionCheckFailure.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_Put(input): + output = {} + output["Item"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Item.items + } + output["TableName"] = input.TableName.VerbatimString(False) + if input.ConditionExpression.is_Some: + output["ConditionExpression"] = input.ConditionExpression.value.VerbatimString( + False + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + if input.ReturnValuesOnConditionCheckFailure.is_Some: + output["ReturnValuesOnConditionCheckFailure"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input.ReturnValuesOnConditionCheckFailure.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_Delete(input): + output = {} + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + output["TableName"] = input.TableName.VerbatimString(False) + if input.ConditionExpression.is_Some: + output["ConditionExpression"] = input.ConditionExpression.value.VerbatimString( + False + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + if input.ReturnValuesOnConditionCheckFailure.is_Some: + output["ReturnValuesOnConditionCheckFailure"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input.ReturnValuesOnConditionCheckFailure.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_Update(input): + output = {} + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + output["UpdateExpression"] = input.UpdateExpression.VerbatimString(False) + output["TableName"] = input.TableName.VerbatimString(False) + if input.ConditionExpression.is_Some: + output["ConditionExpression"] = input.ConditionExpression.value.VerbatimString( + False + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + if input.ReturnValuesOnConditionCheckFailure.is_Some: + output["ReturnValuesOnConditionCheckFailure"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure( + input.ReturnValuesOnConditionCheckFailure.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ReturnValuesOnConditionCheckFailure(input): + # Convert ReturnValuesOnConditionCheckFailure + if isinstance(input, ReturnValuesOnConditionCheckFailure_ALL__OLD): + return "ALL_OLD" + + elif isinstance(input, ReturnValuesOnConditionCheckFailure_NONE): + return "NONE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_TransactWriteItemsInput(input): + output = {} + output["TransactItems"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TransactWriteItem( + list_element + ) + for list_element in input.TransactItems + ] + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.ReturnItemCollectionMetrics.is_Some: + output["ReturnItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input.ReturnItemCollectionMetrics.value + ) + ) + + if input.ClientRequestToken.is_Some: + output["ClientRequestToken"] = input.ClientRequestToken.value.VerbatimString( + False + ) + + return output + + +def com_amazonaws_dynamodb_TransactWriteItemsOutput(input): + output = {} + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + list_element + ) + for list_element in input.ConsumedCapacity.value + ] + + if input.ItemCollectionMetrics.is_Some: + output["ItemCollectionMetrics"] = { + key.VerbatimString(False): [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ItemCollectionMetrics( + list_element + ) + for list_element in value + ] + for (key, value) in input.ItemCollectionMetrics.value.items + } + + return output + + +def com_amazonaws_dynamodb_UntagResourceInput(input): + output = {} + output["ResourceArn"] = input.ResourceArn.VerbatimString(False) + output["TagKeys"] = [ + list_element.VerbatimString(False) for list_element in input.TagKeys + ] + return output + + +def com_amazonaws_dynamodb_PointInTimeRecoverySpecification(input): + output = {} + output["PointInTimeRecoveryEnabled"] = input.PointInTimeRecoveryEnabled + return output + + +def com_amazonaws_dynamodb_UpdateContinuousBackupsInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["PointInTimeRecoverySpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_PointInTimeRecoverySpecification( + input.PointInTimeRecoverySpecification + ) + ) + return output + + +def com_amazonaws_dynamodb_UpdateContinuousBackupsOutput(input): + output = {} + if input.ContinuousBackupsDescription.is_Some: + output["ContinuousBackupsDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContinuousBackupsDescription( + input.ContinuousBackupsDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ContributorInsightsAction(input): + # Convert ContributorInsightsAction + if isinstance(input, ContributorInsightsAction_ENABLE): + return "ENABLE" + + elif isinstance(input, ContributorInsightsAction_DISABLE): + return "DISABLE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_UpdateContributorInsightsInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + output["ContributorInsightsAction"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContributorInsightsAction( + input.ContributorInsightsAction + ) + ) + return output + + +def com_amazonaws_dynamodb_UpdateContributorInsightsOutput(input): + output = {} + if input.TableName.is_Some: + output["TableName"] = input.TableName.value.VerbatimString(False) + + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.ContributorInsightsStatus.is_Some: + output["ContributorInsightsStatus"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ContributorInsightsStatus( + input.ContributorInsightsStatus.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ReplicaUpdate(input): + output = {} + if input.Create.is_Some: + output["Create"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CreateReplicaAction( + input.Create.value + ) + ) + + if input.Delete.is_Some: + output["Delete"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DeleteReplicaAction( + input.Delete.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_CreateReplicaAction(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_DeleteReplicaAction(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_UpdateGlobalTableInput(input): + output = {} + output["GlobalTableName"] = input.GlobalTableName.VerbatimString(False) + output["ReplicaUpdates"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaUpdate( + list_element + ) + for list_element in input.ReplicaUpdates + ] + return output + + +def com_amazonaws_dynamodb_UpdateGlobalTableOutput(input): + output = {} + if input.GlobalTableDescription.is_Some: + output["GlobalTableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalTableDescription( + input.GlobalTableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_AutoScalingSettingsUpdate(input): + output = {} + if input.MinimumUnits.is_Some: + output["MinimumUnits"] = input.MinimumUnits.value + + if input.MaximumUnits.is_Some: + output["MaximumUnits"] = input.MaximumUnits.value + + if input.AutoScalingDisabled.is_Some: + output["AutoScalingDisabled"] = input.AutoScalingDisabled.value + + if input.AutoScalingRoleArn.is_Some: + output["AutoScalingRoleArn"] = input.AutoScalingRoleArn.value.VerbatimString( + False + ) + + if input.ScalingPolicyUpdate.is_Some: + output["ScalingPolicyUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingPolicyUpdate( + input.ScalingPolicyUpdate.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_AutoScalingPolicyUpdate(input): + output = {} + if input.PolicyName.is_Some: + output["PolicyName"] = input.PolicyName.value.VerbatimString(False) + + output["TargetTrackingScalingPolicyConfiguration"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( + input.TargetTrackingScalingPolicyConfiguration + ) + ) + return output + + +def com_amazonaws_dynamodb_AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( + input, +): + output = {} + if input.DisableScaleIn.is_Some: + output["DisableScaleIn"] = input.DisableScaleIn.value + + if input.ScaleInCooldown.is_Some: + output["ScaleInCooldown"] = input.ScaleInCooldown.value + + if input.ScaleOutCooldown.is_Some: + output["ScaleOutCooldown"] = input.ScaleOutCooldown.value + + output["TargetValue"] = input.TargetValue + return output + + +def com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + if input.ProvisionedWriteCapacityUnits.is_Some: + output["ProvisionedWriteCapacityUnits"] = ( + input.ProvisionedWriteCapacityUnits.value + ) + + if input.ProvisionedWriteCapacityAutoScalingSettingsUpdate.is_Some: + output["ProvisionedWriteCapacityAutoScalingSettingsUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingSettingsUpdate.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ReplicaSettingsUpdate(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + if input.ReplicaProvisionedReadCapacityUnits.is_Some: + output["ReplicaProvisionedReadCapacityUnits"] = ( + input.ReplicaProvisionedReadCapacityUnits.value + ) + + if input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate.is_Some: + output["ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate.value + ) + ) + + if input.ReplicaGlobalSecondaryIndexSettingsUpdate.is_Some: + output["ReplicaGlobalSecondaryIndexSettingsUpdate"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate( + list_element + ) + for list_element in input.ReplicaGlobalSecondaryIndexSettingsUpdate.value + ] + + if input.ReplicaTableClass.is_Some: + output["ReplicaTableClass"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClass( + input.ReplicaTableClass.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexSettingsUpdate(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + if input.ProvisionedReadCapacityUnits.is_Some: + output["ProvisionedReadCapacityUnits"] = ( + input.ProvisionedReadCapacityUnits.value + ) + + if input.ProvisionedReadCapacityAutoScalingSettingsUpdate.is_Some: + output["ProvisionedReadCapacityAutoScalingSettingsUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.ProvisionedReadCapacityAutoScalingSettingsUpdate.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput(input): + output = {} + output["GlobalTableName"] = input.GlobalTableName.VerbatimString(False) + if input.GlobalTableBillingMode.is_Some: + output["GlobalTableBillingMode"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.GlobalTableBillingMode.value + ) + ) + + if input.GlobalTableProvisionedWriteCapacityUnits.is_Some: + output["GlobalTableProvisionedWriteCapacityUnits"] = ( + input.GlobalTableProvisionedWriteCapacityUnits.value + ) + + if input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate.is_Some: + output["GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate.value + ) + ) + + if input.GlobalTableGlobalSecondaryIndexSettingsUpdate.is_Some: + output["GlobalTableGlobalSecondaryIndexSettingsUpdate"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalTableGlobalSecondaryIndexSettingsUpdate( + list_element + ) + for list_element in input.GlobalTableGlobalSecondaryIndexSettingsUpdate.value + ] + + if input.ReplicaSettingsUpdate.is_Some: + output["ReplicaSettingsUpdate"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaSettingsUpdate( + list_element + ) + for list_element in input.ReplicaSettingsUpdate.value + ] + + return output + + +def com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput(input): + output = {} + if input.GlobalTableName.is_Some: + output["GlobalTableName"] = input.GlobalTableName.value.VerbatimString(False) + + if input.ReplicaSettings.is_Some: + output["ReplicaSettings"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaSettingsDescription( + list_element + ) + for list_element in input.ReplicaSettings.value + ] + + return output + + +def com_amazonaws_dynamodb_AttributeValueUpdate(input): + output = {} + if input.Value.is_Some: + output["Value"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + input.Value.value + ) + ) + + if input.Action.is_Some: + output["Action"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeAction( + input.Action.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_AttributeAction(input): + # Convert AttributeAction + if isinstance(input, AttributeAction_ADD): + return "ADD" + + elif isinstance(input, AttributeAction_PUT): + return "PUT" + + elif isinstance(input, AttributeAction_DELETE): + return "DELETE" + + else: + raise ValueError("No recognized enum value in enum type: " + input) + + +def com_amazonaws_dynamodb_UpdateItemInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["Key"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Key.items + } + if input.AttributeUpdates.is_Some: + output["AttributeUpdates"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValueUpdate( + value + ) + for (key, value) in input.AttributeUpdates.value.items + } + + if input.Expected.is_Some: + output["Expected"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExpectedAttributeValue( + value + ) + for (key, value) in input.Expected.value.items + } + + if input.ConditionalOperator.is_Some: + output["ConditionalOperator"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConditionalOperator( + input.ConditionalOperator.value + ) + ) + + if input.ReturnValues.is_Some: + output["ReturnValues"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnValue( + input.ReturnValues.value + ) + ) + + if input.ReturnConsumedCapacity.is_Some: + output["ReturnConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnConsumedCapacity( + input.ReturnConsumedCapacity.value + ) + ) + + if input.ReturnItemCollectionMetrics.is_Some: + output["ReturnItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReturnItemCollectionMetrics( + input.ReturnItemCollectionMetrics.value + ) + ) + + if input.UpdateExpression.is_Some: + output["UpdateExpression"] = input.UpdateExpression.value.VerbatimString(False) + + if input.ConditionExpression.is_Some: + output["ConditionExpression"] = input.ConditionExpression.value.VerbatimString( + False + ) + + if input.ExpressionAttributeNames.is_Some: + output["ExpressionAttributeNames"] = { + key.VerbatimString(False): value.VerbatimString(False) + for (key, value) in input.ExpressionAttributeNames.value.items + } + + if input.ExpressionAttributeValues.is_Some: + output["ExpressionAttributeValues"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.ExpressionAttributeValues.value.items + } + + return output + + +def com_amazonaws_dynamodb_UpdateItemOutput(input): + output = {} + if input.Attributes.is_Some: + output["Attributes"] = { + key.VerbatimString( + False + ): com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeValue( + value + ) + for (key, value) in input.Attributes.value.items + } + + if input.ConsumedCapacity.is_Some: + output["ConsumedCapacity"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ConsumedCapacity( + input.ConsumedCapacity.value + ) + ) + + if input.ItemCollectionMetrics.is_Some: + output["ItemCollectionMetrics"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ItemCollectionMetrics( + input.ItemCollectionMetrics.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate(input): + output = {} + if input.Update.is_Some: + output["Update"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction( + input.Update.value + ) + ) + + if input.Create.is_Some: + output["Create"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction( + input.Create.value + ) + ) + + if input.Delete.is_Some: + output["Delete"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction( + input.Delete.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_UpdateGlobalSecondaryIndexAction(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput + ) + ) + return output + + +def com_amazonaws_dynamodb_CreateGlobalSecondaryIndexAction(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + output["KeySchema"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_KeySchemaElement( + list_element + ) + for list_element in input.KeySchema + ] + output["Projection"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_Projection( + input.Projection + ) + ) + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DeleteGlobalSecondaryIndexAction(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_ReplicationGroupUpdate(input): + output = {} + if input.Create.is_Some: + output["Create"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CreateReplicationGroupMemberAction( + input.Create.value + ) + ) + + if input.Update.is_Some: + output["Update"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction( + input.Update.value + ) + ) + + if input.Delete.is_Some: + output["Delete"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction( + input.Delete.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_CreateReplicationGroupMemberAction(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + if input.KMSMasterKeyId.is_Some: + output["KMSMasterKeyId"] = input.KMSMasterKeyId.value.VerbatimString(False) + + if input.ProvisionedThroughputOverride.is_Some: + output["ProvisionedThroughputOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride.value + ) + ) + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + if input.TableClassOverride.is_Some: + output["TableClassOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClass( + input.TableClassOverride.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_UpdateReplicationGroupMemberAction(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + if input.KMSMasterKeyId.is_Some: + output["KMSMasterKeyId"] = input.KMSMasterKeyId.value.VerbatimString(False) + + if input.ProvisionedThroughputOverride.is_Some: + output["ProvisionedThroughputOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride.value + ) + ) + + if input.GlobalSecondaryIndexes.is_Some: + output["GlobalSecondaryIndexes"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex( + list_element + ) + for list_element in input.GlobalSecondaryIndexes.value + ] + + if input.TableClassOverride.is_Some: + output["TableClassOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClass( + input.TableClassOverride.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_DeleteReplicationGroupMemberAction(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndex(input): + output = {} + output["IndexName"] = input.IndexName.VerbatimString(False) + if input.ProvisionedThroughputOverride.is_Some: + output["ProvisionedThroughputOverride"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_UpdateTableInput(input): + output = {} + if input.AttributeDefinitions.is_Some: + output["AttributeDefinitions"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AttributeDefinition( + list_element + ) + for list_element in input.AttributeDefinitions.value + ] + + output["TableName"] = input.TableName.VerbatimString(False) + if input.BillingMode.is_Some: + output["BillingMode"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BillingMode( + input.BillingMode.value + ) + ) + + if input.ProvisionedThroughput.is_Some: + output["ProvisionedThroughput"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ProvisionedThroughput( + input.ProvisionedThroughput.value + ) + ) + + if input.GlobalSecondaryIndexUpdates.is_Some: + output["GlobalSecondaryIndexUpdates"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndexUpdate( + list_element + ) + for list_element in input.GlobalSecondaryIndexUpdates.value + ] + + if input.StreamSpecification.is_Some: + output["StreamSpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_StreamSpecification( + input.StreamSpecification.value + ) + ) + + if input.SSESpecification.is_Some: + output["SSESpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_SSESpecification( + input.SSESpecification.value + ) + ) + + if input.ReplicaUpdates.is_Some: + output["ReplicaUpdates"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicationGroupUpdate( + list_element + ) + for list_element in input.ReplicaUpdates.value + ] + + if input.TableClass.is_Some: + output["TableClass"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableClass( + input.TableClass.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_UpdateTableOutput(input): + output = {} + if input.TableDescription.is_Some: + output["TableDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableDescription( + input.TableDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.ProvisionedWriteCapacityAutoScalingUpdate.is_Some: + output["ProvisionedWriteCapacityAutoScalingUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingUpdate.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ReplicaAutoScalingUpdate(input): + output = {} + output["RegionName"] = input.RegionName.VerbatimString(False) + if input.ReplicaGlobalSecondaryIndexUpdates.is_Some: + output["ReplicaGlobalSecondaryIndexUpdates"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate( + list_element + ) + for list_element in input.ReplicaGlobalSecondaryIndexUpdates.value + ] + + if input.ReplicaProvisionedReadCapacityAutoScalingUpdate.is_Some: + output["ReplicaProvisionedReadCapacityAutoScalingUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.ReplicaProvisionedReadCapacityAutoScalingUpdate.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_ReplicaGlobalSecondaryIndexAutoScalingUpdate(input): + output = {} + if input.IndexName.is_Some: + output["IndexName"] = input.IndexName.value.VerbatimString(False) + + if input.ProvisionedReadCapacityAutoScalingUpdate.is_Some: + output["ProvisionedReadCapacityAutoScalingUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.ProvisionedReadCapacityAutoScalingUpdate.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput(input): + output = {} + if input.GlobalSecondaryIndexUpdates.is_Some: + output["GlobalSecondaryIndexUpdates"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GlobalSecondaryIndexAutoScalingUpdate( + list_element + ) + for list_element in input.GlobalSecondaryIndexUpdates.value + ] + + output["TableName"] = input.TableName.VerbatimString(False) + if input.ProvisionedWriteCapacityAutoScalingUpdate.is_Some: + output["ProvisionedWriteCapacityAutoScalingUpdate"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingUpdate.value + ) + ) + + if input.ReplicaUpdates.is_Some: + output["ReplicaUpdates"] = [ + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ReplicaAutoScalingUpdate( + list_element + ) + for list_element in input.ReplicaUpdates.value + ] + + return output + + +def com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput(input): + output = {} + if input.TableAutoScalingDescription.is_Some: + output["TableAutoScalingDescription"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TableAutoScalingDescription( + input.TableAutoScalingDescription.value + ) + ) + + return output + + +def com_amazonaws_dynamodb_TimeToLiveSpecification(input): + output = {} + output["Enabled"] = input.Enabled + output["AttributeName"] = input.AttributeName.VerbatimString(False) + return output + + +def com_amazonaws_dynamodb_UpdateTimeToLiveInput(input): + output = {} + output["TableName"] = input.TableName.VerbatimString(False) + output["TimeToLiveSpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TimeToLiveSpecification( + input.TimeToLiveSpecification + ) + ) + return output + + +def com_amazonaws_dynamodb_UpdateTimeToLiveOutput(input): + output = {} + if input.TimeToLiveSpecification.is_Some: + output["TimeToLiveSpecification"] = ( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TimeToLiveSpecification( + input.TimeToLiveSpecification.value + ) + ) + + return output diff --git a/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/shim.py b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/shim.py new file mode 100644 index 000000000..518b5951d --- /dev/null +++ b/ComAmazonawsDynamodb/runtimes/python/src/com_amazonaws_dynamodb/smithygenerated/com_amazonaws_dynamodb/shim.py @@ -0,0 +1,1179 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +import com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny +import com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk +import module_ +from software_amazon_cryptography_services_dynamodb_internaldafny_types import ( + BatchExecuteStatementInput_BatchExecuteStatementInput as DafnyBatchExecuteStatementInput, + BatchExecuteStatementOutput_BatchExecuteStatementOutput as DafnyBatchExecuteStatementOutput, + BatchGetItemInput_BatchGetItemInput as DafnyBatchGetItemInput, + BatchGetItemOutput_BatchGetItemOutput as DafnyBatchGetItemOutput, + BatchWriteItemInput_BatchWriteItemInput as DafnyBatchWriteItemInput, + BatchWriteItemOutput_BatchWriteItemOutput as DafnyBatchWriteItemOutput, + CreateBackupInput_CreateBackupInput as DafnyCreateBackupInput, + CreateBackupOutput_CreateBackupOutput as DafnyCreateBackupOutput, + CreateGlobalTableInput_CreateGlobalTableInput as DafnyCreateGlobalTableInput, + CreateGlobalTableOutput_CreateGlobalTableOutput as DafnyCreateGlobalTableOutput, + CreateTableInput_CreateTableInput as DafnyCreateTableInput, + CreateTableOutput_CreateTableOutput as DafnyCreateTableOutput, + DeleteBackupInput_DeleteBackupInput as DafnyDeleteBackupInput, + DeleteBackupOutput_DeleteBackupOutput as DafnyDeleteBackupOutput, + DeleteItemInput_DeleteItemInput as DafnyDeleteItemInput, + DeleteItemOutput_DeleteItemOutput as DafnyDeleteItemOutput, + DeleteTableInput_DeleteTableInput as DafnyDeleteTableInput, + DeleteTableOutput_DeleteTableOutput as DafnyDeleteTableOutput, + DescribeBackupInput_DescribeBackupInput as DafnyDescribeBackupInput, + DescribeBackupOutput_DescribeBackupOutput as DafnyDescribeBackupOutput, + DescribeContinuousBackupsInput_DescribeContinuousBackupsInput as DafnyDescribeContinuousBackupsInput, + DescribeContinuousBackupsOutput_DescribeContinuousBackupsOutput as DafnyDescribeContinuousBackupsOutput, + DescribeContributorInsightsInput_DescribeContributorInsightsInput as DafnyDescribeContributorInsightsInput, + DescribeContributorInsightsOutput_DescribeContributorInsightsOutput as DafnyDescribeContributorInsightsOutput, + DescribeEndpointsRequest_DescribeEndpointsRequest as DafnyDescribeEndpointsRequest, + DescribeEndpointsResponse_DescribeEndpointsResponse as DafnyDescribeEndpointsResponse, + DescribeExportInput_DescribeExportInput as DafnyDescribeExportInput, + DescribeExportOutput_DescribeExportOutput as DafnyDescribeExportOutput, + DescribeGlobalTableInput_DescribeGlobalTableInput as DafnyDescribeGlobalTableInput, + DescribeGlobalTableOutput_DescribeGlobalTableOutput as DafnyDescribeGlobalTableOutput, + DescribeGlobalTableSettingsInput_DescribeGlobalTableSettingsInput as DafnyDescribeGlobalTableSettingsInput, + DescribeGlobalTableSettingsOutput_DescribeGlobalTableSettingsOutput as DafnyDescribeGlobalTableSettingsOutput, + DescribeImportInput_DescribeImportInput as DafnyDescribeImportInput, + DescribeImportOutput_DescribeImportOutput as DafnyDescribeImportOutput, + DescribeKinesisStreamingDestinationInput_DescribeKinesisStreamingDestinationInput as DafnyDescribeKinesisStreamingDestinationInput, + DescribeKinesisStreamingDestinationOutput_DescribeKinesisStreamingDestinationOutput as DafnyDescribeKinesisStreamingDestinationOutput, + DescribeLimitsInput_DescribeLimitsInput as DafnyDescribeLimitsInput, + DescribeLimitsOutput_DescribeLimitsOutput as DafnyDescribeLimitsOutput, + DescribeTableInput_DescribeTableInput as DafnyDescribeTableInput, + DescribeTableOutput_DescribeTableOutput as DafnyDescribeTableOutput, + DescribeTableReplicaAutoScalingInput_DescribeTableReplicaAutoScalingInput as DafnyDescribeTableReplicaAutoScalingInput, + DescribeTableReplicaAutoScalingOutput_DescribeTableReplicaAutoScalingOutput as DafnyDescribeTableReplicaAutoScalingOutput, + DescribeTimeToLiveInput_DescribeTimeToLiveInput as DafnyDescribeTimeToLiveInput, + DescribeTimeToLiveOutput_DescribeTimeToLiveOutput as DafnyDescribeTimeToLiveOutput, + DisableKinesisStreamingDestinationInput_DisableKinesisStreamingDestinationInput as DafnyDisableKinesisStreamingDestinationInput, + DisableKinesisStreamingDestinationOutput_DisableKinesisStreamingDestinationOutput as DafnyDisableKinesisStreamingDestinationOutput, + EnableKinesisStreamingDestinationInput_EnableKinesisStreamingDestinationInput as DafnyEnableKinesisStreamingDestinationInput, + EnableKinesisStreamingDestinationOutput_EnableKinesisStreamingDestinationOutput as DafnyEnableKinesisStreamingDestinationOutput, + ExecuteStatementInput_ExecuteStatementInput as DafnyExecuteStatementInput, + ExecuteStatementOutput_ExecuteStatementOutput as DafnyExecuteStatementOutput, + ExecuteTransactionInput_ExecuteTransactionInput as DafnyExecuteTransactionInput, + ExecuteTransactionOutput_ExecuteTransactionOutput as DafnyExecuteTransactionOutput, + ExportTableToPointInTimeInput_ExportTableToPointInTimeInput as DafnyExportTableToPointInTimeInput, + ExportTableToPointInTimeOutput_ExportTableToPointInTimeOutput as DafnyExportTableToPointInTimeOutput, + GetItemInput_GetItemInput as DafnyGetItemInput, + GetItemOutput_GetItemOutput as DafnyGetItemOutput, + ImportTableInput_ImportTableInput as DafnyImportTableInput, + ImportTableOutput_ImportTableOutput as DafnyImportTableOutput, + ListBackupsInput_ListBackupsInput as DafnyListBackupsInput, + ListBackupsOutput_ListBackupsOutput as DafnyListBackupsOutput, + ListContributorInsightsInput_ListContributorInsightsInput as DafnyListContributorInsightsInput, + ListContributorInsightsOutput_ListContributorInsightsOutput as DafnyListContributorInsightsOutput, + ListExportsInput_ListExportsInput as DafnyListExportsInput, + ListExportsOutput_ListExportsOutput as DafnyListExportsOutput, + ListGlobalTablesInput_ListGlobalTablesInput as DafnyListGlobalTablesInput, + ListGlobalTablesOutput_ListGlobalTablesOutput as DafnyListGlobalTablesOutput, + ListImportsInput_ListImportsInput as DafnyListImportsInput, + ListImportsOutput_ListImportsOutput as DafnyListImportsOutput, + ListTablesInput_ListTablesInput as DafnyListTablesInput, + ListTablesOutput_ListTablesOutput as DafnyListTablesOutput, + ListTagsOfResourceInput_ListTagsOfResourceInput as DafnyListTagsOfResourceInput, + ListTagsOfResourceOutput_ListTagsOfResourceOutput as DafnyListTagsOfResourceOutput, + PutItemInput_PutItemInput as DafnyPutItemInput, + PutItemOutput_PutItemOutput as DafnyPutItemOutput, + QueryInput_QueryInput as DafnyQueryInput, + QueryOutput_QueryOutput as DafnyQueryOutput, + RestoreTableFromBackupInput_RestoreTableFromBackupInput as DafnyRestoreTableFromBackupInput, + RestoreTableFromBackupOutput_RestoreTableFromBackupOutput as DafnyRestoreTableFromBackupOutput, + RestoreTableToPointInTimeInput_RestoreTableToPointInTimeInput as DafnyRestoreTableToPointInTimeInput, + RestoreTableToPointInTimeOutput_RestoreTableToPointInTimeOutput as DafnyRestoreTableToPointInTimeOutput, + ScanInput_ScanInput as DafnyScanInput, + ScanOutput_ScanOutput as DafnyScanOutput, + TagResourceInput_TagResourceInput as DafnyTagResourceInput, + TransactGetItemsInput_TransactGetItemsInput as DafnyTransactGetItemsInput, + TransactGetItemsOutput_TransactGetItemsOutput as DafnyTransactGetItemsOutput, + TransactWriteItemsInput_TransactWriteItemsInput as DafnyTransactWriteItemsInput, + TransactWriteItemsOutput_TransactWriteItemsOutput as DafnyTransactWriteItemsOutput, + UntagResourceInput_UntagResourceInput as DafnyUntagResourceInput, + UpdateContinuousBackupsInput_UpdateContinuousBackupsInput as DafnyUpdateContinuousBackupsInput, + UpdateContinuousBackupsOutput_UpdateContinuousBackupsOutput as DafnyUpdateContinuousBackupsOutput, + UpdateContributorInsightsInput_UpdateContributorInsightsInput as DafnyUpdateContributorInsightsInput, + UpdateContributorInsightsOutput_UpdateContributorInsightsOutput as DafnyUpdateContributorInsightsOutput, + UpdateGlobalTableInput_UpdateGlobalTableInput as DafnyUpdateGlobalTableInput, + UpdateGlobalTableOutput_UpdateGlobalTableOutput as DafnyUpdateGlobalTableOutput, + UpdateGlobalTableSettingsInput_UpdateGlobalTableSettingsInput as DafnyUpdateGlobalTableSettingsInput, + UpdateGlobalTableSettingsOutput_UpdateGlobalTableSettingsOutput as DafnyUpdateGlobalTableSettingsOutput, + UpdateItemInput_UpdateItemInput as DafnyUpdateItemInput, + UpdateItemOutput_UpdateItemOutput as DafnyUpdateItemOutput, + UpdateTableInput_UpdateTableInput as DafnyUpdateTableInput, + UpdateTableOutput_UpdateTableOutput as DafnyUpdateTableOutput, + UpdateTableReplicaAutoScalingInput_UpdateTableReplicaAutoScalingInput as DafnyUpdateTableReplicaAutoScalingInput, + UpdateTableReplicaAutoScalingOutput_UpdateTableReplicaAutoScalingOutput as DafnyUpdateTableReplicaAutoScalingOutput, + UpdateTimeToLiveInput_UpdateTimeToLiveInput as DafnyUpdateTimeToLiveInput, + UpdateTimeToLiveOutput_UpdateTimeToLiveOutput as DafnyUpdateTimeToLiveOutput, +) + +from . import dafny_to_aws_sdk + + +import Wrappers +from botocore.exceptions import ClientError +import software_amazon_cryptography_services_dynamodb_internaldafny_types + + +def _sdk_error_to_dafny_error(e: ClientError): + """ + Converts the provided native Smithy-modelled error + into the corresponding Dafny error. + """ + if e.response["Error"]["Code"] == "BackupInUseException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupInUseException( + e.response + ) + + elif e.response["Error"]["Code"] == "BackupNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BackupNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "ConditionalCheckFailedException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ConditionalCheckFailedException( + e.response + ) + + elif e.response["Error"]["Code"] == "ContinuousBackupsUnavailableException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ContinuousBackupsUnavailableException( + e.response + ) + + elif e.response["Error"]["Code"] == "DuplicateItemException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DuplicateItemException( + e.response + ) + + elif e.response["Error"]["Code"] == "ExportConflictException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportConflictException( + e.response + ) + + elif e.response["Error"]["Code"] == "ExportNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "GlobalTableAlreadyExistsException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTableAlreadyExistsException( + e.response + ) + + elif e.response["Error"]["Code"] == "GlobalTableNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GlobalTableNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "IdempotentParameterMismatchException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_IdempotentParameterMismatchException( + e.response + ) + + elif e.response["Error"]["Code"] == "ImportConflictException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportConflictException( + e.response + ) + + elif e.response["Error"]["Code"] == "ImportNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "IndexNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_IndexNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "InternalServerError": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InternalServerError( + e.response + ) + + elif e.response["Error"]["Code"] == "InvalidEndpointException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InvalidEndpointException( + e.response + ) + + elif e.response["Error"]["Code"] == "InvalidExportTimeException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InvalidExportTimeException( + e.response + ) + + elif e.response["Error"]["Code"] == "InvalidRestoreTimeException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_InvalidRestoreTimeException( + e.response + ) + + elif e.response["Error"]["Code"] == "ItemCollectionSizeLimitExceededException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ItemCollectionSizeLimitExceededException( + e.response + ) + + elif e.response["Error"]["Code"] == "LimitExceededException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_LimitExceededException( + e.response + ) + + elif e.response["Error"]["Code"] == "PointInTimeRecoveryUnavailableException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_PointInTimeRecoveryUnavailableException( + e.response + ) + + elif e.response["Error"]["Code"] == "ProvisionedThroughputExceededException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ProvisionedThroughputExceededException( + e.response + ) + + elif e.response["Error"]["Code"] == "ReplicaAlreadyExistsException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaAlreadyExistsException( + e.response + ) + + elif e.response["Error"]["Code"] == "ReplicaNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ReplicaNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "RequestLimitExceeded": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_RequestLimitExceeded( + e.response + ) + + elif e.response["Error"]["Code"] == "ResourceInUseException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ResourceInUseException( + e.response + ) + + elif e.response["Error"]["Code"] == "ResourceNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ResourceNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "TableAlreadyExistsException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableAlreadyExistsException( + e.response + ) + + elif e.response["Error"]["Code"] == "TableInUseException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableInUseException( + e.response + ) + + elif e.response["Error"]["Code"] == "TableNotFoundException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TableNotFoundException( + e.response + ) + + elif e.response["Error"]["Code"] == "TransactionCanceledException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TransactionCanceledException( + e.response + ) + + elif e.response["Error"]["Code"] == "TransactionConflictException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TransactionConflictException( + e.response + ) + + elif e.response["Error"]["Code"] == "TransactionInProgressException": + return com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TransactionInProgressException( + e.response + ) + + return ( + software_amazon_cryptography_services_dynamodb_internaldafny_types.Error_Opaque( + obj=e + ) + ) + + +class DynamoDBClientShim: + def __init__(self, _impl, _region): + self._impl = _impl + self._region = _region + + def BatchExecuteStatement( + self, input: DafnyBatchExecuteStatementInput + ) -> DafnyBatchExecuteStatementOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BatchExecuteStatementInput( + input + ) + try: + boto_response_dict = self._impl.batch_execute_statement(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BatchExecuteStatementOutput( + boto_response_dict + ) + ) + + def BatchGetItem(self, input: DafnyBatchGetItemInput) -> DafnyBatchGetItemOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BatchGetItemInput( + input + ) + try: + boto_response_dict = self._impl.batch_get_item(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BatchGetItemOutput( + boto_response_dict + ) + ) + + def BatchWriteItem( + self, input: DafnyBatchWriteItemInput + ) -> DafnyBatchWriteItemOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_BatchWriteItemInput( + input + ) + try: + boto_response_dict = self._impl.batch_write_item(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_BatchWriteItemOutput( + boto_response_dict + ) + ) + + def CreateBackup(self, input: DafnyCreateBackupInput) -> DafnyCreateBackupOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CreateBackupInput( + input + ) + try: + boto_response_dict = self._impl.create_backup(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CreateBackupOutput( + boto_response_dict + ) + ) + + def CreateGlobalTable( + self, input: DafnyCreateGlobalTableInput + ) -> DafnyCreateGlobalTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CreateGlobalTableInput( + input + ) + try: + boto_response_dict = self._impl.create_global_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CreateGlobalTableOutput( + boto_response_dict + ) + ) + + def CreateTable(self, input: DafnyCreateTableInput) -> DafnyCreateTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_CreateTableInput( + input + ) + try: + boto_response_dict = self._impl.create_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_CreateTableOutput( + boto_response_dict + ) + ) + + def DeleteBackup(self, input: DafnyDeleteBackupInput) -> DafnyDeleteBackupOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DeleteBackupInput( + input + ) + try: + boto_response_dict = self._impl.delete_backup(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DeleteBackupOutput( + boto_response_dict + ) + ) + + def DeleteItem(self, input: DafnyDeleteItemInput) -> DafnyDeleteItemOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DeleteItemInput( + input + ) + try: + boto_response_dict = self._impl.delete_item(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DeleteItemOutput( + boto_response_dict + ) + ) + + def DeleteTable(self, input: DafnyDeleteTableInput) -> DafnyDeleteTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DeleteTableInput( + input + ) + try: + boto_response_dict = self._impl.delete_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DeleteTableOutput( + boto_response_dict + ) + ) + + def DescribeBackup( + self, input: DafnyDescribeBackupInput + ) -> DafnyDescribeBackupOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeBackupInput( + input + ) + try: + boto_response_dict = self._impl.describe_backup(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeBackupOutput( + boto_response_dict + ) + ) + + def DescribeContinuousBackups( + self, input: DafnyDescribeContinuousBackupsInput + ) -> DafnyDescribeContinuousBackupsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeContinuousBackupsInput( + input + ) + try: + boto_response_dict = self._impl.describe_continuous_backups( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeContinuousBackupsOutput( + boto_response_dict + ) + ) + + def DescribeContributorInsights( + self, input: DafnyDescribeContributorInsightsInput + ) -> DafnyDescribeContributorInsightsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeContributorInsightsInput( + input + ) + try: + boto_response_dict = self._impl.describe_contributor_insights( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeContributorInsightsOutput( + boto_response_dict + ) + ) + + def DescribeEndpoints( + self, input: DafnyDescribeEndpointsRequest + ) -> DafnyDescribeEndpointsResponse: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeEndpointsRequest( + input + ) + try: + boto_response_dict = self._impl.describe_endpoints(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeEndpointsResponse( + boto_response_dict + ) + ) + + def DescribeExport( + self, input: DafnyDescribeExportInput + ) -> DafnyDescribeExportOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeExportInput( + input + ) + try: + boto_response_dict = self._impl.describe_export(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeExportOutput( + boto_response_dict + ) + ) + + def DescribeGlobalTable( + self, input: DafnyDescribeGlobalTableInput + ) -> DafnyDescribeGlobalTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeGlobalTableInput( + input + ) + try: + boto_response_dict = self._impl.describe_global_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeGlobalTableOutput( + boto_response_dict + ) + ) + + def DescribeGlobalTableSettings( + self, input: DafnyDescribeGlobalTableSettingsInput + ) -> DafnyDescribeGlobalTableSettingsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeGlobalTableSettingsInput( + input + ) + try: + boto_response_dict = self._impl.describe_global_table_settings( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeGlobalTableSettingsOutput( + boto_response_dict + ) + ) + + def DescribeImport( + self, input: DafnyDescribeImportInput + ) -> DafnyDescribeImportOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeImportInput( + input + ) + try: + boto_response_dict = self._impl.describe_import(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeImportOutput( + boto_response_dict + ) + ) + + def DescribeKinesisStreamingDestination( + self, input: DafnyDescribeKinesisStreamingDestinationInput + ) -> DafnyDescribeKinesisStreamingDestinationOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationInput( + input + ) + try: + boto_response_dict = self._impl.describe_kinesis_streaming_destination( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeKinesisStreamingDestinationOutput( + boto_response_dict + ) + ) + + def DescribeLimits( + self, input: DafnyDescribeLimitsInput + ) -> DafnyDescribeLimitsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeLimitsInput( + input + ) + try: + boto_response_dict = self._impl.describe_limits(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeLimitsOutput( + boto_response_dict + ) + ) + + def DescribeTable(self, input: DafnyDescribeTableInput) -> DafnyDescribeTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeTableInput( + input + ) + try: + boto_response_dict = self._impl.describe_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeTableOutput( + boto_response_dict + ) + ) + + def DescribeTableReplicaAutoScaling( + self, input: DafnyDescribeTableReplicaAutoScalingInput + ) -> DafnyDescribeTableReplicaAutoScalingOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingInput( + input + ) + try: + boto_response_dict = self._impl.describe_table_replica_auto_scaling( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeTableReplicaAutoScalingOutput( + boto_response_dict + ) + ) + + def DescribeTimeToLive( + self, input: DafnyDescribeTimeToLiveInput + ) -> DafnyDescribeTimeToLiveOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DescribeTimeToLiveInput( + input + ) + try: + boto_response_dict = self._impl.describe_time_to_live(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DescribeTimeToLiveOutput( + boto_response_dict + ) + ) + + def DisableKinesisStreamingDestination( + self, input: DafnyDisableKinesisStreamingDestinationInput + ) -> DafnyDisableKinesisStreamingDestinationOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_DisableKinesisStreamingDestinationInput( + input + ) + try: + boto_response_dict = self._impl.disable_kinesis_streaming_destination( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_DisableKinesisStreamingDestinationOutput( + boto_response_dict + ) + ) + + def EnableKinesisStreamingDestination( + self, input: DafnyEnableKinesisStreamingDestinationInput + ) -> DafnyEnableKinesisStreamingDestinationOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_EnableKinesisStreamingDestinationInput( + input + ) + try: + boto_response_dict = self._impl.enable_kinesis_streaming_destination( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_EnableKinesisStreamingDestinationOutput( + boto_response_dict + ) + ) + + def ExecuteStatement( + self, input: DafnyExecuteStatementInput + ) -> DafnyExecuteStatementOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExecuteStatementInput( + input + ) + try: + boto_response_dict = self._impl.execute_statement(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExecuteStatementOutput( + boto_response_dict + ) + ) + + def ExecuteTransaction( + self, input: DafnyExecuteTransactionInput + ) -> DafnyExecuteTransactionOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExecuteTransactionInput( + input + ) + try: + boto_response_dict = self._impl.execute_transaction(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExecuteTransactionOutput( + boto_response_dict + ) + ) + + def ExportTableToPointInTime( + self, input: DafnyExportTableToPointInTimeInput + ) -> DafnyExportTableToPointInTimeOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ExportTableToPointInTimeInput( + input + ) + try: + boto_response_dict = self._impl.export_table_to_point_in_time( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ExportTableToPointInTimeOutput( + boto_response_dict + ) + ) + + def GetItem(self, input: DafnyGetItemInput) -> DafnyGetItemOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_GetItemInput( + input + ) + try: + boto_response_dict = self._impl.get_item(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_GetItemOutput( + boto_response_dict + ) + ) + + def ImportTable(self, input: DafnyImportTableInput) -> DafnyImportTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ImportTableInput( + input + ) + try: + boto_response_dict = self._impl.import_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ImportTableOutput( + boto_response_dict + ) + ) + + def ListBackups(self, input: DafnyListBackupsInput) -> DafnyListBackupsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ListBackupsInput( + input + ) + try: + boto_response_dict = self._impl.list_backups(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ListBackupsOutput( + boto_response_dict + ) + ) + + def ListContributorInsights( + self, input: DafnyListContributorInsightsInput + ) -> DafnyListContributorInsightsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ListContributorInsightsInput( + input + ) + try: + boto_response_dict = self._impl.list_contributor_insights( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ListContributorInsightsOutput( + boto_response_dict + ) + ) + + def ListExports(self, input: DafnyListExportsInput) -> DafnyListExportsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ListExportsInput( + input + ) + try: + boto_response_dict = self._impl.list_exports(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ListExportsOutput( + boto_response_dict + ) + ) + + def ListGlobalTables( + self, input: DafnyListGlobalTablesInput + ) -> DafnyListGlobalTablesOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ListGlobalTablesInput( + input + ) + try: + boto_response_dict = self._impl.list_global_tables(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ListGlobalTablesOutput( + boto_response_dict + ) + ) + + def ListImports(self, input: DafnyListImportsInput) -> DafnyListImportsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ListImportsInput( + input + ) + try: + boto_response_dict = self._impl.list_imports(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ListImportsOutput( + boto_response_dict + ) + ) + + def ListTables(self, input: DafnyListTablesInput) -> DafnyListTablesOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ListTablesInput( + input + ) + try: + boto_response_dict = self._impl.list_tables(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ListTablesOutput( + boto_response_dict + ) + ) + + def ListTagsOfResource( + self, input: DafnyListTagsOfResourceInput + ) -> DafnyListTagsOfResourceOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ListTagsOfResourceInput( + input + ) + try: + boto_response_dict = self._impl.list_tags_of_resource(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ListTagsOfResourceOutput( + boto_response_dict + ) + ) + + def PutItem(self, input: DafnyPutItemInput) -> DafnyPutItemOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_PutItemInput( + input + ) + try: + boto_response_dict = self._impl.put_item(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_PutItemOutput( + boto_response_dict + ) + ) + + def Query(self, input: DafnyQueryInput) -> DafnyQueryOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_QueryInput( + input + ) + try: + boto_response_dict = self._impl.query(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_QueryOutput( + boto_response_dict + ) + ) + + def RestoreTableFromBackup( + self, input: DafnyRestoreTableFromBackupInput + ) -> DafnyRestoreTableFromBackupOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_RestoreTableFromBackupInput( + input + ) + try: + boto_response_dict = self._impl.restore_table_from_backup( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_RestoreTableFromBackupOutput( + boto_response_dict + ) + ) + + def RestoreTableToPointInTime( + self, input: DafnyRestoreTableToPointInTimeInput + ) -> DafnyRestoreTableToPointInTimeOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_RestoreTableToPointInTimeInput( + input + ) + try: + boto_response_dict = self._impl.restore_table_to_point_in_time( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_RestoreTableToPointInTimeOutput( + boto_response_dict + ) + ) + + def Scan(self, input: DafnyScanInput) -> DafnyScanOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_ScanInput( + input + ) + try: + boto_response_dict = self._impl.scan(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_ScanOutput( + boto_response_dict + ) + ) + + def TagResource(self, input: DafnyTagResourceInput) -> None: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TagResourceInput( + input + ) + try: + boto_response_dict = self._impl.tag_resource(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success(None) + + def TransactGetItems( + self, input: DafnyTransactGetItemsInput + ) -> DafnyTransactGetItemsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TransactGetItemsInput( + input + ) + try: + boto_response_dict = self._impl.transact_get_items(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TransactGetItemsOutput( + boto_response_dict + ) + ) + + def TransactWriteItems( + self, input: DafnyTransactWriteItemsInput + ) -> DafnyTransactWriteItemsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_TransactWriteItemsInput( + input + ) + try: + boto_response_dict = self._impl.transact_write_items(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_TransactWriteItemsOutput( + boto_response_dict + ) + ) + + def UntagResource(self, input: DafnyUntagResourceInput) -> None: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UntagResourceInput( + input + ) + try: + boto_response_dict = self._impl.untag_resource(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success(None) + + def UpdateContinuousBackups( + self, input: DafnyUpdateContinuousBackupsInput + ) -> DafnyUpdateContinuousBackupsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateContinuousBackupsInput( + input + ) + try: + boto_response_dict = self._impl.update_continuous_backups( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateContinuousBackupsOutput( + boto_response_dict + ) + ) + + def UpdateContributorInsights( + self, input: DafnyUpdateContributorInsightsInput + ) -> DafnyUpdateContributorInsightsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateContributorInsightsInput( + input + ) + try: + boto_response_dict = self._impl.update_contributor_insights( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateContributorInsightsOutput( + boto_response_dict + ) + ) + + def UpdateGlobalTable( + self, input: DafnyUpdateGlobalTableInput + ) -> DafnyUpdateGlobalTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateGlobalTableInput( + input + ) + try: + boto_response_dict = self._impl.update_global_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateGlobalTableOutput( + boto_response_dict + ) + ) + + def UpdateGlobalTableSettings( + self, input: DafnyUpdateGlobalTableSettingsInput + ) -> DafnyUpdateGlobalTableSettingsOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateGlobalTableSettingsInput( + input + ) + try: + boto_response_dict = self._impl.update_global_table_settings( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateGlobalTableSettingsOutput( + boto_response_dict + ) + ) + + def UpdateItem(self, input: DafnyUpdateItemInput) -> DafnyUpdateItemOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateItemInput( + input + ) + try: + boto_response_dict = self._impl.update_item(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateItemOutput( + boto_response_dict + ) + ) + + def UpdateTable(self, input: DafnyUpdateTableInput) -> DafnyUpdateTableOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateTableInput( + input + ) + try: + boto_response_dict = self._impl.update_table(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateTableOutput( + boto_response_dict + ) + ) + + def UpdateTableReplicaAutoScaling( + self, input: DafnyUpdateTableReplicaAutoScalingInput + ) -> DafnyUpdateTableReplicaAutoScalingOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingInput( + input + ) + try: + boto_response_dict = self._impl.update_table_replica_auto_scaling( + **boto_request_dict + ) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateTableReplicaAutoScalingOutput( + boto_response_dict + ) + ) + + def UpdateTimeToLive( + self, input: DafnyUpdateTimeToLiveInput + ) -> DafnyUpdateTimeToLiveOutput: + boto_request_dict = com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.dafny_to_aws_sdk.com_amazonaws_dynamodb_UpdateTimeToLiveInput( + input + ) + try: + boto_response_dict = self._impl.update_time_to_live(**boto_request_dict) + except ClientError as e: + return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) + + return Wrappers.Result_Success( + com_amazonaws_dynamodb.smithygenerated.com_amazonaws_dynamodb.aws_sdk_to_dafny.com_amazonaws_dynamodb_UpdateTimeToLiveOutput( + boto_response_dict + ) + )