Client Test

Client Test

rev. e142b602d868dbcdb3ff7160c87686e354cd0986 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_map_of_structs.rs

@@ -1,1 +39,46 @@
   12     12   
    match tokens.next().transpose()? {
   13     13   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14     14   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21     21   
                        let value = crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens, _value)?;
   22         -
                        if let Some(value) = value {
          22  +
                        match value {
          23  +
                            Some(value) => {
   23     24   
                                map.insert(key, value);
   24     25   
                            }
          26  +
                            None => {
          27  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          28  +
                                    "dense map cannot contain null values",
          29  +
                                ))
          30  +
                            }
          31  +
                        }
   25     32   
                    }
   26     33   
                    other => {
   27     34   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     35   
                            "expected object key or end object, found: {other:?}"
   29     36   
                        )))
   30     37   
                    }
   31     38   
                }
   32     39   
            }
   33     40   
            Ok(Some(map))
   34     41   
        }

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_string_list.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21     21   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_string_map.rs

@@ -1,1 +41,48 @@
   14     14   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21     21   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22     22   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23     23   
                            .transpose()?;
   24         -
                        if let Some(value) = value {
          24  +
                        match value {
          25  +
                            Some(value) => {
   25     26   
                                map.insert(key, value);
   26     27   
                            }
          28  +
                            None => {
          29  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          30  +
                                    "dense map cannot contain null values",
          31  +
                                ))
          32  +
                            }
          33  +
                        }
   27     34   
                    }
   28     35   
                    other => {
   29     36   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   30     37   
                            "expected object key or end object, found: {other:?}"
   31     38   
                        )))
   32     39   
                    }
   33     40   
                }
   34     41   
            }
   35     42   
            Ok(Some(map))
   36     43   
        }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_map.rs

@@ -1,1 +42,49 @@
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21     21   
                        let value = ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   22     22   
                            tokens.next(),
   23     23   
                            ::aws_smithy_types::date_time::Format::EpochSeconds,
   24     24   
                        )?;
   25         -
                        if let Some(value) = value {
          25  +
                        match value {
          26  +
                            Some(value) => {
   26     27   
                                map.insert(key, value);
   27     28   
                            }
          29  +
                            None => {
          30  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          31  +
                                    "dense map cannot contain null values",
          32  +
                                ))
          33  +
                            }
          34  +
                        }
   28     35   
                    }
   29     36   
                    other => {
   30     37   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   31     38   
                            "expected object key or end object, found: {other:?}"
   32     39   
                        )))
   33     40   
                    }
   34     41   
                }
   35     42   
            }
   36     43   
            Ok(Some(map))
   37     44   
        }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_string_list.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21     21   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_string_set.rs

@@ -1,1 +35,39 @@
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21     21   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22     22   
                            .transpose()?;
   23     23   
                        if let Some(value) = value {
   24     24   
                            items.push(value);
          25  +
                        } else {
          26  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                                "dense list cannot contain null values",
          28  +
                            ));
   25     29   
                        }
   26     30   
                    }
   27     31   
                }
   28     32   
            }
   29     33   
            Ok(Some(items))
   30     34   
        }
   31     35   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     36   
            "expected start array or null",
   33     37   
        )),
   34     38   
    }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_a.rs

@@ -1,1 +36,40 @@
   16     16   
            loop {
   17     17   
                match tokens.peek() {
   18     18   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19     19   
                        tokens.next().transpose().unwrap();
   20     20   
                        break;
   21     21   
                    }
   22     22   
                    _ => {
   23     23   
                        let value = crate::protocol_serde::shape_list_b::de_list_b(tokens, _value)?;
   24     24   
                        if let Some(value) = value {
   25     25   
                            items.push(value);
          26  +
                        } else {
          27  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          28  +
                                "dense list cannot contain null values",
          29  +
                            ));
   26     30   
                        }
   27     31   
                    }
   28     32   
                }
   29     33   
            }
   30     34   
            Ok(Some(items))
   31     35   
        }
   32     36   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     37   
            "expected start array or null",
   34     38   
        )),
   35     39   
    }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_b.rs

