-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more operations to ddb-lite, fix a small codegen bug (#520)
- Loading branch information
Showing
34 changed files
with
1,522 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
306 changes: 306 additions & 0 deletions
306
TestModels/aws-sdks/ddb-lite/model/ComAmazonawsDynamodbTypes.dfy
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_execute_statement.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
pub mod _batch_execute_statement_request; | ||
|
||
pub mod _batch_execute_statement_response; | ||
#[allow(dead_code)] | ||
pub fn to_dafny_error( | ||
value: &::aws_smithy_runtime_api::client::result::SdkError< | ||
aws_sdk_dynamodb::operation::batch_execute_statement::BatchExecuteStatementError, | ||
::aws_smithy_runtime_api::client::orchestrator::HttpResponse, | ||
>, | ||
) -> ::std::rc::Rc<crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::Error> { | ||
match value { | ||
aws_sdk_dynamodb::error::SdkError::ServiceError(service_error) => match service_error.err() { | ||
aws_sdk_dynamodb::operation::batch_execute_statement::BatchExecuteStatementError::InternalServerError(e) => | ||
crate::conversions::error::internal_server_error::to_dafny(e.clone()), | ||
aws_sdk_dynamodb::operation::batch_execute_statement::BatchExecuteStatementError::RequestLimitExceeded(e) => | ||
crate::conversions::error::request_limit_exceeded::to_dafny(e.clone()), | ||
e => crate::conversions::error::to_opaque_error(e.to_string()), | ||
}, | ||
_ => { | ||
crate::conversions::error::to_opaque_error(value.to_string()) | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...runtimes/rust/src/conversions/batch_execute_statement/_batch_execute_statement_request.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
#[allow(dead_code)] | ||
pub fn to_dafny( | ||
value: &aws_sdk_dynamodb::operation::batch_execute_statement::BatchExecuteStatementInput | ||
) -> ::std::rc::Rc< | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchExecuteStatementInput, | ||
>{ | ||
::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchExecuteStatementInput::BatchExecuteStatementInput { | ||
Statements: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&value.statements.clone().unwrap(), | ||
|e| crate::conversions::batch_statement_request::to_dafny(&e) | ||
, | ||
) | ||
, | ||
ReturnConsumedCapacity: ::std::rc::Rc::new(match &value.return_consumed_capacity { | ||
Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::return_consumed_capacity::to_dafny(x.clone()) }, | ||
None => crate::_Wrappers_Compile::Option::None { } | ||
}) | ||
, | ||
}) | ||
} | ||
#[allow(dead_code)] | ||
pub fn from_dafny( | ||
dafny_value: ::std::rc::Rc< | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchExecuteStatementInput, | ||
>, | ||
client: aws_sdk_dynamodb::Client, | ||
) -> aws_sdk_dynamodb::operation::batch_execute_statement::builders::BatchExecuteStatementFluentBuilder { | ||
client.batch_execute_statement() | ||
.set_statements(Some( ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(dafny_value.Statements(), | ||
|e| crate::conversions::batch_statement_request::from_dafny(e.clone()) | ||
, | ||
) | ||
)) | ||
.set_return_consumed_capacity(match &**dafny_value.ReturnConsumedCapacity() { | ||
crate::r#_Wrappers_Compile::Option::Some { value } => Some( | ||
crate::conversions::return_consumed_capacity::from_dafny(value) | ||
), | ||
_ => None, | ||
} | ||
) | ||
} |
32 changes: 32 additions & 0 deletions
32
...untimes/rust/src/conversions/batch_execute_statement/_batch_execute_statement_response.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
#[allow(dead_code)] | ||
pub fn to_dafny( | ||
value: &aws_sdk_dynamodb::operation::batch_execute_statement::BatchExecuteStatementOutput | ||
) -> ::std::rc::Rc< | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchExecuteStatementOutput, | ||
>{ | ||
::std::rc::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchExecuteStatementOutput::BatchExecuteStatementOutput { | ||
Responses: ::std::rc::Rc::new(match &value.responses { | ||
Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : | ||
::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, | ||
|e| crate::conversions::batch_statement_response::to_dafny(&e) | ||
, | ||
) | ||
}, | ||
None => crate::r#_Wrappers_Compile::Option::None {} | ||
}) | ||
, | ||
ConsumedCapacity: ::std::rc::Rc::new(match &value.consumed_capacity { | ||
Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : | ||
::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, | ||
|e| crate::conversions::consumed_capacity::to_dafny(&e) | ||
, | ||
) | ||
}, | ||
None => crate::r#_Wrappers_Compile::Option::None {} | ||
}) | ||
, | ||
}) | ||
} |
37 changes: 37 additions & 0 deletions
37
TestModels/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_statement_error.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. | ||
|
||
#[allow(dead_code)] | ||
pub fn to_dafny( | ||
value: &aws_sdk_dynamodb::types::BatchStatementError, | ||
) -> ::std::rc::Rc<crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementError>{ | ||
::std::rc::Rc::new( | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementError::BatchStatementError { | ||
Code: ::std::rc::Rc::new(match &value.code { | ||
Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::conversions::batch_statement_error_code_enum::to_dafny(x.clone()) }, | ||
None => crate::_Wrappers_Compile::Option::None { } | ||
}) | ||
, | ||
Message: crate::standard_library_conversions::ostring_to_dafny(&value.message), | ||
} | ||
) | ||
} #[allow(dead_code)] | ||
pub fn from_dafny( | ||
dafny_value: ::std::rc::Rc< | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementError, | ||
>, | ||
) -> aws_sdk_dynamodb::types::BatchStatementError { | ||
aws_sdk_dynamodb::types::BatchStatementError::builder() | ||
.set_code(match &**dafny_value.Code() { | ||
crate::r#_Wrappers_Compile::Option::Some { value } => Some( | ||
crate::conversions::batch_statement_error_code_enum::from_dafny(value) | ||
), | ||
_ => None, | ||
} | ||
) | ||
.set_message(crate::standard_library_conversions::ostring_from_dafny(dafny_value.Message().clone())) | ||
.build() | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
...Models/aws-sdks/ddb-lite/runtimes/rust/src/conversions/batch_statement_error_code_enum.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
#[allow(dead_code)] | ||
|
||
pub fn to_dafny( | ||
value: aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum, | ||
) -> ::std::rc::Rc<crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum>{ | ||
::std::rc::Rc::new(match value { | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ConditionalCheckFailed => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ConditionalCheckFailed {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ItemCollectionSizeLimitExceeded => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ItemCollectionSizeLimitExceeded {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::RequestLimitExceeded => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::RequestLimitExceeded {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ValidationError => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ValidationError {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ProvisionedThroughputExceeded => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ProvisionedThroughputExceeded {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::TransactionConflict => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::TransactionConflict {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ThrottlingError => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ThrottlingError {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::InternalServerError => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::InternalServerError {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ResourceNotFound => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ResourceNotFound {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::AccessDenied => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::AccessDenied {}, | ||
aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::DuplicateItem => crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::DuplicateItem {}, | ||
_ => panic!("Unknown enum variant: {}", value), | ||
}) | ||
} | ||
#[allow(dead_code)] | ||
pub fn from_dafny( | ||
dafny_value: &crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum, | ||
) -> aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum { | ||
match dafny_value { | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ConditionalCheckFailed {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ConditionalCheckFailed, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ItemCollectionSizeLimitExceeded {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ItemCollectionSizeLimitExceeded, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::RequestLimitExceeded {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::RequestLimitExceeded, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ValidationError {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ValidationError, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ProvisionedThroughputExceeded {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ProvisionedThroughputExceeded, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::TransactionConflict {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::TransactionConflict, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ThrottlingError {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ThrottlingError, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::InternalServerError {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::InternalServerError, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::ResourceNotFound {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::ResourceNotFound, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::AccessDenied {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::AccessDenied, | ||
crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum::DuplicateItem {} => aws_sdk_dynamodb::types::BatchStatementErrorCodeEnum::DuplicateItem, | ||
} | ||
} |
Oops, something went wrong.