From 8e768fda8749d5027e48be3d230e43e08f985f1d Mon Sep 17 00:00:00 2001 From: Andrew Jewell <107044381+ajewellamz@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:33:13 -0400 Subject: [PATCH] chore: add into for refs (#635) * chore: add into for refs --- TestModels/Constraints/Makefile | 4 + .../Constraints/runtimes/rust/src/client.rs | 38 -- .../rust/src/client/get_constraints.rs | 49 -- .../runtimes/rust/src/conversions.rs | 10 - .../runtimes/rust/src/conversions/client.rs | 24 - .../runtimes/rust/src/conversions/error.rs | 99 ---- .../rust/src/conversions/get_constraints.rs | 6 - .../get_constraints/_get_constraints_input.rs | 192 -------- .../_get_constraints_output.rs | 192 -------- .../conversions/simple_constraints_config.rs | 4 - .../_simple_constraints_config.rs | 44 -- .../Constraints/runtimes/rust/src/error.rs | 16 - .../rust/src/error/sealed_unhandled.rs | 32 -- .../runtimes/rust/src/operation.rs | 5 - .../rust/src/operation/get_constraints.rs | 156 ------- .../get_constraints/_get_constraints_input.rs | 432 ------------------ .../_get_constraints_output.rs | 432 ------------------ .../src/operation/get_constraints/builders.rs | 313 ------------- .../rust/src/standard_library_conversions.rs | 266 ----------- .../rust/src/standard_library_externs.rs | 80 ---- .../Constraints/runtimes/rust/src/types.rs | 16 - .../runtimes/rust/src/types/builders.rs | 3 - .../runtimes/rust/src/types/error.rs | 67 --- .../src/types/simple_constraints_config.rs | 41 -- .../Constraints/runtimes/rust/src/wrapped.rs | 15 - .../runtimes/rust/src/wrapped/client.rs | 83 ---- TestModels/Extendable/Makefile | 6 + .../Extendable/runtimes/rust/Cargo.toml | 25 + .../Extendable/runtimes/rust/src/factory.rs | 75 +++ TestModels/README.md | 8 +- .../polymorph/smithyrust/RustTestModels.java | 2 - .../templates/runtimes/rust/types/resource.rs | 8 +- 32 files changed, 121 insertions(+), 2622 deletions(-) delete mode 100644 TestModels/Constraints/runtimes/rust/src/client.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/client/get_constraints.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions/client.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions/error.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions/get_constraints.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_input.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_output.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config/_simple_constraints_config.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/error.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/error/sealed_unhandled.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/operation.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/operation/get_constraints.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_input.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_output.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/operation/get_constraints/builders.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/standard_library_conversions.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/standard_library_externs.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/types.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/types/builders.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/types/error.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/types/simple_constraints_config.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/wrapped.rs delete mode 100644 TestModels/Constraints/runtimes/rust/src/wrapped/client.rs create mode 100644 TestModels/Extendable/runtimes/rust/Cargo.toml create mode 100644 TestModels/Extendable/runtimes/rust/src/factory.rs diff --git a/TestModels/Constraints/Makefile b/TestModels/Constraints/Makefile index 88fd6b95b..441537397 100644 --- a/TestModels/Constraints/Makefile +++ b/TestModels/Constraints/Makefile @@ -14,6 +14,10 @@ PROJECT_SERVICES := \ SERVICE_NAMESPACE_SimpleConstraints=simple.constraints +NAMESPACE=simple.constraints + +MAIN_SERVICE_FOR_RUST := SimpleConstraints + SERVICE_DEPS_SimpleConstraints := SMITHY_DEPS=dafny-dependencies/Model/traits.smithy diff --git a/TestModels/Constraints/runtimes/rust/src/client.rs b/TestModels/Constraints/runtimes/rust/src/client.rs deleted file mode 100644 index e1bd88f54..000000000 --- a/TestModels/Constraints/runtimes/rust/src/client.rs +++ /dev/null @@ -1,38 +0,0 @@ -// 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. -use aws_smithy_types::error::operation::BuildError; - -#[derive(::std::clone::Clone, ::std::fmt::Debug, ::std::cmp::PartialEq)] -pub struct Client { - pub(crate) dafny_client: ::dafny_runtime::Object -} - -impl Client { - /// Creates a new client from the service [`Config`](crate::Config). - #[track_caller] - pub fn from_conf( - conf: crate::types::simple_constraints_config::SimpleConstraintsConfig, - ) -> Result { - let inner = - crate::simple::constraints::internaldafny::_default::SimpleConstraints( - &crate::conversions::simple_constraints_config::_simple_constraints_config::to_dafny(conf), - ); - if matches!( - inner.as_ref(), - crate::_Wrappers_Compile::Result::Failure { .. } - ) { - // TODO: convert error - the potential types are not modeled! - return Err(BuildError::other( - ::aws_smithy_types::error::metadata::ErrorMetadata::builder() - .message("Invalid client config") - .build(), - )); - } - Ok(Self { - dafny_client: ::dafny_runtime::upcast_object()(inner.Extract()) - }) - } -} - -mod get_constraints; diff --git a/TestModels/Constraints/runtimes/rust/src/client/get_constraints.rs b/TestModels/Constraints/runtimes/rust/src/client/get_constraints.rs deleted file mode 100644 index ea2529f18..000000000 --- a/TestModels/Constraints/runtimes/rust/src/client/get_constraints.rs +++ /dev/null @@ -1,49 +0,0 @@ -// 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. -impl crate::client::Client { - /// Constructs a fluent builder for the [`GetConstraints`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder) operation. - /// - /// - The fluent builder is configurable: - /// - [`blob_less_than_or_equal_to_ten(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::blob_less_than_or_equal_to_ten) / [`set_blob_less_than_or_equal_to_ten(Option<::aws_smithy_types::Blob>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_blob_less_than_or_equal_to_ten): (undocumented)
- /// - [`greater_than_one(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::greater_than_one) / [`set_greater_than_one(Option<::std::primitive::i32>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_greater_than_one): (undocumented)
- /// - [`less_than_ten(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::less_than_ten) / [`set_less_than_ten(Option<::std::primitive::i32>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_less_than_ten): (undocumented)
- /// - [`list_less_than_or_equal_to_ten(impl Into>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::list_less_than_or_equal_to_ten) / [`set_list_less_than_or_equal_to_ten(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_list_less_than_or_equal_to_ten): (undocumented)
- /// - [`map_less_than_or_equal_to_ten(impl Into>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::map_less_than_or_equal_to_ten) / [`set_map_less_than_or_equal_to_ten(Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_map_less_than_or_equal_to_ten): (undocumented)
- /// - [`my_blob(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::my_blob) / [`set_my_blob(Option<::aws_smithy_types::Blob>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_my_blob): (undocumented)
- /// - [`my_list(impl Into>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::my_list) / [`set_my_list(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_my_list): (undocumented)
- /// - [`my_list_of_utf8_bytes(impl Into>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::my_list_of_utf8_bytes) / [`set_my_list_of_utf8_bytes(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_my_list_of_utf8_bytes): (undocumented)
- /// - [`my_map(impl Into>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::my_map) / [`set_my_map(Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_my_map): (undocumented)
- /// - [`my_string(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::my_string) / [`set_my_string(Option<::std::string::String>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_my_string): (undocumented)
- /// - [`my_utf8_bytes(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::my_utf8_bytes) / [`set_my_utf8_bytes(Option<::std::string::String>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_my_utf8_bytes): (undocumented)
- /// - [`non_empty_blob(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::non_empty_blob) / [`set_non_empty_blob(Option<::aws_smithy_types::Blob>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_non_empty_blob): (undocumented)
- /// - [`non_empty_list(impl Into>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::non_empty_list) / [`set_non_empty_list(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_non_empty_list): (undocumented)
- /// - [`non_empty_map(impl Into>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::non_empty_map) / [`set_non_empty_map(Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_non_empty_map): (undocumented)
- /// - [`non_empty_string(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::non_empty_string) / [`set_non_empty_string(Option<::std::string::String>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_non_empty_string): (undocumented)
- /// - [`one_to_ten(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::one_to_ten) / [`set_one_to_ten(Option<::std::primitive::i32>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_one_to_ten): (undocumented)
- /// - [`string_less_than_or_equal_to_ten(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::string_less_than_or_equal_to_ten) / [`set_string_less_than_or_equal_to_ten(Option<::std::string::String>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_string_less_than_or_equal_to_ten): (undocumented)
- /// - [`my_ten_to_ten(impl Into>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::my_ten_to_ten) / [`set_my_ten_to_ten(Option<::std::primitive::i64>)`](crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::set_my_ten_to_ten): (undocumented)
- /// - On success, responds with [`GetConstraintsOutput`](crate::operation::get_constraints::GetConstraintsOutput) with field(s): - /// - [`blob_less_than_or_equal_to_ten(Option<::aws_smithy_types::Blob>)`](crate::operation::get_constraints::GetConstraintsOutput::blob_less_than_or_equal_to_ten): (undocumented) - /// - [`greater_than_one(Option<::std::primitive::i32>)`](crate::operation::get_constraints::GetConstraintsOutput::greater_than_one): (undocumented) - /// - [`less_than_ten(Option<::std::primitive::i32>)`](crate::operation::get_constraints::GetConstraintsOutput::less_than_ten): (undocumented) - /// - [`list_less_than_or_equal_to_ten(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::GetConstraintsOutput::list_less_than_or_equal_to_ten): (undocumented) - /// - [`map_less_than_or_equal_to_ten(Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>)`](crate::operation::get_constraints::GetConstraintsOutput::map_less_than_or_equal_to_ten): (undocumented) - /// - [`my_blob(Option<::aws_smithy_types::Blob>)`](crate::operation::get_constraints::GetConstraintsOutput::my_blob): (undocumented) - /// - [`my_list(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::GetConstraintsOutput::my_list): (undocumented) - /// - [`my_list_of_utf8_bytes(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::GetConstraintsOutput::my_list_of_utf8_bytes): (undocumented) - /// - [`my_map(Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>)`](crate::operation::get_constraints::GetConstraintsOutput::my_map): (undocumented) - /// - [`my_string(Option<::std::string::String>)`](crate::operation::get_constraints::GetConstraintsOutput::my_string): (undocumented) - /// - [`my_utf8_bytes(Option<::std::string::String>)`](crate::operation::get_constraints::GetConstraintsOutput::my_utf8_bytes): (undocumented) - /// - [`non_empty_blob(Option<::aws_smithy_types::Blob>)`](crate::operation::get_constraints::GetConstraintsOutput::non_empty_blob): (undocumented) - /// - [`non_empty_list(Option<::std::vec::Vec<::std::string::String>>)`](crate::operation::get_constraints::GetConstraintsOutput::non_empty_list): (undocumented) - /// - [`non_empty_map(Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>)`](crate::operation::get_constraints::GetConstraintsOutput::non_empty_map): (undocumented) - /// - [`non_empty_string(Option<::std::string::String>)`](crate::operation::get_constraints::GetConstraintsOutput::non_empty_string): (undocumented) - /// - [`one_to_ten(Option<::std::primitive::i32>)`](crate::operation::get_constraints::GetConstraintsOutput::one_to_ten): (undocumented) - /// - [`string_less_than_or_equal_to_ten(Option<::std::string::String>)`](crate::operation::get_constraints::GetConstraintsOutput::string_less_than_or_equal_to_ten): (undocumented) - /// - [`that_ten_to_ten(Option<::std::primitive::i64>)`](crate::operation::get_constraints::GetConstraintsOutput::that_ten_to_ten): (undocumented) - /// - On failure, responds with [`SdkError`](crate::operation::get_constraints::GetConstraintsError) - pub fn get_constraints(&self) -> crate::operation::get_constraints::builders::GetConstraintsFluentBuilder { - crate::operation::get_constraints::builders::GetConstraintsFluentBuilder::new(self.clone()) - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/conversions.rs b/TestModels/Constraints/runtimes/rust/src/conversions.rs deleted file mode 100644 index 542f376cb..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions.rs +++ /dev/null @@ -1,10 +0,0 @@ -// 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 client; - - pub mod error; - - pub mod get_constraints; - -pub mod simple_constraints_config; diff --git a/TestModels/Constraints/runtimes/rust/src/conversions/client.rs b/TestModels/Constraints/runtimes/rust/src/conversions/client.rs deleted file mode 100644 index 2e457a513..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions/client.rs +++ /dev/null @@ -1,24 +0,0 @@ -// 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. -// 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: &crate::client::Client, -) -> - ::dafny_runtime::Object -{ - value.dafny_client.clone() -} - -#[allow(dead_code)] -pub fn from_dafny( - dafny_value: ::dafny_runtime::Object< - dyn crate::r#simple::constraints::internaldafny::types::ISimpleConstraintsClient - >, -) -> crate::client::Client { - crate::client::Client { dafny_client: dafny_value } -} diff --git a/TestModels/Constraints/runtimes/rust/src/conversions/error.rs b/TestModels/Constraints/runtimes/rust/src/conversions/error.rs deleted file mode 100644 index b45ea6156..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions/error.rs +++ /dev/null @@ -1,99 +0,0 @@ -// 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. -/// Wraps up an arbitrary Rust Error value as a Dafny Error -pub fn to_opaque_error(value: E) -> - ::std::rc::Rc -{ - let error_obj: ::dafny_runtime::Object = ::dafny_runtime::Object(Some( - ::std::rc::Rc::new(::std::cell::UnsafeCell::new(value)), - )); - ::std::rc::Rc::new( - crate::r#simple::constraints::internaldafny::types::Error::Opaque { - obj: error_obj, - }, - ) -} - -/// Wraps up an arbitrary Rust Error value as a Dafny Result.Failure -pub fn to_opaque_error_result(value: E) -> - ::std::rc::Rc< - crate::_Wrappers_Compile::Result< - T, - ::std::rc::Rc - > - > -{ - ::std::rc::Rc::new(crate::_Wrappers_Compile::Result::Failure { - error: to_opaque_error(value), - }) -} -pub fn to_dafny( - value: crate::types::error::Error, -) -> ::std::rc::Rc { - ::std::rc::Rc::new(match value { - crate::types::error::Error::SimpleConstraintsException { message } => - crate::r#simple::constraints::internaldafny::types::Error::SimpleConstraintsException { - message: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&message), - }, - crate::types::error::Error::CollectionOfErrors { list, message } => - crate::r#simple::constraints::internaldafny::types::Error::CollectionOfErrors { - message: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&message), - list: ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&list, |e| to_dafny(e.clone())) - }, - crate::types::error::Error::ValidationError(inner) => - crate::r#simple::constraints::internaldafny::types::Error::Opaque { - obj: { - let rc = ::std::rc::Rc::new(inner) as ::std::rc::Rc; - // safety: `rc` is new, ensuring it has refcount 1 and is uniquely owned. - // we should use `dafny_runtime_conversions::rc_struct_to_dafny_class` once it - // accepts unsized types (https://github.com/dafny-lang/dafny/pull/5769) - unsafe { ::dafny_runtime::Object::from_rc(rc) } - }, - }, - crate::types::error::Error::Opaque { obj } => - crate::r#simple::constraints::internaldafny::types::Error::Opaque { - obj: ::dafny_runtime::Object(obj.0) - }, - }) -} - -#[allow(dead_code)] -pub fn from_dafny( - dafny_value: ::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::Error, - >, -) -> crate::types::error::Error { - match ::std::borrow::Borrow::borrow(&dafny_value) { - crate::r#simple::constraints::internaldafny::types::Error::SimpleConstraintsException { message } => - crate::types::error::Error::SimpleConstraintsException { - message: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&message), - }, - crate::r#simple::constraints::internaldafny::types::Error::CollectionOfErrors { list, message } => - crate::types::error::Error::CollectionOfErrors { - message: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(&message), - list: ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(&list, |e| from_dafny(e.clone())) - }, - crate::r#simple::constraints::internaldafny::types::Error::Opaque { obj } => - crate::types::error::Error::Opaque { - obj: obj.clone() - }, - crate::r#simple::constraints::internaldafny::types::Error::Opaque { obj } => - { - use ::std::any::Any; - if ::dafny_runtime::is_object!(obj, crate::types::error::ValidationError) { - let typed = ::dafny_runtime::cast_object!(obj.clone(), crate::types::error::ValidationError); - crate::types::error::Error::ValidationError( - // safety: dafny_class_to_struct will increment ValidationError's Rc - unsafe { - ::dafny_runtime::dafny_runtime_conversions::object::dafny_class_to_struct(typed) - } - ) - } else { - crate::types::error::Error::Opaque { - obj: obj.clone() - } - } - }, - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints.rs b/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints.rs deleted file mode 100644 index c06fecfd2..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints.rs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 _get_constraints_input; - - pub mod _get_constraints_output; diff --git a/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_input.rs b/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_input.rs deleted file mode 100644 index 70ac04aa9..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_input.rs +++ /dev/null @@ -1,192 +0,0 @@ -// 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: crate::operation::get_constraints::GetConstraintsInput, -) -> ::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::GetConstraintsInput, ->{ - ::std::rc::Rc::new(crate::r#simple::constraints::internaldafny::types::GetConstraintsInput::GetConstraintsInput { - MyString: crate::standard_library_conversions::ostring_to_dafny(&value.my_string), - NonEmptyString: crate::standard_library_conversions::ostring_to_dafny(&value.non_empty_string), - StringLessThanOrEqualToTen: crate::standard_library_conversions::ostring_to_dafny(&value.string_less_than_or_equal_to_ten), - MyBlob: crate::standard_library_conversions::oblob_to_dafny(&value.my_blob), - NonEmptyBlob: crate::standard_library_conversions::oblob_to_dafny(&value.non_empty_blob), - BlobLessThanOrEqualToTen: crate::standard_library_conversions::oblob_to_dafny(&value.blob_less_than_or_equal_to_ten), - MyList: ::std::rc::Rc::new(match &value.my_list { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - NonEmptyList: ::std::rc::Rc::new(match &value.non_empty_list { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - ListLessThanOrEqualToTen: ::std::rc::Rc::new(match &value.list_less_than_or_equal_to_ten { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - MyMap: -::std::rc::Rc::new(match &value.my_map { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - NonEmptyMap: -::std::rc::Rc::new(match &value.non_empty_map { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - MapLessThanOrEqualToTen: -::std::rc::Rc::new(match &value.map_less_than_or_equal_to_ten { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - OneToTen: crate::standard_library_conversions::oint_to_dafny(value.one_to_ten), - myTenToTen: crate::standard_library_conversions::olong_to_dafny(&value.my_ten_to_ten), - GreaterThanOne: crate::standard_library_conversions::oint_to_dafny(value.greater_than_one), - LessThanTen: crate::standard_library_conversions::oint_to_dafny(value.less_than_ten), - MyUtf8Bytes: (match value.my_utf8_bytes { - Some(s) => crate::_Wrappers_Compile::Option::Some { value: dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&s.as_bytes().to_vec(), |b| *b) }, - None => crate::_Wrappers_Compile::Option::None {}, -}).into(), - MyListOfUtf8Bytes: ::std::rc::Rc::new(match &value.my_list_of_utf8_bytes { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&e.as_bytes().to_vec(), |b| *b), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - }) -} - #[allow(dead_code)] -pub fn from_dafny( - dafny_value: ::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::GetConstraintsInput, - >, -) -> crate::operation::get_constraints::GetConstraintsInput { - crate::operation::get_constraints::GetConstraintsInput::builder() - .set_my_string(crate::standard_library_conversions::ostring_from_dafny(dafny_value.MyString().clone())) - .set_non_empty_string(crate::standard_library_conversions::ostring_from_dafny(dafny_value.NonEmptyString().clone())) - .set_string_less_than_or_equal_to_ten(crate::standard_library_conversions::ostring_from_dafny(dafny_value.StringLessThanOrEqualToTen().clone())) - .set_my_blob(crate::standard_library_conversions::oblob_from_dafny(dafny_value.MyBlob().clone())) - .set_non_empty_blob(crate::standard_library_conversions::oblob_from_dafny(dafny_value.NonEmptyBlob().clone())) - .set_blob_less_than_or_equal_to_ten(crate::standard_library_conversions::oblob_from_dafny(dafny_value.BlobLessThanOrEqualToTen().clone())) - .set_my_list(match (*dafny_value.MyList()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), - ) - ), - _ => None -} -) - .set_non_empty_list(match (*dafny_value.NonEmptyList()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), - ) - ), - _ => None -} -) - .set_list_less_than_or_equal_to_ten(match (*dafny_value.ListLessThanOrEqualToTen()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), - ) - ), - _ => None -} -) - .set_my_map(match (*dafny_value.MyMap()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), - ) - ), - _ => None -} -) - .set_non_empty_map(match (*dafny_value.NonEmptyMap()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), - ) - ), - _ => None -} -) - .set_map_less_than_or_equal_to_ten(match (*dafny_value.MapLessThanOrEqualToTen()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), - ) - ), - _ => None -} -) - .set_one_to_ten(crate::standard_library_conversions::oint_from_dafny(dafny_value.OneToTen().clone())) - .set_my_ten_to_ten(crate::standard_library_conversions::olong_from_dafny(dafny_value.myTenToTen().clone())) - .set_greater_than_one(crate::standard_library_conversions::oint_from_dafny(dafny_value.GreaterThanOne().clone())) - .set_less_than_ten(crate::standard_library_conversions::oint_from_dafny(dafny_value.LessThanTen().clone())) - .set_my_utf8_bytes(match dafny_value.MyUtf8Bytes().as_ref() { - crate::_Wrappers_Compile::Option::Some { .. } => ::std::option::Option::Some(::std::string::String::from_utf8(dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(&dafny_value.MyUtf8Bytes().Extract(), |b| *b)).unwrap()), - _ => ::std::option::Option::None, -}) - .set_my_list_of_utf8_bytes(match (*dafny_value.MyListOfUtf8Bytes()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| ::std::string::String::from_utf8(dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(&::std::borrow::Borrow::borrow(e), |b| *b)).unwrap(), - ) - ), - _ => None -} -) - .build() - .unwrap() -} diff --git a/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_output.rs b/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_output.rs deleted file mode 100644 index 40dc94a3a..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions/get_constraints/_get_constraints_output.rs +++ /dev/null @@ -1,192 +0,0 @@ -// 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: crate::operation::get_constraints::GetConstraintsOutput, -) -> ::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::GetConstraintsOutput, ->{ - ::std::rc::Rc::new(crate::r#simple::constraints::internaldafny::types::GetConstraintsOutput::GetConstraintsOutput { - MyString: crate::standard_library_conversions::ostring_to_dafny(&value.my_string), - NonEmptyString: crate::standard_library_conversions::ostring_to_dafny(&value.non_empty_string), - StringLessThanOrEqualToTen: crate::standard_library_conversions::ostring_to_dafny(&value.string_less_than_or_equal_to_ten), - MyBlob: crate::standard_library_conversions::oblob_to_dafny(&value.my_blob), - NonEmptyBlob: crate::standard_library_conversions::oblob_to_dafny(&value.non_empty_blob), - BlobLessThanOrEqualToTen: crate::standard_library_conversions::oblob_to_dafny(&value.blob_less_than_or_equal_to_ten), - MyList: ::std::rc::Rc::new(match &value.my_list { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - NonEmptyList: ::std::rc::Rc::new(match &value.non_empty_list { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - ListLessThanOrEqualToTen: ::std::rc::Rc::new(match &value.list_less_than_or_equal_to_ten { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&e), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - MyMap: -::std::rc::Rc::new(match &value.my_map { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - NonEmptyMap: -::std::rc::Rc::new(match &value.non_empty_map { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - MapLessThanOrEqualToTen: -::std::rc::Rc::new(match &value.map_less_than_or_equal_to_ten { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - OneToTen: crate::standard_library_conversions::oint_to_dafny(value.one_to_ten), - thatTenToTen: crate::standard_library_conversions::olong_to_dafny(&value.that_ten_to_ten), - GreaterThanOne: crate::standard_library_conversions::oint_to_dafny(value.greater_than_one), - LessThanTen: crate::standard_library_conversions::oint_to_dafny(value.less_than_ten), - MyUtf8Bytes: (match value.my_utf8_bytes { - Some(s) => crate::_Wrappers_Compile::Option::Some { value: dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&s.as_bytes().to_vec(), |b| *b) }, - None => crate::_Wrappers_Compile::Option::None {}, -}).into(), - MyListOfUtf8Bytes: ::std::rc::Rc::new(match &value.my_list_of_utf8_bytes { - Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x, - |e| dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&e.as_bytes().to_vec(), |b| *b), - ) - }, - None => crate::r#_Wrappers_Compile::Option::None {} -}) -, - }) -} - #[allow(dead_code)] -pub fn from_dafny( - dafny_value: ::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::GetConstraintsOutput, - >, -) -> crate::operation::get_constraints::GetConstraintsOutput { - crate::operation::get_constraints::GetConstraintsOutput::builder() - .set_my_string(crate::standard_library_conversions::ostring_from_dafny(dafny_value.MyString().clone())) - .set_non_empty_string(crate::standard_library_conversions::ostring_from_dafny(dafny_value.NonEmptyString().clone())) - .set_string_less_than_or_equal_to_ten(crate::standard_library_conversions::ostring_from_dafny(dafny_value.StringLessThanOrEqualToTen().clone())) - .set_my_blob(crate::standard_library_conversions::oblob_from_dafny(dafny_value.MyBlob().clone())) - .set_non_empty_blob(crate::standard_library_conversions::oblob_from_dafny(dafny_value.NonEmptyBlob().clone())) - .set_blob_less_than_or_equal_to_ten(crate::standard_library_conversions::oblob_from_dafny(dafny_value.BlobLessThanOrEqualToTen().clone())) - .set_my_list(match (*dafny_value.MyList()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), - ) - ), - _ => None -} -) - .set_non_empty_list(match (*dafny_value.NonEmptyList()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), - ) - ), - _ => None -} -) - .set_list_less_than_or_equal_to_ten(match (*dafny_value.ListLessThanOrEqualToTen()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(e), - ) - ), - _ => None -} -) - .set_my_map(match (*dafny_value.MyMap()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), - ) - ), - _ => None -} -) - .set_non_empty_map(match (*dafny_value.NonEmptyMap()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), - ) - ), - _ => None -} -) - .set_map_less_than_or_equal_to_ten(match (*dafny_value.MapLessThanOrEqualToTen()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, - |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), - |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v), - ) - ), - _ => None -} -) - .set_one_to_ten(crate::standard_library_conversions::oint_from_dafny(dafny_value.OneToTen().clone())) - .set_that_ten_to_ten(crate::standard_library_conversions::olong_from_dafny(dafny_value.thatTenToTen().clone())) - .set_greater_than_one(crate::standard_library_conversions::oint_from_dafny(dafny_value.GreaterThanOne().clone())) - .set_less_than_ten(crate::standard_library_conversions::oint_from_dafny(dafny_value.LessThanTen().clone())) - .set_my_utf8_bytes(match dafny_value.MyUtf8Bytes().as_ref() { - crate::_Wrappers_Compile::Option::Some { .. } => ::std::option::Option::Some(::std::string::String::from_utf8(dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(&dafny_value.MyUtf8Bytes().Extract(), |b| *b)).unwrap()), - _ => ::std::option::Option::None, -}) - .set_my_list_of_utf8_bytes(match (*dafny_value.MyListOfUtf8Bytes()).as_ref() { - crate::r#_Wrappers_Compile::Option::Some { value } => - Some( - ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value, - |e| ::std::string::String::from_utf8(dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(&::std::borrow::Borrow::borrow(e), |b| *b)).unwrap(), - ) - ), - _ => None -} -) - .build() - .unwrap() -} diff --git a/TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config.rs b/TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config.rs deleted file mode 100644 index 7c9daf5e5..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config.rs +++ /dev/null @@ -1,4 +0,0 @@ -// 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 _simple_constraints_config; diff --git a/TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config/_simple_constraints_config.rs b/TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config/_simple_constraints_config.rs deleted file mode 100644 index a9122b8e1..000000000 --- a/TestModels/Constraints/runtimes/rust/src/conversions/simple_constraints_config/_simple_constraints_config.rs +++ /dev/null @@ -1,44 +0,0 @@ -// 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: crate::types::simple_constraints_config::SimpleConstraintsConfig, -) -> ::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig, -> { - ::std::rc::Rc::new(to_dafny_plain(value)) -} - -#[allow(dead_code)] -pub fn from_dafny( - dafny_value: ::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig, - >, -) -> crate::types::simple_constraints_config::SimpleConstraintsConfig { - plain_from_dafny(&*dafny_value) -} - - -#[allow(dead_code)] -pub fn to_dafny_plain( - value: crate::types::simple_constraints_config::SimpleConstraintsConfig, -) -> crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig { - crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig::SimpleConstraintsConfig { - - } -} - -#[allow(dead_code)] -pub fn plain_from_dafny( - dafny_value: &crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig, -) -> crate::types::simple_constraints_config::SimpleConstraintsConfig { - match dafny_value { - crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig::SimpleConstraintsConfig {..} => - crate::types::simple_constraints_config::SimpleConstraintsConfig::builder() - - .build() - .unwrap() - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/error.rs b/TestModels/Constraints/runtimes/rust/src/error.rs deleted file mode 100644 index 4cddaa7c3..000000000 --- a/TestModels/Constraints/runtimes/rust/src/error.rs +++ /dev/null @@ -1,16 +0,0 @@ -// 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 use ::aws_smithy_runtime_api::box_error::BoxError; - -/// Error type returned by the client. -pub type SdkError = - ::aws_smithy_runtime_api::client::result::SdkError; -pub use ::aws_smithy_runtime_api::client::result::ConnectorError; -pub use ::aws_smithy_types::error::operation::BuildError; - -pub use ::aws_smithy_types::error::display::DisplayErrorContext; -pub use ::aws_smithy_types::error::metadata::ErrorMetadata; -pub use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; - -pub(crate) mod sealed_unhandled; diff --git a/TestModels/Constraints/runtimes/rust/src/error/sealed_unhandled.rs b/TestModels/Constraints/runtimes/rust/src/error/sealed_unhandled.rs deleted file mode 100644 index eae800729..000000000 --- a/TestModels/Constraints/runtimes/rust/src/error/sealed_unhandled.rs +++ /dev/null @@ -1,32 +0,0 @@ -// 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. -use std::any::Any; - -use dafny_runtime::UpcastObject; - -/// This struct is not intended to be used. -/// -/// This struct holds information about an unhandled error, -/// but that information should be obtained by using the -/// [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) trait -/// on the error type. -/// -/// This struct intentionally doesn't yield any useful information itself. -#[deprecated( - note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ -variable wildcard pattern and check `.code()`: - \ -   `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` - \ -See [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) for what information is available for the error." -)] -#[derive(Debug)] -pub struct Unhandled { - pub(crate) source: ::aws_smithy_runtime_api::box_error::BoxError, - pub(crate) meta: ::aws_smithy_types::error::metadata::ErrorMetadata, -} - -impl UpcastObject for Unhandled { - ::dafny_runtime::UpcastObjectFn!(dyn ::std::any::Any); -} diff --git a/TestModels/Constraints/runtimes/rust/src/operation.rs b/TestModels/Constraints/runtimes/rust/src/operation.rs deleted file mode 100644 index a0d185ab4..000000000 --- a/TestModels/Constraints/runtimes/rust/src/operation.rs +++ /dev/null @@ -1,5 +0,0 @@ -// 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. -/// Types for the `GetConstraints` operation. -pub mod get_constraints; diff --git a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints.rs b/TestModels/Constraints/runtimes/rust/src/operation/get_constraints.rs deleted file mode 100644 index 67d7d725f..000000000 --- a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints.rs +++ /dev/null @@ -1,156 +0,0 @@ -// 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. -/// Orchestration and serialization glue logic for `GetConstraints`. -#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] -#[non_exhaustive] -pub struct GetConstraints; -impl GetConstraints { - /// Creates a new `GetConstraints` - pub fn new() -> Self { - Self - } - - pub(crate) async fn send( - client: &crate::client::Client, - input: crate::operation::get_constraints::GetConstraintsInput, - ) -> ::std::result::Result< - crate::operation::get_constraints::GetConstraintsOutput, - crate::types::error::Error, - > { - if matches!(input.my_string, Some(ref x) if !(1..=10).contains(&x.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add))) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "my_string", - "my_string failed to satisfy constraint: Member must have length between 1 and 10, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.non_empty_string, Some(ref x) if !(1..).contains(&x.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add))) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "non_empty_string", - "non_empty_string failed to satisfy constraint: Member must have length greater than or equal to 1", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.string_less_than_or_equal_to_ten, Some(ref x) if !(..=10).contains(&x.chars().map(::std::primitive::char::len_utf16).fold(0usize, ::std::ops::Add::add))) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "string_less_than_or_equal_to_ten", - "string_less_than_or_equal_to_ten failed to satisfy constraint: Member must have length less than or equal to 10", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.my_blob, Some(ref x) if !(1..=10).contains(&x.as_ref().len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "my_blob", - "my_blob failed to satisfy constraint: Member must have length between 1 and 10, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.non_empty_blob, Some(ref x) if !(1..).contains(&x.as_ref().len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "non_empty_blob", - "non_empty_blob failed to satisfy constraint: Member must have length greater than or equal to 1", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.blob_less_than_or_equal_to_ten, Some(ref x) if !(..=10).contains(&x.as_ref().len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "blob_less_than_or_equal_to_ten", - "blob_less_than_or_equal_to_ten failed to satisfy constraint: Member must have length less than or equal to 10", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.my_list, Some(ref x) if !(1..=10).contains(&x.len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "my_list", - "my_list failed to satisfy constraint: Member must have length between 1 and 10, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.non_empty_list, Some(ref x) if !(1..).contains(&x.len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "non_empty_list", - "non_empty_list failed to satisfy constraint: Member must have length greater than or equal to 1", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.list_less_than_or_equal_to_ten, Some(ref x) if !(..=10).contains(&x.len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "list_less_than_or_equal_to_ten", - "list_less_than_or_equal_to_ten failed to satisfy constraint: Member must have length less than or equal to 10", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.my_map, Some(ref x) if !(1..=10).contains(&x.len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "my_map", - "my_map failed to satisfy constraint: Member must have length between 1 and 10, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.non_empty_map, Some(ref x) if !(1..).contains(&x.len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "non_empty_map", - "non_empty_map failed to satisfy constraint: Member must have length greater than or equal to 1", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.map_less_than_or_equal_to_ten, Some(ref x) if !(..=10).contains(&x.len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "map_less_than_or_equal_to_ten", - "map_less_than_or_equal_to_ten failed to satisfy constraint: Member must have length less than or equal to 10", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.one_to_ten, Some(x) if !(1..=10).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "one_to_ten", - "one_to_ten failed to satisfy constraint: Member must be between 1 and 10, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.my_ten_to_ten, Some(x) if !(-10..=10).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "my_ten_to_ten", - "my_ten_to_ten failed to satisfy constraint: Member must be between -10 and 10, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.greater_than_one, Some(x) if !(1..).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "greater_than_one", - "greater_than_one failed to satisfy constraint: Member must be greater than or equal to 1", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.less_than_ten, Some(x) if !(..=10).contains(&x)) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "less_than_ten", - "less_than_ten failed to satisfy constraint: Member must be less than or equal to 10", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.my_utf8_bytes, Some(ref x) if !(1..=10).contains(&x.chars().count())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "my_utf8_bytes", - "my_utf8_bytes failed to satisfy constraint: Member must have length between 1 and 10, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} -if matches!(input.my_list_of_utf8_bytes, Some(ref x) if !(1..=2).contains(&x.len())) { - return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::invalid_field( - "my_list_of_utf8_bytes", - "my_list_of_utf8_bytes failed to satisfy constraint: Member must have length between 1 and 2, inclusive", - )).map_err(crate::types::error::Error::wrap_validation_err); -} - let inner_input = crate::conversions::get_constraints::_get_constraints_input::to_dafny(input); - let inner_result = - ::dafny_runtime::md!(client.dafny_client.clone()).GetConstraints(&inner_input); - if matches!( - inner_result.as_ref(), - crate::r#_Wrappers_Compile::Result::Success { .. } - ) { - Ok( - crate::conversions::get_constraints::_get_constraints_output::from_dafny(inner_result.value().clone()), - ) - } else { - Err(crate::conversions::error::from_dafny( - inner_result.error().clone(), - )) - } - } -} - -pub use crate::operation::get_constraints::_get_constraints_output::GetConstraintsOutput; - -pub use crate::operation::get_constraints::_get_constraints_input::GetConstraintsInput; - -pub(crate) mod _get_constraints_output; - -pub(crate) mod _get_constraints_input; - -/// Builders -pub mod builders; diff --git a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_input.rs b/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_input.rs deleted file mode 100644 index 8f78f7408..000000000 --- a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_input.rs +++ /dev/null @@ -1,432 +0,0 @@ -// 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(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] -pub struct GetConstraintsInput { - #[allow(missing_docs)] // documentation missing in model -pub blob_less_than_or_equal_to_ten: ::std::option::Option<::aws_smithy_types::Blob>, -#[allow(missing_docs)] // documentation missing in model -pub greater_than_one: ::std::option::Option<::std::primitive::i32>, -#[allow(missing_docs)] // documentation missing in model -pub less_than_ten: ::std::option::Option<::std::primitive::i32>, -#[allow(missing_docs)] // documentation missing in model -pub list_less_than_or_equal_to_ten: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub map_less_than_or_equal_to_ten: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_blob: ::std::option::Option<::aws_smithy_types::Blob>, -#[allow(missing_docs)] // documentation missing in model -pub my_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_list_of_utf8_bytes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_string: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub my_utf8_bytes: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_blob: ::std::option::Option<::aws_smithy_types::Blob>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_string: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub one_to_ten: ::std::option::Option<::std::primitive::i32>, -#[allow(missing_docs)] // documentation missing in model -pub string_less_than_or_equal_to_ten: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub my_ten_to_ten: ::std::option::Option<::std::primitive::i64>, -} -impl GetConstraintsInput { - #[allow(missing_docs)] // documentation missing in model -pub fn blob_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.blob_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn greater_than_one(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.greater_than_one -} -#[allow(missing_docs)] // documentation missing in model -pub fn less_than_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.less_than_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn list_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.list_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn map_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.map_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.my_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list_of_utf8_bytes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list_of_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.my_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_string(&self) -> &::std::option::Option<::std::string::String> { - &self.my_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_utf8_bytes(&self) -> &::std::option::Option<::std::string::String> { - &self.my_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.non_empty_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.non_empty_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.non_empty_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_string(&self) -> &::std::option::Option<::std::string::String> { - &self.non_empty_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn one_to_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.one_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn string_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::string::String> { - &self.string_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_ten_to_ten(&self) -> &::std::option::Option<::std::primitive::i64> { - &self.my_ten_to_ten -} -} -impl GetConstraintsInput { - /// Creates a new builder-style object to manufacture [`GetConstraintsInput`](crate::operation::get_constraints::builders::GetConstraintsInput). - pub fn builder() -> crate::operation::get_constraints::builders::GetConstraintsInputBuilder { - crate::operation::get_constraints::builders::GetConstraintsInputBuilder::default() - } -} - -/// A builder for [`GetConstraintsInput`](crate::operation::operation::GetConstraintsInput). -#[non_exhaustive] -#[derive( - ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug, -)] -pub struct GetConstraintsInputBuilder { - pub(crate) blob_less_than_or_equal_to_ten: ::std::option::Option<::aws_smithy_types::Blob>, -pub(crate) greater_than_one: ::std::option::Option<::std::primitive::i32>, -pub(crate) less_than_ten: ::std::option::Option<::std::primitive::i32>, -pub(crate) list_less_than_or_equal_to_ten: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) map_less_than_or_equal_to_ten: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -pub(crate) my_blob: ::std::option::Option<::aws_smithy_types::Blob>, -pub(crate) my_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) my_list_of_utf8_bytes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) my_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -pub(crate) my_string: ::std::option::Option<::std::string::String>, -pub(crate) my_utf8_bytes: ::std::option::Option<::std::string::String>, -pub(crate) non_empty_blob: ::std::option::Option<::aws_smithy_types::Blob>, -pub(crate) non_empty_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) non_empty_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -pub(crate) non_empty_string: ::std::option::Option<::std::string::String>, -pub(crate) one_to_ten: ::std::option::Option<::std::primitive::i32>, -pub(crate) string_less_than_or_equal_to_ten: ::std::option::Option<::std::string::String>, -pub(crate) my_ten_to_ten: ::std::option::Option<::std::primitive::i64>, -} -impl GetConstraintsInputBuilder { - #[allow(missing_docs)] // documentation missing in model -pub fn blob_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.blob_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_blob_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.blob_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_blob_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.blob_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn greater_than_one(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.greater_than_one = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_greater_than_one(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.greater_than_one = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_greater_than_one(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.greater_than_one -} -#[allow(missing_docs)] // documentation missing in model -pub fn less_than_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.less_than_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_less_than_ten(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.less_than_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_less_than_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.less_than_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn list_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.list_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_list_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.list_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_list_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.list_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn map_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.map_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_map_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.map_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_map_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.map_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_blob(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.my_blob = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.my_blob = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.my_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list_of_utf8_bytes(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list_of_utf8_bytes = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_list_of_utf8_bytes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list_of_utf8_bytes = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_list_of_utf8_bytes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list_of_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_map(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.my_map = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.my_map = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.my_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.my_string = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.my_string = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_string(&self) -> &::std::option::Option<::std::string::String> { - &self.my_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_utf8_bytes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.my_utf8_bytes = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_utf8_bytes(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.my_utf8_bytes = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_utf8_bytes(&self) -> &::std::option::Option<::std::string::String> { - &self.my_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_blob(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.non_empty_blob = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.non_empty_blob = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.non_empty_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_list(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.non_empty_list = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.non_empty_list = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.non_empty_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_map(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.non_empty_map = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.non_empty_map = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.non_empty_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.non_empty_string = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.non_empty_string = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_string(&self) -> &::std::option::Option<::std::string::String> { - &self.non_empty_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn one_to_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.one_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_one_to_ten(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.one_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_one_to_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.one_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn string_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.string_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_string_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.string_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_string_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::string::String> { - &self.string_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_ten_to_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i64>) -> Self { - self.my_ten_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_ten_to_ten(mut self, input: ::std::option::Option<::std::primitive::i64>) -> Self { - self.my_ten_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_ten_to_ten(&self) -> &::std::option::Option<::std::primitive::i64> { - &self.my_ten_to_ten -} - /// Consumes the builder and constructs a [`GetConstraintsInput`](crate::operation::operation::GetConstraintsInput). - pub fn build( - self, - ) -> ::std::result::Result< - crate::operation::get_constraints::GetConstraintsInput, - ::aws_smithy_types::error::operation::BuildError, - > { - ::std::result::Result::Ok(crate::operation::get_constraints::GetConstraintsInput { - blob_less_than_or_equal_to_ten: self.blob_less_than_or_equal_to_ten, -greater_than_one: self.greater_than_one, -less_than_ten: self.less_than_ten, -list_less_than_or_equal_to_ten: self.list_less_than_or_equal_to_ten, -map_less_than_or_equal_to_ten: self.map_less_than_or_equal_to_ten, -my_blob: self.my_blob, -my_list: self.my_list, -my_list_of_utf8_bytes: self.my_list_of_utf8_bytes, -my_map: self.my_map, -my_string: self.my_string, -my_utf8_bytes: self.my_utf8_bytes, -non_empty_blob: self.non_empty_blob, -non_empty_list: self.non_empty_list, -non_empty_map: self.non_empty_map, -non_empty_string: self.non_empty_string, -one_to_ten: self.one_to_ten, -string_less_than_or_equal_to_ten: self.string_less_than_or_equal_to_ten, -my_ten_to_ten: self.my_ten_to_ten, - }) - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_output.rs b/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_output.rs deleted file mode 100644 index 1edc3e2d0..000000000 --- a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/_get_constraints_output.rs +++ /dev/null @@ -1,432 +0,0 @@ -// 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(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] -pub struct GetConstraintsOutput { - #[allow(missing_docs)] // documentation missing in model -pub blob_less_than_or_equal_to_ten: ::std::option::Option<::aws_smithy_types::Blob>, -#[allow(missing_docs)] // documentation missing in model -pub greater_than_one: ::std::option::Option<::std::primitive::i32>, -#[allow(missing_docs)] // documentation missing in model -pub less_than_ten: ::std::option::Option<::std::primitive::i32>, -#[allow(missing_docs)] // documentation missing in model -pub list_less_than_or_equal_to_ten: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub map_less_than_or_equal_to_ten: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_blob: ::std::option::Option<::aws_smithy_types::Blob>, -#[allow(missing_docs)] // documentation missing in model -pub my_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_list_of_utf8_bytes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub my_string: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub my_utf8_bytes: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_blob: ::std::option::Option<::aws_smithy_types::Blob>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -#[allow(missing_docs)] // documentation missing in model -pub non_empty_string: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub one_to_ten: ::std::option::Option<::std::primitive::i32>, -#[allow(missing_docs)] // documentation missing in model -pub string_less_than_or_equal_to_ten: ::std::option::Option<::std::string::String>, -#[allow(missing_docs)] // documentation missing in model -pub that_ten_to_ten: ::std::option::Option<::std::primitive::i64>, -} -impl GetConstraintsOutput { - #[allow(missing_docs)] // documentation missing in model -pub fn blob_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.blob_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn greater_than_one(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.greater_than_one -} -#[allow(missing_docs)] // documentation missing in model -pub fn less_than_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.less_than_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn list_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.list_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn map_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.map_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.my_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list_of_utf8_bytes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list_of_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.my_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_string(&self) -> &::std::option::Option<::std::string::String> { - &self.my_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_utf8_bytes(&self) -> &::std::option::Option<::std::string::String> { - &self.my_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.non_empty_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.non_empty_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.non_empty_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_string(&self) -> &::std::option::Option<::std::string::String> { - &self.non_empty_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn one_to_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.one_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn string_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::string::String> { - &self.string_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn that_ten_to_ten(&self) -> &::std::option::Option<::std::primitive::i64> { - &self.that_ten_to_ten -} -} -impl GetConstraintsOutput { - /// Creates a new builder-style object to manufacture [`GetConstraintsOutput`](crate::operation::get_constraints::builders::GetConstraintsOutput). - pub fn builder() -> crate::operation::get_constraints::builders::GetConstraintsOutputBuilder { - crate::operation::get_constraints::builders::GetConstraintsOutputBuilder::default() - } -} - -/// A builder for [`GetConstraintsOutput`](crate::operation::operation::GetConstraintsOutput). -#[non_exhaustive] -#[derive( - ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug, -)] -pub struct GetConstraintsOutputBuilder { - pub(crate) blob_less_than_or_equal_to_ten: ::std::option::Option<::aws_smithy_types::Blob>, -pub(crate) greater_than_one: ::std::option::Option<::std::primitive::i32>, -pub(crate) less_than_ten: ::std::option::Option<::std::primitive::i32>, -pub(crate) list_less_than_or_equal_to_ten: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) map_less_than_or_equal_to_ten: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -pub(crate) my_blob: ::std::option::Option<::aws_smithy_types::Blob>, -pub(crate) my_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) my_list_of_utf8_bytes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) my_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -pub(crate) my_string: ::std::option::Option<::std::string::String>, -pub(crate) my_utf8_bytes: ::std::option::Option<::std::string::String>, -pub(crate) non_empty_blob: ::std::option::Option<::aws_smithy_types::Blob>, -pub(crate) non_empty_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -pub(crate) non_empty_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, -pub(crate) non_empty_string: ::std::option::Option<::std::string::String>, -pub(crate) one_to_ten: ::std::option::Option<::std::primitive::i32>, -pub(crate) string_less_than_or_equal_to_ten: ::std::option::Option<::std::string::String>, -pub(crate) that_ten_to_ten: ::std::option::Option<::std::primitive::i64>, -} -impl GetConstraintsOutputBuilder { - #[allow(missing_docs)] // documentation missing in model -pub fn blob_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.blob_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_blob_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.blob_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_blob_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.blob_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn greater_than_one(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.greater_than_one = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_greater_than_one(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.greater_than_one = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_greater_than_one(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.greater_than_one -} -#[allow(missing_docs)] // documentation missing in model -pub fn less_than_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.less_than_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_less_than_ten(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.less_than_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_less_than_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.less_than_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn list_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.list_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_list_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.list_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_list_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.list_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn map_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.map_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_map_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.map_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_map_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.map_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_blob(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.my_blob = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.my_blob = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.my_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list_of_utf8_bytes(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list_of_utf8_bytes = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_list_of_utf8_bytes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.my_list_of_utf8_bytes = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_list_of_utf8_bytes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.my_list_of_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_map(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.my_map = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.my_map = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.my_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.my_string = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.my_string = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_string(&self) -> &::std::option::Option<::std::string::String> { - &self.my_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_utf8_bytes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.my_utf8_bytes = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_utf8_bytes(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.my_utf8_bytes = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_utf8_bytes(&self) -> &::std::option::Option<::std::string::String> { - &self.my_utf8_bytes -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_blob(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.non_empty_blob = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.non_empty_blob = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - &self.non_empty_blob -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_list(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.non_empty_list = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.non_empty_list = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - &self.non_empty_list -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_map(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.non_empty_map = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.non_empty_map = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - &self.non_empty_map -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.non_empty_string = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.non_empty_string = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_string(&self) -> &::std::option::Option<::std::string::String> { - &self.non_empty_string -} -#[allow(missing_docs)] // documentation missing in model -pub fn one_to_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.one_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_one_to_ten(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.one_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_one_to_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - &self.one_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn string_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.string_less_than_or_equal_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_string_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.string_less_than_or_equal_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_string_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::string::String> { - &self.string_less_than_or_equal_to_ten -} -#[allow(missing_docs)] // documentation missing in model -pub fn that_ten_to_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i64>) -> Self { - self.that_ten_to_ten = ::std::option::Option::Some(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_that_ten_to_ten(mut self, input: ::std::option::Option<::std::primitive::i64>) -> Self { - self.that_ten_to_ten = input; - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_that_ten_to_ten(&self) -> &::std::option::Option<::std::primitive::i64> { - &self.that_ten_to_ten -} - /// Consumes the builder and constructs a [`GetConstraintsOutput`](crate::operation::operation::GetConstraintsOutput). - pub fn build( - self, - ) -> ::std::result::Result< - crate::operation::get_constraints::GetConstraintsOutput, - ::aws_smithy_types::error::operation::BuildError, - > { - ::std::result::Result::Ok(crate::operation::get_constraints::GetConstraintsOutput { - blob_less_than_or_equal_to_ten: self.blob_less_than_or_equal_to_ten, -greater_than_one: self.greater_than_one, -less_than_ten: self.less_than_ten, -list_less_than_or_equal_to_ten: self.list_less_than_or_equal_to_ten, -map_less_than_or_equal_to_ten: self.map_less_than_or_equal_to_ten, -my_blob: self.my_blob, -my_list: self.my_list, -my_list_of_utf8_bytes: self.my_list_of_utf8_bytes, -my_map: self.my_map, -my_string: self.my_string, -my_utf8_bytes: self.my_utf8_bytes, -non_empty_blob: self.non_empty_blob, -non_empty_list: self.non_empty_list, -non_empty_map: self.non_empty_map, -non_empty_string: self.non_empty_string, -one_to_ten: self.one_to_ten, -string_less_than_or_equal_to_ten: self.string_less_than_or_equal_to_ten, -that_ten_to_ten: self.that_ten_to_ten, - }) - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/builders.rs b/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/builders.rs deleted file mode 100644 index 091ada9ce..000000000 --- a/TestModels/Constraints/runtimes/rust/src/operation/get_constraints/builders.rs +++ /dev/null @@ -1,313 +0,0 @@ -// 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 use crate::operation::get_constraints::_get_constraints_output::GetConstraintsOutputBuilder; - -pub use crate::operation::get_constraints::_get_constraints_input::GetConstraintsInputBuilder; - -impl GetConstraintsInputBuilder { - /// Sends a request with this input using the given client. - pub async fn send_with( - self, - client: &crate::client::Client, - ) -> ::std::result::Result< - crate::operation::get_constraints::GetConstraintsOutput, - crate::types::error::Error, - > { - let mut fluent_builder = client.get_constraints(); - fluent_builder.inner = self; - fluent_builder.send().await - } -} -/// Fluent builder constructing a request to `GetConstraints`. -/// -#[derive(::std::clone::Clone, ::std::fmt::Debug)] -pub struct GetConstraintsFluentBuilder { - client: crate::client::Client, - pub(crate) inner: crate::operation::get_constraints::builders::GetConstraintsInputBuilder, -} -impl GetConstraintsFluentBuilder { - /// Creates a new `GetConstraints`. - pub(crate) fn new(client: crate::client::Client) -> Self { - Self { - client, - inner: ::std::default::Default::default(), - } - } - /// Access the GetConstraints as a reference. - pub fn as_input(&self) -> &crate::operation::get_constraints::builders::GetConstraintsInputBuilder { - &self.inner - } - /// Sends the request and returns the response. - pub async fn send( - self, - ) -> ::std::result::Result< - crate::operation::get_constraints::GetConstraintsOutput, - crate::types::error::Error, - > { - let input = self - .inner - .build() - // Using Opaque since we don't have a validation-specific error yet. - // Operations' models don't declare their own validation error, - // and smithy-rs seems to not generate a ValidationError case unless there is. - // Vanilla smithy-rs uses SdkError::construction_failure, but we aren't using SdkError. - .map_err(|mut e| crate::types::error::Error::Opaque { - obj: ::dafny_runtime::Object::from_ref(&mut e as &mut dyn ::std::any::Any) - })?; - crate::operation::get_constraints::GetConstraints::send(&self.client, input).await - } - - #[allow(missing_docs)] // documentation missing in model -pub fn blob_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.inner = self.inner.blob_less_than_or_equal_to_ten(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_blob_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.inner = self.inner.set_blob_less_than_or_equal_to_ten(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_blob_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - self.inner.get_blob_less_than_or_equal_to_ten() -} -#[allow(missing_docs)] // documentation missing in model -pub fn greater_than_one(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.inner = self.inner.greater_than_one(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_greater_than_one(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.inner = self.inner.set_greater_than_one(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_greater_than_one(&self) -> &::std::option::Option<::std::primitive::i32> { - self.inner.get_greater_than_one() -} -#[allow(missing_docs)] // documentation missing in model -pub fn less_than_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.inner = self.inner.less_than_ten(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_less_than_ten(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.inner = self.inner.set_less_than_ten(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_less_than_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - self.inner.get_less_than_ten() -} -#[allow(missing_docs)] // documentation missing in model -pub fn list_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.list_less_than_or_equal_to_ten(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_list_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.set_list_less_than_or_equal_to_ten(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_list_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - self.inner.get_list_less_than_or_equal_to_ten() -} -#[allow(missing_docs)] // documentation missing in model -pub fn map_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.inner = self.inner.map_less_than_or_equal_to_ten(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_map_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.inner = self.inner.set_map_less_than_or_equal_to_ten(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_map_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - self.inner.get_map_less_than_or_equal_to_ten() -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_blob(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.inner = self.inner.my_blob(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.inner = self.inner.set_my_blob(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - self.inner.get_my_blob() -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.my_list(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.set_my_list(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - self.inner.get_my_list() -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_list_of_utf8_bytes(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.my_list_of_utf8_bytes(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_list_of_utf8_bytes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.set_my_list_of_utf8_bytes(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_list_of_utf8_bytes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - self.inner.get_my_list_of_utf8_bytes() -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_map(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.inner = self.inner.my_map(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.inner = self.inner.set_my_map(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - self.inner.get_my_map() -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.inner = self.inner.my_string(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.inner = self.inner.set_my_string(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_string(&self) -> &::std::option::Option<::std::string::String> { - self.inner.get_my_string() -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_utf8_bytes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.inner = self.inner.my_utf8_bytes(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_utf8_bytes(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.inner = self.inner.set_my_utf8_bytes(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_utf8_bytes(&self) -> &::std::option::Option<::std::string::String> { - self.inner.get_my_utf8_bytes() -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_blob(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self { - self.inner = self.inner.non_empty_blob(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self { - self.inner = self.inner.set_non_empty_blob(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> { - self.inner.get_non_empty_blob() -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_list(mut self, input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.non_empty_list(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { - self.inner = self.inner.set_non_empty_list(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { - self.inner.get_non_empty_list() -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_map(mut self, input: impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.inner = self.inner.non_empty_map(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { - self.inner = self.inner.set_non_empty_map(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { - self.inner.get_non_empty_map() -} -#[allow(missing_docs)] // documentation missing in model -pub fn non_empty_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.inner = self.inner.non_empty_string(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_non_empty_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.inner = self.inner.set_non_empty_string(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_non_empty_string(&self) -> &::std::option::Option<::std::string::String> { - self.inner.get_non_empty_string() -} -#[allow(missing_docs)] // documentation missing in model -pub fn one_to_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self { - self.inner = self.inner.one_to_ten(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_one_to_ten(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self { - self.inner = self.inner.set_one_to_ten(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_one_to_ten(&self) -> &::std::option::Option<::std::primitive::i32> { - self.inner.get_one_to_ten() -} -#[allow(missing_docs)] // documentation missing in model -pub fn string_less_than_or_equal_to_ten(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { - self.inner = self.inner.string_less_than_or_equal_to_ten(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_string_less_than_or_equal_to_ten(mut self, input: ::std::option::Option<::std::string::String>) -> Self { - self.inner = self.inner.set_string_less_than_or_equal_to_ten(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_string_less_than_or_equal_to_ten(&self) -> &::std::option::Option<::std::string::String> { - self.inner.get_string_less_than_or_equal_to_ten() -} -#[allow(missing_docs)] // documentation missing in model -pub fn my_ten_to_ten(mut self, input: impl ::std::convert::Into<::std::primitive::i64>) -> Self { - self.inner = self.inner.my_ten_to_ten(input.into()); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn set_my_ten_to_ten(mut self, input: ::std::option::Option<::std::primitive::i64>) -> Self { - self.inner = self.inner.set_my_ten_to_ten(input); - self -} -#[allow(missing_docs)] // documentation missing in model -pub fn get_my_ten_to_ten(&self) -> &::std::option::Option<::std::primitive::i64> { - self.inner.get_my_ten_to_ten() -} -} diff --git a/TestModels/Constraints/runtimes/rust/src/standard_library_conversions.rs b/TestModels/Constraints/runtimes/rust/src/standard_library_conversions.rs deleted file mode 100644 index 6bf8297d8..000000000 --- a/TestModels/Constraints/runtimes/rust/src/standard_library_conversions.rs +++ /dev/null @@ -1,266 +0,0 @@ -pub fn ostring_to_dafny( - input: &Option, -) -> ::std::rc::Rc< - crate::_Wrappers_Compile::Option<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>, -> { - let dafny_value = match input { - Some(b) => crate::_Wrappers_Compile::Option::Some { value: - dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&b) - }, - None => crate::_Wrappers_Compile::Option::None {}, -}; - ::std::rc::Rc::new(dafny_value) -} - -pub fn ostring_from_dafny( - input: ::std::rc::Rc< - crate::_Wrappers_Compile::Option< - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - >, - >, -) -> Option { - if matches!( - input.as_ref(), - crate::_Wrappers_Compile::Option::Some { .. } - ) { - Some( - dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string( - &input.Extract(), - ), - ) - } else { - None - } -} - -pub fn obool_to_dafny( - input: &Option, -) -> ::std::rc::Rc> { - let dafny_value = match input { - Some(b) => crate::_Wrappers_Compile::Option::Some { value: *b }, - None => crate::_Wrappers_Compile::Option::None {}, - }; - ::std::rc::Rc::new(dafny_value) -} - -pub fn obool_from_dafny( - input: ::std::rc::Rc>, -) -> Option { - if matches!( - input.as_ref(), - crate::_Wrappers_Compile::Option::Some { .. } - ) { - Some(input.Extract()) - } else { - None - } -} - -pub fn oint_to_dafny(input: Option) -> ::std::rc::Rc> { - let dafny_value = match input { - Some(b) => crate::_Wrappers_Compile::Option::Some { value: b }, - None => crate::_Wrappers_Compile::Option::None {}, - }; - ::std::rc::Rc::new(dafny_value) -} - -pub fn oint_from_dafny(input: ::std::rc::Rc>) -> Option { - if matches!( - input.as_ref(), - crate::_Wrappers_Compile::Option::Some { .. } - ) { - Some(input.Extract()) - } else { - None - } -} - -pub fn olong_to_dafny(input: &Option) -> ::std::rc::Rc> { - let dafny_value = match input { - Some(b) => crate::_Wrappers_Compile::Option::Some { value: *b }, - None => crate::_Wrappers_Compile::Option::None {}, - }; - ::std::rc::Rc::new(dafny_value) -} - -pub fn olong_from_dafny( - input: ::std::rc::Rc>, -) -> Option { - if matches!( - input.as_ref(), - crate::_Wrappers_Compile::Option::Some { .. } - ) { - Some(input.Extract()) - } else { - None - } -} - -pub fn blob_to_dafny(input: &::aws_smithy_types::Blob) -> ::dafny_runtime::Sequence { - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&input.clone().into_inner(), |x| *x) -} - -pub fn oblob_to_dafny( - input: &Option<::aws_smithy_types::Blob>, -) -> ::std::rc::Rc>> { - let dafny_value = match input { - Some(b) => crate::_Wrappers_Compile::Option::Some { - value: blob_to_dafny(&b), - }, - None => crate::_Wrappers_Compile::Option::None {}, - }; - ::std::rc::Rc::new(dafny_value) -} - -pub fn blob_from_dafny(input: ::dafny_runtime::Sequence) -> ::aws_smithy_types::Blob { - ::aws_smithy_types::Blob::new( - ::std::rc::Rc::try_unwrap(input.to_array()).unwrap_or_else(|rc| (*rc).clone()), - ) -} - -pub fn oblob_from_dafny( - input: ::std::rc::Rc>>, -) -> Option<::aws_smithy_types::Blob> { - if matches!( - input.as_ref(), - crate::_Wrappers_Compile::Option::Some { .. } - ) { - Some(blob_from_dafny(input.Extract())) - } else { - None - } -} - -pub fn double_to_dafny(input: f64) -> ::dafny_runtime::Sequence { - ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence( - &f64::to_be_bytes(input).to_vec(), - |x| *x, - ) -} - -pub fn odouble_to_dafny( - input: &Option, -) -> ::std::rc::Rc>> { - let dafny_value = match input { - Some(f) => crate::_Wrappers_Compile::Option::Some { - value: double_to_dafny(*f), - }, - None => crate::_Wrappers_Compile::Option::None {}, - }; - ::std::rc::Rc::new(dafny_value) -} - -pub fn double_from_dafny(input: &::dafny_runtime::Sequence) -> f64 { - let v = ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(input, |x| *x); - f64::from_be_bytes(v.try_into().expect("Error converting Sequence to f64")) -} - -pub fn odouble_from_dafny( - input: ::std::rc::Rc>>, -) -> Option { - if matches!( - input.as_ref(), - crate::_Wrappers_Compile::Option::Some { .. } - ) { - Some(double_from_dafny(&input.Extract())) - } else { - None - } -} - -pub fn timestamp_to_dafny( - input: &::aws_smithy_types::DateTime, -) -> ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> { - ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string( - &input.to_string(), - ) -} - -pub fn otimestamp_to_dafny( - input: &Option<::aws_smithy_types::DateTime>, -) -> ::std::rc::Rc< - crate::_Wrappers_Compile::Option<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>, -> { - let dafny_value = match input { - Some(f) => crate::_Wrappers_Compile::Option::Some { - value: timestamp_to_dafny(f), - }, - None => crate::_Wrappers_Compile::Option::None {}, - }; - ::std::rc::Rc::new(dafny_value) -} - -pub fn timestamp_from_dafny( - input: ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, -) -> ::aws_smithy_types::DateTime { - let s = dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string( - &input, - ); - ::aws_smithy_types::DateTime::from_str(&s, aws_smithy_types::date_time::Format::DateTime) - .unwrap() -} - -pub fn otimestamp_from_dafny( - input: ::std::rc::Rc< - crate::_Wrappers_Compile::Option< - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - >, - >, -) -> Option<::aws_smithy_types::DateTime> { - if matches!( - input.as_ref(), - crate::_Wrappers_Compile::Option::Some { .. } - ) { - Some(timestamp_from_dafny(input.Extract())) - } else { - None - } -} - -pub fn option_from_dafny( - input: ::std::rc::Rc>, - converter: fn(&T) -> TR, -) -> Option { - match &*input { - crate::_Wrappers_Compile::Option::Some { value } => Some(converter(value)), - crate::_Wrappers_Compile::Option::None {} => None, - } -} - -pub fn option_to_dafny( - input: &Option, - converter: fn(&TR) -> T, -) -> ::std::rc::Rc> { - match input { - Some(value) => ::std::rc::Rc::new(crate::_Wrappers_Compile::Option::Some { - value: converter(&value), - }), - None => ::std::rc::Rc::new(crate::_Wrappers_Compile::Option::None {}), - } -} - -pub fn result_from_dafny( - input: ::std::rc::Rc>, - converter_t: fn(&T) -> TR, - converter_e: fn(&E) -> ER, -) -> Result { - match &*input { - crate::_Wrappers_Compile::Result::Success { value } => Ok(converter_t(value)), - crate::_Wrappers_Compile::Result::Failure { error } => Err(converter_e(error)), - } -} - -pub fn result_to_dafny( - input: &Result, - converter_t: fn(&TR) -> T, - converter_e: fn(&ER) -> E, -) -> ::std::rc::Rc> { - match input { - Ok(value) => ::std::rc::Rc::new(crate::_Wrappers_Compile::Result::Success { - value: converter_t(&value), - }), - Err(error) => ::std::rc::Rc::new(crate::_Wrappers_Compile::Result::Failure { - error: converter_e(&error), - }), - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/standard_library_externs.rs b/TestModels/Constraints/runtimes/rust/src/standard_library_externs.rs deleted file mode 100644 index eca6a2980..000000000 --- a/TestModels/Constraints/runtimes/rust/src/standard_library_externs.rs +++ /dev/null @@ -1,80 +0,0 @@ -// Annotation to ignore the case of this module -use crate::r#_Wrappers_Compile; -use crate::UTF8; - -impl crate::UTF8::_default { - pub fn Encode( - s: &::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - ) -> ::std::rc::Rc< - r#_Wrappers_Compile::Result< - UTF8::ValidUTF8Bytes, - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - >, - > { - let v = s.to_array(); - let mut _accumulator: Vec = vec![]; - // Use of .encode_utf8 method. - let mut surrogate: Option = None; - for c in v.iter() { - let s = if let Some(s) = surrogate { - String::from_utf16(&[s, c.0]) - } else { - String::from_utf16(&[c.0]) - }; - surrogate = None; - match s { - Ok(value) => { - _accumulator.extend(value.as_bytes()); - continue; - } - Err(e) => { - if 0xD800 <= c.0 && c.0 <= 0xDFFF { - surrogate = Some(c.0); - continue; - } - return ::std::rc::Rc::new(r#_Wrappers_Compile::Result::>::Failure { - error: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string( - &e.to_string()) - }); - } - } - } - if let Some(s) = surrogate { - return ::std::rc::Rc::new(r#_Wrappers_Compile::Result::>::Failure { - error: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string( - &format!("Surrogate pair missing: 0x{:04x}", s)) - }); - } - ::std::rc::Rc::new(r#_Wrappers_Compile::Result::< - UTF8::ValidUTF8Bytes, - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - >::Success { - value: ::dafny_runtime::Sequence::from_array_owned(_accumulator), - }) - } - pub fn Decode( - b: &::dafny_runtime::Sequence, - ) -> ::std::rc::Rc< - r#_Wrappers_Compile::Result< - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - >, - > { - let b = String::from_utf8(b.to_array().as_ref().clone()); - match b { - Ok(s) => { - ::std::rc::Rc::new(r#_Wrappers_Compile::Result::<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>::Success { - value: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&s) - }) - }, - Err(e) => { - return ::std::rc::Rc::new(r#_Wrappers_Compile::Result::<::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, - ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>>::Failure { - error: ::dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string( - &e.to_string()) - }) - } - } - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/types.rs b/TestModels/Constraints/runtimes/rust/src/types.rs deleted file mode 100644 index 1d954e08e..000000000 --- a/TestModels/Constraints/runtimes/rust/src/types.rs +++ /dev/null @@ -1,16 +0,0 @@ -// 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. -/// Types for the `SimpleConstraintsConfig` -pub mod simple_constraints_config; - -pub mod builders; - - - - - -pub mod error; - - - diff --git a/TestModels/Constraints/runtimes/rust/src/types/builders.rs b/TestModels/Constraints/runtimes/rust/src/types/builders.rs deleted file mode 100644 index 5fbbbaa0f..000000000 --- a/TestModels/Constraints/runtimes/rust/src/types/builders.rs +++ /dev/null @@ -1,3 +0,0 @@ -// 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. diff --git a/TestModels/Constraints/runtimes/rust/src/types/error.rs b/TestModels/Constraints/runtimes/rust/src/types/error.rs deleted file mode 100644 index ddbfc4b42..000000000 --- a/TestModels/Constraints/runtimes/rust/src/types/error.rs +++ /dev/null @@ -1,67 +0,0 @@ -// 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. -#[derive(::std::clone::Clone, ::std::fmt::Debug, ::std::cmp::PartialEq)] -pub enum Error { - SimpleConstraintsException { - message: ::std::string::String, -}, - CollectionOfErrors { - list: ::std::vec::Vec, - message: ::std::string::String, - }, - ValidationError(ValidationError), - Opaque { - obj: ::dafny_runtime::Object, - }, -} - -impl ::std::cmp::Eq for Error {} - -impl ::std::fmt::Display for Error { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - match self { - Self::ValidationError(err) => ::std::fmt::Display::fmt(err, f), - _ => ::std::fmt::Debug::fmt(self, f), - } - } -} - -impl ::std::error::Error for Error { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - Self::ValidationError(err) => Some(err), - _ => None, - } - } -} - -impl Error { - pub fn wrap_validation_err(err: E) -> Self - where - E: ::std::error::Error + 'static, - { - Self::ValidationError(ValidationError(::std::rc::Rc::new(err))) - } -} - -#[derive(::std::clone::Clone, ::std::fmt::Debug)] -pub(crate) struct ValidationError(::std::rc::Rc); - -impl ::std::cmp::PartialEq for ValidationError { - fn eq(&self, other: &Self) -> bool { - ::std::rc::Rc::<(dyn std::error::Error + 'static)>::ptr_eq(&self.0, &other.0) - } -} - -impl ::std::fmt::Display for ValidationError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - ::std::fmt::Display::fmt(&self.0, f) - } -} - -impl ::std::error::Error for ValidationError { - fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { - ::std::option::Option::Some(self.0.as_ref()) - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/types/simple_constraints_config.rs b/TestModels/Constraints/runtimes/rust/src/types/simple_constraints_config.rs deleted file mode 100644 index 84b1e17a4..000000000 --- a/TestModels/Constraints/runtimes/rust/src/types/simple_constraints_config.rs +++ /dev/null @@ -1,41 +0,0 @@ -// 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(missing_docs)] // documentation missing in model -#[non_exhaustive] -#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] -pub struct SimpleConstraintsConfig { - -} -impl SimpleConstraintsConfig { - -} -impl SimpleConstraintsConfig { - /// Creates a new builder-style object to manufacture [`SimpleConstraintsConfig`](crate::types::SimpleConstraintsConfig). - pub fn builder() -> crate::types::simple_constraints_config::SimpleConstraintsConfigBuilder { - crate::types::simple_constraints_config::SimpleConstraintsConfigBuilder::default() - } -} - -/// A builder for [`SimpleConstraintsConfig`](crate::types::SimpleConstraintsConfig). -#[non_exhaustive] -#[derive( - ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug, -)] -pub struct SimpleConstraintsConfigBuilder { - -} -impl SimpleConstraintsConfigBuilder { - - /// Consumes the builder and constructs a [`SimpleConstraintsConfig`](crate::types::SimpleConstraintsConfig). - pub fn build( - self, - ) -> ::std::result::Result< - crate::types::simple_constraints_config::SimpleConstraintsConfig, - ::aws_smithy_types::error::operation::BuildError, - > { - ::std::result::Result::Ok(crate::types::simple_constraints_config::SimpleConstraintsConfig { - - }) - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/wrapped.rs b/TestModels/Constraints/runtimes/rust/src/wrapped.rs deleted file mode 100644 index b8a6bc85e..000000000 --- a/TestModels/Constraints/runtimes/rust/src/wrapped.rs +++ /dev/null @@ -1,15 +0,0 @@ -// 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 client; - -impl crate::r#simple::constraints::internaldafny::wrapped::_default { - pub fn WrappedSimpleConstraints(config: &::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig, - >) -> ::std::rc::Rc, - ::std::rc::Rc - >>{ - crate::wrapped::client::Client::from_conf(config) - } -} diff --git a/TestModels/Constraints/runtimes/rust/src/wrapped/client.rs b/TestModels/Constraints/runtimes/rust/src/wrapped/client.rs deleted file mode 100644 index 72019bbaf..000000000 --- a/TestModels/Constraints/runtimes/rust/src/wrapped/client.rs +++ /dev/null @@ -1,83 +0,0 @@ -// 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. -use std::sync::LazyLock; - -pub struct Client { - wrapped: crate::client::Client -} - -/// A runtime for executing operations on the asynchronous client in a blocking manner. -/// Necessary because Dafny only generates synchronous code. -static dafny_tokio_runtime: LazyLock = LazyLock::new(|| { - tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build() - .unwrap() -}); - -impl dafny_runtime::UpcastObject for Client { - ::dafny_runtime::UpcastObjectFn!(dyn crate::r#simple::constraints::internaldafny::types::ISimpleConstraintsClient); -} - -impl dafny_runtime::UpcastObject for Client { - ::dafny_runtime::UpcastObjectFn!(dyn ::std::any::Any); -} - -impl Client { - pub fn from_conf(config: &::std::rc::Rc< - crate::r#simple::constraints::internaldafny::types::SimpleConstraintsConfig, - >) -> -::std::rc::Rc, - ::std::rc::Rc ->> { - let result = crate::client::Client::from_conf( - crate::conversions::simple_constraints_config::_simple_constraints_config::from_dafny( - config.clone(), - ), - ); - match result { - Ok(client) => { - let wrap = crate::wrapped::client::Client { - wrapped: client - }; - std::rc::Rc::new( - crate::_Wrappers_Compile::Result::Success { - value: ::dafny_runtime::upcast_object()(::dafny_runtime::object::new(wrap)) - } - ) - }, - Err(error) => crate::conversions::error::to_opaque_error_result(error) - } - } -} - -impl crate::r#simple::constraints::internaldafny::types::ISimpleConstraintsClient for Client { - fn GetConstraints( - &mut self, - input: &::std::rc::Rc, - ) -> std::rc::Rc< - crate::r#_Wrappers_Compile::Result< - ::std::rc::Rc, - std::rc::Rc, - >, - >{ - let inner_input = crate::conversions::get_constraints::_get_constraints_input::from_dafny(input.clone()); - let result = tokio::task::block_in_place(|| { - dafny_tokio_runtime.block_on(crate::operation::get_constraints::GetConstraints::send(&self.wrapped, inner_input)) - }); - match result { - Err(error) => ::std::rc::Rc::new( - crate::_Wrappers_Compile::Result::Failure { - error: crate::conversions::error::to_dafny(error), - }, - ), - Ok(inner_result) => ::std::rc::Rc::new( - crate::_Wrappers_Compile::Result::Success { - value: crate::conversions::get_constraints::_get_constraints_output::to_dafny(inner_result), - }, - ), - } - } -} diff --git a/TestModels/Extendable/Makefile b/TestModels/Extendable/Makefile index 203cbe3c4..ae4c1b68c 100644 --- a/TestModels/Extendable/Makefile +++ b/TestModels/Extendable/Makefile @@ -5,6 +5,10 @@ CORES=2 ENABLE_EXTERN_PROCESSING=1 +TRANSPILE_TESTS_IN_RUST=1 + +RUST_OTHER_FILES := runtimes/rust/src/factory.rs + include ../SharedMakefile.mk NAMESPACE=simple.extendable.resources @@ -12,6 +16,8 @@ NAMESPACE=simple.extendable.resources PROJECT_SERVICES := \ SimpleExtendableResources +MAIN_SERVICE_FOR_RUST := SimpleExtendableResources + SERVICE_NAMESPACE_SimpleExtendableResources=simple.extendable.resources SERVICE_DEPS_SimpleExtendableResources := diff --git a/TestModels/Extendable/runtimes/rust/Cargo.toml b/TestModels/Extendable/runtimes/rust/Cargo.toml new file mode 100644 index 000000000..6bfd13b1c --- /dev/null +++ b/TestModels/Extendable/runtimes/rust/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "simple_extendable" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[features] +wrapped-client = [] + +[dependencies] +aws-smithy-runtime = {version = "1.7.1", features=["client"]} +aws-smithy-runtime-api = {version = "1.7.2", features=["client"]} +aws-smithy-types = "1.2.4" +dafny_runtime = { path = "../../../dafny-dependencies/dafny_runtime_rust"} + +[dependencies.tokio] +version = "1.26.0" +features = ["full"] + +[dev-dependencies] +simple_extendable = { path = ".", features = ["wrapped-client"] } + +[lib] +path = "src/implementation_from_dafny.rs" diff --git a/TestModels/Extendable/runtimes/rust/src/factory.rs b/TestModels/Extendable/runtimes/rust/src/factory.rs new file mode 100644 index 000000000..0d20aa7bb --- /dev/null +++ b/TestModels/Extendable/runtimes/rust/src/factory.rs @@ -0,0 +1,75 @@ +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +#![deny(warnings, unconditional_panic)] +#![deny(clippy::all)] + +use crate::_SimpleExtendableResourcesTest_Compile::ExtendableResource; +use crate::r#_Wrappers_Compile::Result; +use crate::simple::extendable::resources::internaldafny::types::Error; +use crate::simple::extendable::resources::internaldafny::types::GetExtendableResourceDataInput; +use crate::simple::extendable::resources::internaldafny::types::GetExtendableResourceDataOutput; +use crate::simple::extendable::resources::internaldafny::types::GetExtendableResourceErrorsInput; +use crate::simple::extendable::resources::internaldafny::types::GetExtendableResourceErrorsOutput; +use crate::simple::extendable::resources::internaldafny::types::IExtendableResource; +use std::rc::Rc; + +pub mod simple { + pub mod extendable { + pub mod resources { + pub mod internaldafny { + pub mod nativeresourcefactory { + pub struct _default {} + } + } + } + } +} + +pub struct NativeResource { + pub inner: Box, +} + +impl dafny_runtime::UpcastObject for NativeResource { + dafny_runtime::UpcastObjectFn!(dyn std::any::Any); +} + +impl IExtendableResource for NativeResource { + fn r#_AlwaysMultipleErrors_k( + &self, + input: &Rc, + ) -> Rc, Rc>> { + self.inner._AlwaysMultipleErrors_k(input) + } + fn r#_GetExtendableResourceData_k( + &self, + input: &Rc, + ) -> Rc, Rc>> { + self.inner._GetExtendableResourceData_k(input) + } + fn r#_AlwaysModeledError_k( + &self, + input: &Rc, + ) -> Rc, Rc>> { + self.inner._AlwaysModeledError_k(input) + } + fn r#_AlwaysOpaqueError_k( + &self, + input: &Rc, + ) -> Rc, Rc>> { + self.inner._AlwaysOpaqueError_k(input) + } +} + +impl crate::simple::extendable::resources::internaldafny::nativeresourcefactory::_default { + pub fn DafnyFactory( + ) -> dafny_runtime::Object { + let nr = NativeResource { + inner: Box::new(ExtendableResource { + __i_name: dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string("dafny-default") + }) + }; + let rcnc = Rc::new(nr); + unsafe { dafny_runtime::Object::from_rc(rcnc) } + } +} diff --git a/TestModels/README.md b/TestModels/README.md index 0bb7e2ab8..247e00532 100644 --- a/TestModels/README.md +++ b/TestModels/README.md @@ -2,7 +2,7 @@ This package contains various groups of models which is used to form a Test Bed for Dafny-Polymorph-Native layer. The idea is that we want an invariant test bed with `Write Once, Test Anywhere` -with the `Anywhere` part targeting different runtimes that dafny supports. +with the `Anywhere` part targeting different runtimes that Dafny supports. This will give us confidence in our test cases across runtimes, without writing native tests (and bugs) for each of those runtimes. @@ -13,7 +13,7 @@ Anything which is to be re-used across all projects will go inside the `TestMode ``` . -├── dafny-dependencies //This has standard dafny libraries used across projects +├── dafny-dependencies //This has standard Dafny libraries used across projects ├── SimpleTypes //This holds project directories for simple types └── README.md //This README.md ``` @@ -24,7 +24,7 @@ Anything which is to be re-used across all projects will go inside the `TestMode 1. `cd ` 1. Create the `README.md`, `Makefile`, and `Model` directory. 1. Write your `*.smithy` model in the `Model` directory. -1. Use your `Makefile` recipe to execute polymorph the generate the appropriate stubbing for the runtime target. +1. Use your `Makefile` recipe to execute polymorph to generate the appropriate stubbing for the runtime target. 1. Implement the `dafny` code, build, execute, and test. ## Makefile targets @@ -37,7 +37,7 @@ All Dafny produced by Dafny-Polymorph MUST be verified. This ensures the health of the Dafny code produced. As well as the Dafny implemented in individual projects. -- `polymorph-dafny` -- run polymorph on the project with the `--output-dafny` to generate the Dafny shell +- `polymorph_dafny` -- run polymorph on the project with the `--output-dafny` to generate the Dafny shell - `verify` -- recursively gather up `*.dfy` in the project, both the generated and implemented code - `dafny-reportgenerator` -- runs the reportgenerator to ensure [verification stability](http://dafny.org/dafny/DafnyRef/DafnyRef#2565-debugging-unstable-verification) diff --git a/codegen/smithy-dafny-codegen-test/src/test/java/software/amazon/polymorph/smithyrust/RustTestModels.java b/codegen/smithy-dafny-codegen-test/src/test/java/software/amazon/polymorph/smithyrust/RustTestModels.java index 682f987ba..87b591473 100644 --- a/codegen/smithy-dafny-codegen-test/src/test/java/software/amazon/polymorph/smithyrust/RustTestModels.java +++ b/codegen/smithy-dafny-codegen-test/src/test/java/software/amazon/polymorph/smithyrust/RustTestModels.java @@ -18,10 +18,8 @@ class RustTestModels extends TestModelTest { static { DISABLED_TESTS.add("AggregateReferences"); DISABLED_TESTS.add("CodegenPatches"); - DISABLED_TESTS.add("Constraints"); DISABLED_TESTS.add("Dependencies"); DISABLED_TESTS.add("Documentation"); - DISABLED_TESTS.add("Extendable"); DISABLED_TESTS.add("Extern"); DISABLED_TESTS.add("SimpleTypes/BigDecimal"); DISABLED_TESTS.add("SimpleTypes/BigInteger"); diff --git a/codegen/smithy-dafny-codegen/src/main/resources/templates/runtimes/rust/types/resource.rs b/codegen/smithy-dafny-codegen/src/main/resources/templates/runtimes/rust/types/resource.rs index 28efa3954..eb16467f1 100644 --- a/codegen/smithy-dafny-codegen/src/main/resources/templates/runtimes/rust/types/resource.rs +++ b/codegen/smithy-dafny-codegen/src/main/resources/templates/runtimes/rust/types/resource.rs @@ -8,6 +8,12 @@ pub struct $rustResourceName:LRef { pub inner: ::std::rc::Rc> } +impl From for $rustResourceName:LRef { + fn from(value: T) -> Self { + Self { inner: std::rc::Rc::new(std::cell::RefCell::new(value)) } + } +} + impl ::std::cmp::PartialEq for $rustResourceName:LRef { fn eq(&self, other: &$rustResourceName:LRef) -> bool { ::std::rc::Rc::ptr_eq(&self.inner, &other.inner) @@ -20,4 +26,4 @@ impl ::std::fmt::Debug for $rustResourceName:LRef { } } -$operationModules:L \ No newline at end of file +$operationModules:L