@@ -1,1 +36,40 @@
   16     16   
            loop {
   17     17   
                match tokens.peek() {
   18     18   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19     19   
                        tokens.next().transpose().unwrap();
   20     20   
                        break;
   21     21   
                    }
   22     22   
                    _ => {
   23     23   
                        let value = crate::protocol_serde::shape_list_c::de_list_c(tokens, _value)?;
   24     24   
                        if let Some(value) = value {
   25     25   
                            items.push(value);
          26  +
                        } else {
          27  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          28  +
                                "dense list cannot contain null values",
          29  +
                            ));
   26     30   
                        }
   27     31   
                    }
   28     32   
                }
   29     33   
            }
   30     34   
            Ok(Some(items))
   31     35   
        }
   32     36   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     37   
            "expected start array or null",
   34     38   
        )),
   35     39   
    }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_c.rs

@@ -1,1 +36,40 @@
   16     16   
            loop {
   17     17   
                match tokens.peek() {
   18     18   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19     19   
                        tokens.next().transpose().unwrap();
   20     20   
                        break;
   21     21   
                    }
   22     22   
                    _ => {
   23     23   
                        let value = crate::protocol_serde::shape_map_a::de_map_a(tokens, _value)?;
   24     24   
                        if let Some(value) = value {
   25     25   
                            items.push(value);
          26  +
                        } else {
          27  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          28  +
                                "dense list cannot contain null values",
          29  +
                            ));
   26     30   
                        }
   27     31   
                    }
   28     32   
                }
   29     33   
            }
   30     34   
            Ok(Some(items))
   31     35   
        }
   32     36   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     37   
            "expected start array or null",
   34     38   
        )),
   35     39   
    }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_map_a.rs

@@ -1,1 +39,46 @@
   12     12   
    match tokens.next().transpose()? {
   13     13   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14     14   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15     15   
            let mut map = ::std::collections::HashMap::new();
   16     16   
            loop {
   17     17   
                match tokens.next().transpose()? {
   18     18   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19     19   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20     20   
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21     21   
                        let value = crate::protocol_serde::shape_empty_structure::de_empty_structure(tokens, _value)?;
   22         -
                        if let Some(value) = value {
          22  +
                        match value {
          23  +
                            Some(value) => {
   23     24   
                                map.insert(key, value);
   24     25   
                            }
          26  +
                            None => {
          27  +
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          28  +
                                    "dense map cannot contain null values",
          29  +
                                ))
          30  +
                            }
          31  +
                        }
   25     32   
                    }
   26     33   
                    other => {
   27     34   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     35   
                            "expected object key or end object, found: {other:?}"
   29     36   
                        )))
   30     37   
                    }
   31     38   
                }
   32     39   
            }
   33     40   
            Ok(Some(map))
   34     41   
        }

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception_field_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/protocol_serde/shape_validation_exception_field_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_option_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_result::de_result(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_result_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_result::de_result(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/protocol_serde/shape_validation_exception_field_list.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_flavor_text_entries.rs

@@ -1,1 +33,37 @@
   13     13   
            loop {
   14     14   
                match tokens.peek() {
   15     15   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16     16   
                        tokens.next().transpose().unwrap();
   17     17   
                        break;
   18     18   
                    }
   19     19   
                    _ => {
   20     20   
                        let value = crate::protocol_serde::shape_flavor_text::de_flavor_text(tokens, _value)?;
   21     21   
                        if let Some(value) = value {
   22     22   
                            items.push(value);
          23  +
                        } else {
          24  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          25  +
                                "dense list cannot contain null values",
          26  +
                            ));
   23     27   
                        }
   24     28   
                    }
   25     29   
                }
   26     30   
            }
   27     31   
            Ok(Some(items))
   28     32   
        }
   29     33   
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30     34   
            "expected start array or null",
   31     35   
        )),
   32     36   
    }