Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename SimpleString's SingleValue to KnownValue for consistency #361

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace simple.types.smithyString
service SimpleTypesString {
version: "2021-11-01",
resources: [],
operations: [ GetString, GetStringSingleValue, GetStringUTF8 ],
operations: [ GetString, GetStringKnownValue, GetStringUTF8 ],
errors: [],
}

Expand All @@ -20,7 +20,7 @@ operation GetString {
output: GetStringOutput,
}

operation GetStringSingleValue {
operation GetStringKnownValue {
input: GetStringInput,
output: GetStringOutput,
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub mod r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes {
::std::rc::Rc<super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error>,
>,
>;
fn GetStringSingleValue(
fn GetStringKnownValue(
self: &Self,
input: &::std::rc::Rc<
super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput,
Expand Down Expand Up @@ -353,7 +353,7 @@ mod r#_SimpleStringImpl_Compile {
return output.read();
return output.read();
}
pub fn GetStringSingleValue(
pub fn GetStringKnownValue(
config: &::std::rc::Rc<super::r#_SimpleStringImpl_Compile::Config>,
input: &::std::rc::Rc<
super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput,
Expand All @@ -374,7 +374,7 @@ mod r#_SimpleStringImpl_Compile {
panic!("Halt")
};
if !(input.value().value().clone()
== ::dafny_runtime::string_utf16_of("TEST_SIMPLE_STRING_SINGLE_VALUE"))
== ::dafny_runtime::string_utf16_of("TEST_SIMPLE_STRING_KNOWN_VALUE"))
{
panic!("Halt")
};
Expand Down Expand Up @@ -538,7 +538,7 @@ pub mod r#_simple_dtypes_dsmithystring_dinternaldafny {
> {
super::r#_SimpleStringImpl_Compile::_default::GetString(&self.config(), input)
}
fn GetStringSingleValue(
fn GetStringKnownValue(
self: &Self,
input: &::std::rc::Rc<
super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput,
Expand All @@ -551,10 +551,7 @@ pub mod r#_simple_dtypes_dsmithystring_dinternaldafny {
::std::rc::Rc<super::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error>,
>,
> {
super::r#_SimpleStringImpl_Compile::_default::GetStringSingleValue(
&self.config(),
input,
)
super::r#_SimpleStringImpl_Compile::_default::GetStringKnownValue(&self.config(), input)
}
fn GetStringUTF8(
self: &Self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ impl Drop for Handle {

mod get_string;

mod get_string_single_value;
mod get_string_known_value;

mod get_string_utf8;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`GetStringKnownValue`](crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`value(impl Into<Option<String>>)`](crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder::set_name):(undocumented)<br>
/// - On success, responds with [`GetStringKnownValueOutput`](crate::operation::get_string_known_value::GetStringKnownValueOutput) with field(s):
/// - [`value(Option<String>)`](crate::operation::get_string_known_value::GetStringKnownValueOutput::value): (undocumented)
/// - On failure, responds with [`SdkError<GetStringKnownValueError>`](crate::operation::get_string_known_value::GetStringKnownValueError)
pub fn get_string_known_value(
&self,
) -> crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder {
crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder::new(
self.handle.clone(),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`GetStringSingleValue`](crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder) operation.
/// Constructs a fluent builder for the [`GetStringKnownValue`](crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`value(impl Into<Option<String>>)`](crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder::set_name):(undocumented)<br>
/// - On success, responds with [`GetStringSingleValueOutput`](crate::operation::get_string_single_value::GetStringSingleValueOutput) with field(s):
/// - [`value(Option<String>)`](crate::operation::get_string_single_value::GetStringSingleValueOutput::value): (undocumented)
/// - On failure, responds with [`SdkError<GetStringSingleValueError>`](crate::operation::get_string_single_value::GetStringSingleValueError)
pub fn get_string_single_value(
/// - [`value(impl Into<Option<String>>)`](crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder::set_name):(undocumented)<br>
/// - On success, responds with [`GetStringKnownValueOutput`](crate::operation::get_string_known_value::GetStringKnownValueOutput) with field(s):
/// - [`value(Option<String>)`](crate::operation::get_string_known_value::GetStringKnownValueOutput::value): (undocumented)
/// - On failure, responds with [`SdkError<GetStringKnownValueError>`](crate::operation::get_string_known_value::GetStringKnownValueError)
pub fn get_string_known_value(
&self,
) -> crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder
{
crate::operation::get_string_single_value::builders::GetStringSingleValueFluentBuilder::new(
) -> crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder {
crate::operation::get_string_known_value::builders::GetStringKnownValueFluentBuilder::new(
self.handle.clone(),
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub mod get_string;

pub mod get_string_single_value;
pub mod get_string_known_value;

pub mod get_string_utf8;
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use std::any::Any;

#[allow(dead_code)]
pub fn to_dafny_error(
value: crate::operation::get_string_single_value::GetStringSingleValueError,
value: crate::operation::get_string_known_value::GetStringKnownValueError,
) -> ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error>
{
match value {
crate::operation::get_string_single_value::GetStringSingleValueError::Unhandled(unhandled) =>
crate::operation::get_string_known_value::GetStringKnownValueError::Unhandled(unhandled) =>
::std::rc::Rc::new(::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::Opaque { obj: Box::into_raw(Box::new(unhandled) as Box<dyn Any>) })
}
}
Expand All @@ -18,16 +18,16 @@ pub fn from_dafny_error(
dafny_value: ::std::rc::Rc<
::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error,
>,
) -> crate::operation::get_string_single_value::GetStringSingleValueError {
) -> crate::operation::get_string_known_value::GetStringKnownValueError {
// TODO: Losing information here, but we have to figure out how to wrap an arbitrary Dafny value as std::error::Error
if matches!(&dafny_value.as_ref(), ::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::Error::CollectionOfErrors { .. }) {
let error_message = "TODO: can't get message yet";
crate::operation::get_string_single_value::GetStringSingleValueError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message(error_message).build())
crate::operation::get_string_known_value::GetStringKnownValueError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message(error_message).build())
} else {
crate::operation::get_string_single_value::GetStringSingleValueError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message("Opaque error").build())
crate::operation::get_string_known_value::GetStringKnownValueError::generic(::aws_smithy_types::error::metadata::ErrorMetadata::builder().message("Opaque error").build())
}
}

pub mod _get_string_single_value_input;
pub mod _get_string_known_value_input;

pub mod _get_string_single_value_output;
pub mod _get_string_known_value_output;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(dead_code)]
pub fn to_dafny(
value: crate::operation::get_string_single_value::GetStringSingleValueInput,
value: crate::operation::get_string_known_value::GetStringKnownValueInput,
) -> ::std::rc::Rc<
::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput,
> {
Expand All @@ -21,7 +21,7 @@ pub fn from_dafny(
dafny_value: ::std::rc::Rc<
::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringInput,
>,
) -> crate::operation::get_string_single_value::GetStringSingleValueInput {
) -> crate::operation::get_string_known_value::GetStringKnownValueInput {
let value = if matches!(
dafny_value.value().as_ref(),
::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }
Expand All @@ -39,5 +39,5 @@ pub fn from_dafny(
} else {
panic!("Unreachable")
};
crate::operation::get_string_single_value::GetStringSingleValueInput { value }
crate::operation::get_string_known_value::GetStringKnownValueInput { value }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(dead_code)]
pub fn to_dafny(
value: crate::operation::get_string_single_value::GetStringSingleValueOutput,
value: crate::operation::get_string_known_value::GetStringKnownValueOutput,
) -> ::std::rc::Rc<
::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput,
> {
Expand All @@ -19,7 +19,7 @@ pub fn to_dafny(
#[allow(dead_code)]
pub fn from_dafny(
dafny_value: ::std::rc::Rc<::simple_string_dafny::r#_simple_dtypes_dsmithystring_dinternaldafny_dtypes::GetStringOutput>,
) -> crate::operation::get_string_single_value::GetStringSingleValueOutput {
) -> crate::operation::get_string_known_value::GetStringKnownValueOutput {
let value = if matches!(
dafny_value.value().as_ref(),
::simple_string_dafny::_Wrappers_Compile::Option::Some { .. }
Expand All @@ -37,5 +37,5 @@ pub fn from_dafny(
} else {
panic!("Unreachable")
};
crate::operation::get_string_single_value::GetStringSingleValueOutput { value }
crate::operation::get_string_known_value::GetStringKnownValueOutput { value }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/// Types for the `GetString` operation.
pub mod get_string;

/// Types for the `GetStringSingleValue` operation.
pub mod get_string_single_value;
/// Types for the `GetStringKnownValue` operation.
pub mod get_string_known_value;

/// Types for the `GetStringUTF8` operation.
pub mod get_string_utf8;
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Orchestration and serialization glue logic for `GetStringSingleValue`.
/// Orchestration and serialization glue logic for `GetStringKnownValue`.
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetStringSingleValue;
impl GetStringSingleValue {
/// Creates a new `GetStringSingleValue`
pub struct GetStringKnownValue;
impl GetStringKnownValue {
/// Creates a new `GetStringKnownValue`
pub fn new() -> Self {
Self
}
pub(crate) async fn send(
handle: &crate::client::Handle,
input: crate::operation::get_string_single_value::GetStringSingleValueInput,
input: crate::operation::get_string_known_value::GetStringKnownValueInput,
) -> ::std::result::Result<
crate::operation::get_string_single_value::GetStringSingleValueOutput,
crate::operation::get_string_single_value::GetStringSingleValueError,
crate::operation::get_string_known_value::GetStringKnownValueOutput,
crate::operation::get_string_known_value::GetStringKnownValueError,
> {
let inner_input =
crate::conversions::get_string_single_value::_get_string_single_value_input::to_dafny(
crate::conversions::get_string_known_value::_get_string_known_value_input::to_dafny(
input,
);
let inner_result =
Expand All @@ -25,34 +25,34 @@ impl GetStringSingleValue {
inner_result.as_ref(),
::simple_string_dafny::r#_Wrappers_Compile::Result::Success { .. }
) {
Ok(crate::conversions::get_string_single_value::_get_string_single_value_output::from_dafny(inner_result.value().clone()))
Ok(crate::conversions::get_string_known_value::_get_string_known_value_output::from_dafny(inner_result.value().clone()))
} else {
Err(
crate::conversions::get_string_single_value::from_dafny_error(
crate::conversions::get_string_known_value::from_dafny_error(
inner_result.error().clone(),
),
)
}
}
}

/// Error type for the `GetStringSingleValue` operation.
/// Error type for the `GetStringKnownValue` operation.
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum GetStringSingleValueError {
pub enum GetStringKnownValueError {
/// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
#[deprecated(
note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
variable wildcard pattern and check `.code()`:
\
&nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
\
See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetStringSingleValueError) for what information is available for the error."
See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetStringKnownValueError) for what information is available for the error."
)]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl GetStringSingleValueError {
/// Creates the `GetStringSingleValueError::Unhandled` variant from any error type.
impl GetStringKnownValueError {
/// Creates the `GetStringKnownValueError::Unhandled` variant from any error type.
pub fn unhandled(
err: impl ::std::convert::Into<
::std::boxed::Box<
Expand All @@ -66,7 +66,7 @@ impl GetStringSingleValueError {
})
}

/// Creates the `GetStringSingleValueError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
/// Creates the `GetStringKnownValueError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.clone().into(),
Expand All @@ -83,14 +83,14 @@ impl GetStringSingleValueError {
}
}
}
impl ::std::error::Error for GetStringSingleValueError {
impl ::std::error::Error for GetStringKnownValueError {
fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
}
}
}
impl ::std::fmt::Display for GetStringSingleValueError {
impl ::std::fmt::Display for GetStringKnownValueError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::Unhandled(_inner) => {
Expand All @@ -105,22 +105,22 @@ impl ::std::fmt::Display for GetStringSingleValueError {
}
}
}
impl ::aws_smithy_types::retry::ProvideErrorKind for GetStringSingleValueError {
impl ::aws_smithy_types::retry::ProvideErrorKind for GetStringKnownValueError {
fn code(&self) -> ::std::option::Option<&str> {
::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
}
fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
::std::option::Option::None
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetStringSingleValueError {
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetStringKnownValueError {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::Unhandled(_inner) => &_inner.meta,
}
}
}
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetStringSingleValueError {
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetStringKnownValueError {
fn create_unhandled_error(
source: ::std::boxed::Box<
dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static,
Expand All @@ -134,13 +134,13 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetStrin
}
}

pub use crate::operation::get_string_single_value::_get_string_single_value_output::GetStringSingleValueOutput;
pub use crate::operation::get_string_known_value::_get_string_known_value_output::GetStringKnownValueOutput;

pub use crate::operation::get_string_single_value::_get_string_single_value_input::GetStringSingleValueInput;
pub use crate::operation::get_string_known_value::_get_string_known_value_input::GetStringKnownValueInput;

mod _get_string_single_value_input;
mod _get_string_known_value_input;

mod _get_string_single_value_output;
mod _get_string_known_value_output;

/// Builders
pub mod builders;
Loading
Loading