Server Test Python

Server Test Python

rev. a7fb2e3446d314cfbe48069306e4e0a389b39aeb (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/python/constraints/output/__init__.pyi

@@ -1,0 +231,0 @@
    1         -
import constraints.model
    2         -
import constraints.types
    3         -
import typing
    4         -
    5         -
class ConstrainedHttpBoundShapesOperationOutput:
    6         -
    enum_string_label: constraints.model.EnumString
    7         -
    8         -
    enum_string_list_query: typing.Optional[typing.List[constraints.model.EnumString]]
    9         -
   10         -
    enum_string_query: typing.Optional[constraints.model.EnumString]
   11         -
   12         -
    length_list_pattern_string_header: typing.Optional[typing.List[str]]
   13         -
   14         -
    length_list_pattern_string_query: typing.Optional[typing.List[str]]
   15         -
   16         -
    length_set_pattern_string_header: typing.Optional[typing.Set[str]]
   17         -
   18         -
    length_string_header: typing.Optional[str]
   19         -
   20         -
    length_string_header_map: typing.Dict[str, str]
   21         -
   22         -
    length_string_label: str
   23         -
   24         -
    length_string_list_query: typing.Optional[typing.List[str]]
   25         -
   26         -
    length_string_query: typing.Optional[str]
   27         -
   28         -
    length_string_set_header: typing.Optional[typing.Set[str]]
   29         -
   30         -
    length_string_set_query: typing.Optional[typing.Set[str]]
   31         -
   32         -
    list_length_string_header: typing.Optional[typing.List[str]]
   33         -
   34         -
    range_byte_header: int
   35         -
   36         -
    range_byte_label: int
   37         -
   38         -
    range_byte_list_header: typing.Optional[typing.List[int]]
   39         -
   40         -
    range_byte_list_query: typing.Optional[typing.List[int]]
   41         -
   42         -
    range_byte_query: int
   43         -
   44         -
    range_byte_set_header: typing.Optional[typing.List[int]]
   45         -
   46         -
    range_byte_set_query: typing.Optional[typing.List[int]]
   47         -
   48         -
    range_integer_header: int
   49         -
   50         -
    range_integer_label: int
   51         -
   52         -
    range_integer_list_header: typing.Optional[typing.List[int]]
   53         -
   54         -
    range_integer_list_query: typing.Optional[typing.List[int]]
   55         -
   56         -
    range_integer_query: int
   57         -
   58         -
    range_integer_set_header: typing.Optional[typing.List[int]]
   59         -
   60         -
    range_integer_set_query: typing.Optional[typing.List[int]]
   61         -
   62         -
    range_long_header: int
   63         -
   64         -
    range_long_label: int
   65         -
   66         -
    range_long_list_header: typing.Optional[typing.List[int]]
   67         -
   68         -
    range_long_list_query: typing.Optional[typing.List[int]]
   69         -
   70         -
    range_long_query: int
   71         -
   72         -
    range_long_set_header: typing.Optional[typing.List[int]]
   73         -
   74         -
    range_long_set_query: typing.Optional[typing.List[int]]
   75         -
   76         -
    range_short_header: int
   77         -
   78         -
    range_short_label: int
   79         -
   80         -
    range_short_list_header: typing.Optional[typing.List[int]]
   81         -
   82         -
    range_short_list_query: typing.Optional[typing.List[int]]
   83         -
   84         -
    range_short_query: int
   85         -
   86         -
    range_short_set_header: typing.Optional[typing.List[int]]
   87         -
   88         -
    range_short_set_query: typing.Optional[typing.List[int]]
   89         -
   90         -
    def __init__(self, length_string_label: str, range_integer_label: int, range_short_label: int, range_long_label: int, range_byte_label: int, enum_string_label: constraints.model.EnumString, length_string_header_map: typing.Dict[str, str], length_string_header: typing.Optional[str] = ..., range_integer_header: int, range_short_header: int, range_long_header: int, range_byte_header: int, length_string_set_header: typing.Optional[typing.Set[str]] = ..., list_length_string_header: typing.Optional[typing.List[str]] = ..., length_list_pattern_string_header: typing.Optional[typing.List[str]] = ..., length_set_pattern_string_header: typing.Optional[typing.Set[str]] = ..., range_byte_set_header: typing.Optional[typing.List[int]] = ..., range_short_set_header: typing.Optional[typing.List[int]] = ..., range_integer_set_header: typing.Optional[typing.List[int]] = ..., range_long_set_header: typing.Optional[typing.List[int]] = ..., range_byte_list_header: typing.Optional[typing.List[int]] = ..., range_short_list_header: typing.Optional[typing.List[int]] = ..., range_integer_list_header: typing.Optional[typing.List[int]] = ..., range_long_list_header: typing.Optional[typing.List[int]] = ..., length_string_query: typing.Optional[str] = ..., range_byte_query: int, range_short_query: int, range_integer_query: int, range_long_query: int, enum_string_query: typing.Optional[constraints.model.EnumString] = ..., length_string_list_query: typing.Optional[typing.List[str]] = ..., length_list_pattern_string_query: typing.Optional[typing.List[str]] = ..., length_string_set_query: typing.Optional[typing.Set[str]] = ..., range_byte_list_query: typing.Optional[typing.List[int]] = ..., range_short_list_query: typing.Optional[typing.List[int]] = ..., range_integer_list_query: typing.Optional[typing.List[int]] = ..., range_long_list_query: typing.Optional[typing.List[int]] = ..., range_byte_set_query: typing.Optional[typing.List[int]] = ..., range_short_set_query: typing.Optional[typing.List[int]] = ..., range_integer_set_query: typing.Optional[typing.List[int]] = ..., range_long_set_query: typing.Optional[typing.List[int]] = ..., enum_string_list_query: typing.Optional[typing.List[constraints.model.EnumString]] = ...) -> None:
   91         -
        ...
   92         -
   93         -
   94         -
class ConstrainedHttpPayloadBoundShapeOperationOutput:
   95         -
    http_payload_bound_constrained_shape: constraints.model.ConA
   96         -
   97         -
    def __init__(self, http_payload_bound_constrained_shape: constraints.model.ConA) -> None:
   98         -
        ...
   99         -
  100         -
  101         -
class ConstrainedRecursiveShapesOperationOutput:
  102         -
    nested: typing.Optional[constraints.model.RecursiveShapesInputOutputNested1]
  103         -
  104         -
    recursive_list: typing.List[constraints.model.RecursiveShapesInputOutputNested1]
  105         -
  106         -
    def __init__(self, nested: typing.Optional[constraints.model.RecursiveShapesInputOutputNested1] = ..., recursive_list: typing.List[constraints.model.RecursiveShapesInputOutputNested1]) -> None:
  107         -
        ...
  108         -
  109         -
  110         -
class ConstrainedShapesOnlyInOutputOperationOutput:
  111         -
    list: typing.Optional[typing.List[constraints.model.ConstrainedUnionInOutput]]
  112         -
  113         -
    map: typing.Optional[typing.Dict[str, constraints.model.TransitivelyConstrainedStructureInOutput]]
  114         -
  115         -
    union: typing.Optional[constraints.model.ConstrainedUnionInOutput]
  116         -
  117         -
    def __init__(self, list: typing.Optional[typing.List[constraints.model.ConstrainedUnionInOutput]] = ..., map: typing.Optional[typing.Dict[str, constraints.model.TransitivelyConstrainedStructureInOutput]] = ..., union: typing.Optional[constraints.model.ConstrainedUnionInOutput] = ...) -> None:
  118         -
        ...
  119         -
  120         -
  121         -
class ConstrainedShapesOperationOutput:
  122         -
    con_a: constraints.model.ConA
  123         -
  124         -
    def __init__(self, con_a: constraints.model.ConA) -> None:
  125         -
        ...
  126         -
  127         -
  128         -
class EventStreamsOperationOutput:
  129         -
    events: typing.AsyncIterator[constraints.model.Event]
  130         -
  131         -
    def __init__(self, events: typing.AsyncIterator[constraints.model.Event]) -> None:
  132         -
        ...
  133         -
  134         -
  135         -
class HttpPrefixHeadersTargetingLengthMapOperationOutput:
  136         -
    length_map: typing.Optional[typing.Dict[str, str]]
  137         -
  138         -
    def __init__(self, length_map: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  139         -
        ...
  140         -
  141         -
  142         -
class NonStreamingBlobOperationOutput:
  143         -
    non_streaming_blob: typing.Optional[constraints.types.Blob]
  144         -
  145         -
    def __init__(self, non_streaming_blob: typing.Optional[constraints.types.Blob] = ...) -> None:
  146         -
        ...
  147         -
  148         -
  149         -
class QueryParamsTargetingLengthMapOperationOutput:
  150         -
    length_map: typing.Optional[typing.Dict[str, str]]
  151         -
  152         -
    def __init__(self, length_map: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  153         -
        ...
  154         -
  155         -
  156         -
class QueryParamsTargetingMapOfEnumStringOperationOutput:
  157         -
    map_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, constraints.model.EnumString]]
  158         -
  159         -
    def __init__(self, map_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, constraints.model.EnumString]] = ...) -> None:
  160         -
        ...
  161         -
  162         -
  163         -
class QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput:
  164         -
    map_of_length_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  165         -
  166         -
    def __init__(self, map_of_length_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  167         -
        ...
  168         -
  169         -
  170         -
class QueryParamsTargetingMapOfLengthPatternStringOperationOutput:
  171         -
    map_of_length_pattern_string: typing.Optional[typing.Dict[str, str]]
  172         -
  173         -
    def __init__(self, map_of_length_pattern_string: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  174         -
        ...
  175         -
  176         -
  177         -
class QueryParamsTargetingMapOfLengthStringOperationOutput:
  178         -
    map_of_length_string: typing.Optional[typing.Dict[str, str]]
  179         -
  180         -
    def __init__(self, map_of_length_string: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  181         -
        ...
  182         -
  183         -
  184         -
class QueryParamsTargetingMapOfListOfEnumStringOperationOutput:
  185         -
    map_of_list_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, typing.List[constraints.model.EnumString]]]
  186         -
  187         -
    def __init__(self, map_of_list_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, typing.List[constraints.model.EnumString]]] = ...) -> None:
  188         -
        ...
  189         -
  190         -
  191         -
class QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput:
  192         -
    map_of_length_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  193         -
  194         -
    def __init__(self, map_of_length_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  195         -
        ...
  196         -
  197         -
  198         -
class QueryParamsTargetingMapOfListOfLengthStringOperationOutput:
  199         -
    map_of_list_of_length_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  200         -
  201         -
    def __init__(self, map_of_list_of_length_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  202         -
        ...
  203         -
  204         -
  205         -
class QueryParamsTargetingMapOfListOfPatternStringOperationOutput:
  206         -
    map_of_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  207         -
  208         -
    def __init__(self, map_of_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  209         -
        ...
  210         -
  211         -
  212         -
class QueryParamsTargetingMapOfPatternStringOperationOutput:
  213         -
    map_of_pattern_string: typing.Optional[typing.Dict[str, str]]
  214         -
  215         -
    def __init__(self, map_of_pattern_string: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  216         -
        ...
  217         -
  218         -
  219         -
class QueryParamsTargetingMapOfSetOfLengthStringOperationOutput:
  220         -
    map_of_set_of_length_string: typing.Optional[typing.Dict[str, typing.Set[str]]]
  221         -
  222         -
    def __init__(self, map_of_set_of_length_string: typing.Optional[typing.Dict[str, typing.Set[str]]] = ...) -> None:
  223         -
        ...
  224         -
  225         -
  226         -
class StreamingBlobOperationOutput:
  227         -
    streaming_blob: constraints.types.ByteStream
  228         -
  229         -
    def __init__(self, streaming_blob: constraints.types.ByteStream) -> None:
  230         -
        ...
  231         -

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/python/constraints/socket/__init__.pyi

@@ -1,0 +27,0 @@
    1         -
import typing
    2         -
    3         -
class PySocket:
    4         -
    """
    5         -
    Socket implementation that can be shared between multiple Python processes.
    6         -
    7         -
    Python cannot handle true multi-threaded applications due to the [GIL],
    8         -
    often resulting in reduced performance and only one core used by the application.
    9         -
    To work around this, Python web applications usually create a socket with
   10         -
    SO_REUSEADDR and SO_REUSEPORT enabled that can be shared between multiple
   11         -
    Python processes, allowing you to maximize performance and use all available
   12         -
    computing capacity of the host.
   13         -
   14         -
    [GIL]: https://wiki.python.org/moin/GlobalInterpreterLock
   15         -
    """
   16         -
   17         -
    def try_clone(self) -> PySocket:
   18         -
        """
   19         -
        Clone the inner socket allowing it to be shared between multiple
   20         -
        Python processes.
   21         -
        """
   22         -
        ...
   23         -
   24         -
   25         -
    def __init__(self, address: str, port: int, backlog: typing.Optional[int] = ...) -> None:
   26         -
        ...
   27         -

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/python/constraints/tls/__init__.pyi

@@ -1,0 +10,0 @@
    1         -
import pathlib
    2         -
    3         -
class TlsConfig:
    4         -
    """
    5         -
    PyTlsConfig represents TLS configuration created from Python.
    6         -
    """
    7         -
    8         -
    def __init__(self, key_path: pathlib.Path, cert_path: pathlib.Path, reload_secs: int = ...) -> None:
    9         -
        ...
   10         -

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/python/constraints/types/__init__.pyi

@@ -1,0 +209,0 @@
    1         -
import typing
    2         -
    3         -
class Blob:
    4         -
    """
    5         -
    Python Wrapper for [aws_smithy_types::Blob].
    6         -
    """
    7         -
    8         -
    data: bytes
    9         -
    """
   10         -
    Python getter for the `Blob` byte array.
   11         -
    """
   12         -
   13         -
    def __init__(self, input: bytes) -> None:
   14         -
        ...
   15         -
   16         -
   17         -
class ByteStream:
   18         -
    """
   19         -
    Python Wrapper for [aws_smithy_types::byte_stream::ByteStream].
   20         -
   21         -
    ByteStream provides misuse-resistant primitives to make it easier to handle common patterns with streaming data.
   22         -
   23         -
    On the Rust side, The Python implementation wraps the original [ByteStream](aws_smithy_types::byte_stream::ByteStream)
   24         -
    in a clonable structure and implements the [Stream](futures::stream::Stream) trait for it to
   25         -
    allow Rust to handle the type transparently.
   26         -
   27         -
    On the Python side both sync and async iterators are exposed by implementing `__iter__()` and `__aiter__()` magic methods,
   28         -
    which allows to just loop over the stream chunks.
   29         -
   30         -
    ### Example of async streaming:
   31         -
   32         -
    ```python
   33         -
        stream = await ByteStream.from_path("/tmp/music.mp3")
   34         -
        async for chunk in stream:
   35         -
            print(chunk)
   36         -
    ```
   37         -
   38         -
    ### Example of sync streaming:
   39         -
   40         -
    ```python
   41         -
        stream = ByteStream.from_stream_blocking("/tmp/music.mp3")
   42         -
        for chunk in stream:
   43         -
            print(chunk)
   44         -
    ```
   45         -
   46         -
    The main difference between the two implementations is that the async one is scheduling the Python coroutines as Rust futures,
   47         -
    effectively maintaining the asyncronous behavior that Rust exposes, while the sync one is blocking the Tokio runtime to be able
   48         -
    to await one chunk at a time.
   49         -
   50         -
    The original Rust [ByteStream](aws_smithy_types::byte_stream::ByteStream) is wrapped inside a `Arc<Mutex>` to allow the type to be
   51         -
    [Clone] (required by PyO3) and to allow internal mutability, required to fetch the next chunk of data.
   52         -
    """
   53         -
   54         -
    @staticmethod
   55         -
    def from_path(path: str) -> typing.Awaitable[ByteStream]:
   56         -
        """
   57         -
        Create a new [ByteStream](aws_smithy_types::byte_stream::ByteStream) from a path, forcing
   58         -
        Python to await this coroutine.
   59         -
        """
   60         -
        ...
   61         -
   62         -
   63         -
    @staticmethod
   64         -
    def from_path_blocking(path: str) -> ByteStream:
   65         -
        """
   66         -
        Create a new [ByteStream](aws_smithy_types::byte_stream::ByteStream) from a path, without
   67         -
        requiring Python to await this method.
   68         -
   69         -
        **NOTE:** This method will block the Rust event loop when it is running.
   70         -
        """
   71         -
        ...
   72         -
   73         -
   74         -
    def __init__(self, input: bytes) -> None:
   75         -
        ...
   76         -
   77         -
   78         -
class DateTime:
   79         -
    """
   80         -
    Python Wrapper for [aws_smithy_types::date_time::DateTime].
   81         -
    """
   82         -
   83         -
    def as_nanos(self) -> int:
   84         -
        """
   85         -
        Returns the number of nanoseconds since the Unix epoch that this `DateTime` represents.
   86         -
        """
   87         -
        ...
   88         -
   89         -
   90         -
    def as_secs_f64(self) -> float:
   91         -
        """
   92         -
        Returns the `DateTime` value as an `f64` representing the seconds since the Unix epoch.
   93         -
        """
   94         -
        ...
   95         -
   96         -
   97         -
    @staticmethod
   98         -
    def from_fractional_secs(epoch_seconds: int, fraction: float) -> DateTime:
   99         -
        """
  100         -
        Creates a `DateTime` from a number of seconds and a fractional second since the Unix epoch.
  101         -
        """
  102         -
        ...
  103         -
  104         -
  105         -
    @staticmethod
  106         -
    def from_millis(epoch_millis: int) -> DateTime:
  107         -
        """
  108         -
        Creates a `DateTime` from a number of milliseconds since the Unix epoch.
  109         -
        """
  110         -
        ...
  111         -
  112         -
  113         -
    @staticmethod
  114         -
    def from_nanos(epoch_nanos: int) -> DateTime:
  115         -
        """
  116         -
        Creates a `DateTime` from a number of nanoseconds since the Unix epoch.
  117         -
        """
  118         -
        ...
  119         -
  120         -
  121         -
    @staticmethod
  122         -
    def from_secs(epoch_seconds: int) -> DateTime:
  123         -
        """
  124         -
        Creates a `DateTime` from a number of seconds since the Unix epoch.
  125         -
        """
  126         -
        ...
  127         -
  128         -
  129         -
    @staticmethod
  130         -
    def from_secs_and_nanos(seconds: int, subsecond_nanos: int) -> DateTime:
  131         -
        """
  132         -
        Creates a `DateTime` from a number of seconds and sub-second nanos since the Unix epoch.
  133         -
        """
  134         -
        ...
  135         -
  136         -
  137         -
    @staticmethod
  138         -
    def from_secs_f64(epoch_seconds: float) -> DateTime:
  139         -
        """
  140         -
        Creates a `DateTime` from an `f64` representing the number of seconds since the Unix epoch.
  141         -
        """
  142         -
        ...
  143         -
  144         -
  145         -
    @staticmethod
  146         -
    def from_str(s: str, format: Format) -> DateTime:
  147         -
        """
  148         -
        Parses a `DateTime` from a string using the given `format`.
  149         -
        """
  150         -
        ...
  151         -
  152         -
  153         -
    def has_subsec_nanos(self) -> bool:
  154         -
        """
  155         -
        Returns true if sub-second nanos is greater than zero.
  156         -
        """
  157         -
        ...
  158         -
  159         -
  160         -
    @staticmethod
  161         -
    def read(format: Format, delim: str) -> typing.Tuple[DateTime, str]:
  162         -
        """
  163         -
        Read 1 date of `format` from `s`, expecting either `delim` or EOF.
  164         -
  165         -
        TODO(PythonTyping): How do we represent `char` in Python?
  166         -
        """
  167         -
        ...
  168         -
  169         -
  170         -
    def secs(self) -> int:
  171         -
        """
  172         -
        Returns the epoch seconds component of the `DateTime`.
  173         -
        """
  174         -
        ...
  175         -
  176         -
  177         -
    def subsec_nanos(self) -> int:
  178         -
        """
  179         -
        Returns the sub-second nanos component of the `DateTime`.
  180         -
        """
  181         -
        ...
  182         -
  183         -
  184         -
    def to_millis(self) -> int:
  185         -
        """
  186         -
        Converts the `DateTime` to the number of milliseconds since the Unix epoch.
  187         -
        """
  188         -
        ...
  189         -
  190         -
  191         -
class Format:
  192         -
    """
  193         -
    Formats for representing a `DateTime` in the Smithy protocols.
  194         -
    """
  195         -
  196         -
    DateTime: Format
  197         -
    """
  198         -
    Formats for representing a `DateTime` in the Smithy protocols.
  199         -
    """
  200         -
  201         -
    EpochSeconds: Format
  202         -
    """
  203         -
    Formats for representing a `DateTime` in the Smithy protocols.
  204         -
    """
  205         -
  206         -
    HttpDate: Format
  207         -
    """
  208         -
    Formats for representing a `DateTime` in the Smithy protocols.
  209         -
    """

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/constrained.rs

@@ -313,313 +372,414 @@
  333    333   
            v.0.into_iter()
  334    334   
                .map(|(k, v)| {
  335    335   
                    let k = k.into();
  336    336   
                    let v = { v.into() };
  337    337   
                    (k, v)
  338    338   
                })
  339    339   
                .collect()
  340    340   
        }
  341    341   
    }
  342    342   
}
         343  +
pub(crate) mod indirectly_constrained_map_constrained {
         344  +
         345  +
    #[derive(Debug, Clone)]
         346  +
    pub(crate) struct IndirectlyConstrainedMapConstrained(
         347  +
        pub(crate) std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
         348  +
    );
         349  +
         350  +
    impl crate::constrained::Constrained for IndirectlyConstrainedMapConstrained {
         351  +
        type Unconstrained = crate::unconstrained::indirectly_constrained_map_unconstrained::IndirectlyConstrainedMapUnconstrained;
         352  +
    }
         353  +
    impl ::std::convert::From<IndirectlyConstrainedMapConstrained>
         354  +
        for ::std::collections::HashMap<::std::string::String, ::std::string::String>
         355  +
    {
         356  +
        fn from(v: IndirectlyConstrainedMapConstrained) -> Self {
         357  +
            v.0.into_iter()
         358  +
                .map(|(k, v)| {
         359  +
                    let k = k.into();
         360  +
                    let v = { v.into() };
         361  +
                    (k, v)
         362  +
                })
         363  +
                .collect()
         364  +
        }
         365  +
    }
         366  +
}
         367  +
pub(crate) mod indirectly_constrained_list_constrained {
         368  +
         369  +
    #[derive(Debug, Clone)]
         370  +
    pub(crate) struct IndirectlyConstrainedListConstrained(
         371  +
        pub(crate) std::vec::Vec<crate::model::LengthString>,
         372  +
    );
         373  +
         374  +
    impl crate::constrained::Constrained for IndirectlyConstrainedListConstrained {
         375  +
        type Unconstrained = crate::unconstrained::indirectly_constrained_list_unconstrained::IndirectlyConstrainedListUnconstrained;
         376  +
    }
         377  +
    impl ::std::convert::From<IndirectlyConstrainedListConstrained>
         378  +
        for ::std::vec::Vec<::std::string::String>
         379  +
    {
         380  +
        fn from(v: IndirectlyConstrainedListConstrained) -> Self {
         381  +
            v.0.into_iter().map(|item| item.into()).collect()
         382  +
        }
         383  +
    }
         384  +
}
  343    385   
pub(crate) mod recursive_list_constrained {
  344    386   
  345    387   
    #[derive(Debug, Clone)]
  346    388   
    pub(crate) struct RecursiveListConstrained(
  347    389   
        pub(crate) std::vec::Vec<crate::model::RecursiveShapesInputOutputNested1>,
  348    390   
    );
  349    391   
  350    392   
    impl crate::constrained::Constrained for RecursiveListConstrained {
  351    393   
        type Unconstrained =
  352    394   
            crate::unconstrained::recursive_list_unconstrained::RecursiveListUnconstrained;

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/error.rs

@@ -1624,1624 +1683,1781 @@
 1644   1644   
                return error.into();
 1645   1645   
            }
 1646   1646   
            crate::error::InternalServerError {
 1647   1647   
                message: error.to_string(),
 1648   1648   
            }
 1649   1649   
            .into()
 1650   1650   
        })
 1651   1651   
    }
 1652   1652   
}
 1653   1653   
        1654  +
/// Error type for the `ConstrainedListWithIndirectlyConstrainedAggregateOperation` operation.
        1655  +
/// Each variant represents an error that can occur for the `ConstrainedListWithIndirectlyConstrainedAggregateOperation` operation.
        1656  +
#[derive(::std::fmt::Debug)]
        1657  +
pub enum ConstrainedListWithIndirectlyConstrainedAggregateOperationError {
        1658  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
        1659  +
    ValidationException(crate::error::ValidationException),
        1660  +
    #[allow(missing_docs)] // documentation missing in model
        1661  +
    InternalServerError(crate::error::InternalServerError),
        1662  +
}
        1663  +
impl ::std::fmt::Display for ConstrainedListWithIndirectlyConstrainedAggregateOperationError {
        1664  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1665  +
        match &self {
        1666  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::ValidationException(_inner) =>
        1667  +
            _inner.fmt(f)
        1668  +
            ,
        1669  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::InternalServerError(_inner) =>
        1670  +
            _inner.fmt(f)
        1671  +
            ,
        1672  +
        }
        1673  +
    }
        1674  +
}
        1675  +
impl ConstrainedListWithIndirectlyConstrainedAggregateOperationError {
        1676  +
    /// Returns `true` if the error kind is `ConstrainedListWithIndirectlyConstrainedAggregateOperationError::ValidationException`.
        1677  +
    pub fn is_validation_exception(&self) -> bool {
        1678  +
        matches!(
        1679  +
            &self,
        1680  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::ValidationException(_)
        1681  +
        )
        1682  +
    }
        1683  +
    /// Returns `true` if the error kind is `ConstrainedListWithIndirectlyConstrainedAggregateOperationError::InternalServerError`.
        1684  +
    pub fn is_internal_server_error(&self) -> bool {
        1685  +
        matches!(
        1686  +
            &self,
        1687  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::InternalServerError(_)
        1688  +
        )
        1689  +
    }
        1690  +
    /// Returns the error name string by matching the correct variant.
        1691  +
    pub fn name(&self) -> &'static str {
        1692  +
        match &self {
        1693  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::ValidationException(_inner) =>
        1694  +
            _inner.name()
        1695  +
            ,
        1696  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::InternalServerError(_inner) =>
        1697  +
            _inner.name()
        1698  +
            ,
        1699  +
        }
        1700  +
    }
        1701  +
}
        1702  +
impl ::std::error::Error for ConstrainedListWithIndirectlyConstrainedAggregateOperationError {
        1703  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
        1704  +
        match &self {
        1705  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::ValidationException(_inner) =>
        1706  +
            Some(_inner)
        1707  +
            ,
        1708  +
            ConstrainedListWithIndirectlyConstrainedAggregateOperationError::InternalServerError(_inner) =>
        1709  +
            Some(_inner)
        1710  +
            ,
        1711  +
        }
        1712  +
    }
        1713  +
}
        1714  +
impl ::std::convert::From<crate::error::ValidationException>
        1715  +
    for crate::error::ConstrainedListWithIndirectlyConstrainedAggregateOperationError
        1716  +
{
        1717  +
    fn from(
        1718  +
        variant: crate::error::ValidationException,
        1719  +
    ) -> crate::error::ConstrainedListWithIndirectlyConstrainedAggregateOperationError {
        1720  +
        Self::ValidationException(variant)
        1721  +
    }
        1722  +
}
        1723  +
impl ::std::convert::From<crate::error::InternalServerError>
        1724  +
    for crate::error::ConstrainedListWithIndirectlyConstrainedAggregateOperationError
        1725  +
{
        1726  +
    fn from(
        1727  +
        variant: crate::error::InternalServerError,
        1728  +
    ) -> crate::error::ConstrainedListWithIndirectlyConstrainedAggregateOperationError {
        1729  +
        Self::InternalServerError(variant)
        1730  +
    }
        1731  +
}
        1732  +
        1733  +
impl ::std::convert::From<::pyo3::PyErr>
        1734  +
    for crate::error::ConstrainedListWithIndirectlyConstrainedAggregateOperationError
        1735  +
{
        1736  +
    fn from(
        1737  +
        variant: ::pyo3::PyErr,
        1738  +
    ) -> crate::error::ConstrainedListWithIndirectlyConstrainedAggregateOperationError {
        1739  +
        ::pyo3::Python::with_gil(|py| {
        1740  +
            let error = variant.value(py);
        1741  +
            if let Ok(error) = error.extract::<crate::error::ValidationException>() {
        1742  +
                return error.into();
        1743  +
            }
        1744  +
            crate::error::InternalServerError {
        1745  +
                message: error.to_string(),
        1746  +
            }
        1747  +
            .into()
        1748  +
        })
        1749  +
    }
        1750  +
}
        1751  +
 1654   1752   
/// Error type for the `ConstrainedRecursiveShapesOperation` operation.
 1655   1753   
/// Each variant represents an error that can occur for the `ConstrainedRecursiveShapesOperation` operation.
 1656   1754   
#[derive(::std::fmt::Debug)]
 1657   1755   
pub enum ConstrainedRecursiveShapesOperationError {
 1658   1756   
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
 1659   1757   
    ValidationException(crate::error::ValidationException),
 1660   1758   
    #[allow(missing_docs)] // documentation missing in model
 1661   1759   
    InternalServerError(crate::error::InternalServerError),
 1662   1760   
}
 1663   1761   
impl ::std::fmt::Display for ConstrainedRecursiveShapesOperationError {

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/input.rs

@@ -1039,1039 +1098,1182 @@
 1059   1059   
    type Unconstrained =
 1060   1060   
        crate::input::query_params_targeting_length_map_operation_input_internal::Builder;
 1061   1061   
}
 1062   1062   
impl QueryParamsTargetingLengthMapOperationInput {
 1063   1063   
    /// Creates a new builder-style object to manufacture [`QueryParamsTargetingLengthMapOperationInput`](crate::input::QueryParamsTargetingLengthMapOperationInput).
 1064   1064   
    pub fn builder() -> crate::input::query_params_targeting_length_map_operation_input::Builder {
 1065   1065   
        crate::input::query_params_targeting_length_map_operation_input::Builder::default()
 1066   1066   
    }
 1067   1067   
}
 1068   1068   
        1069  +
#[::pyo3::pyclass]
        1070  +
/// :param a typing.Optional\[typing.List\[typing.List\[str\]\]\]:
        1071  +
/// :param b typing.Optional\[typing.List\[typing.Dict\[str, str\]\]\]:
        1072  +
/// :rtype None:
        1073  +
#[allow(missing_docs)] // documentation missing in model
        1074  +
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
        1075  +
pub struct ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        1076  +
    #[pyo3(get, set)]
        1077  +
    /// :type typing.Optional\[typing.List\[typing.List\[str\]\]\]:
        1078  +
    #[allow(missing_docs)] // documentation missing in model
        1079  +
    pub a: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
        1080  +
    #[pyo3(get, set)]
        1081  +
    /// :type typing.Optional\[typing.List\[typing.Dict\[str, str\]\]\]:
        1082  +
    #[allow(missing_docs)] // documentation missing in model
        1083  +
    pub b: ::std::option::Option<
        1084  +
        ::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
        1085  +
    >,
        1086  +
}
        1087  +
impl ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        1088  +
    #[allow(missing_docs)] // documentation missing in model
        1089  +
    pub fn a(&self) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
        1090  +
        self.a.as_deref()
        1091  +
    }
        1092  +
    #[allow(missing_docs)] // documentation missing in model
        1093  +
    pub fn b(
        1094  +
        &self,
        1095  +
    ) -> ::std::option::Option<
        1096  +
        &[::std::collections::HashMap<::std::string::String, ::std::string::String>],
        1097  +
    > {
        1098  +
        self.b.as_deref()
        1099  +
    }
        1100  +
}
        1101  +
#[allow(clippy::new_without_default)]
        1102  +
#[allow(clippy::too_many_arguments)]
        1103  +
#[::pyo3::pymethods]
        1104  +
impl ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        1105  +
    #[new]
        1106  +
    pub fn new(
        1107  +
        a: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
        1108  +
        b: ::std::option::Option<
        1109  +
            ::std::vec::Vec<
        1110  +
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
        1111  +
            >,
        1112  +
        >,
        1113  +
    ) -> Self {
        1114  +
        Self { a, b }
        1115  +
    }
        1116  +
    fn __repr__(&self) -> String {
        1117  +
        format!("{self:?}")
        1118  +
    }
        1119  +
    fn __str__(&self) -> String {
        1120  +
        format!("{self:?}")
        1121  +
    }
        1122  +
}
        1123  +
impl<'source> ::pyo3::FromPyObject<'source>
        1124  +
    for std::boxed::Box<ConstrainedListWithIndirectlyConstrainedAggregateOperationInput>
        1125  +
{
        1126  +
    fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
        1127  +
        ob.extract::<ConstrainedListWithIndirectlyConstrainedAggregateOperationInput>()
        1128  +
            .map(Box::new)
        1129  +
    }
        1130  +
}
        1131  +
        1132  +
impl ::pyo3::IntoPy<::pyo3::PyObject>
        1133  +
    for std::boxed::Box<ConstrainedListWithIndirectlyConstrainedAggregateOperationInput>
        1134  +
{
        1135  +
    fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
        1136  +
        (*self).into_py(py)
        1137  +
    }
        1138  +
}
        1139  +
impl crate::constrained::Constrained
        1140  +
    for crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput
        1141  +
{
        1142  +
    type Unconstrained = crate::input::constrained_list_with_indirectly_constrained_aggregate_operation_input_internal::Builder;
        1143  +
}
        1144  +
impl ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        1145  +
    /// Creates a new builder-style object to manufacture [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
        1146  +
    pub fn builder(
        1147  +
    ) -> crate::input::constrained_list_with_indirectly_constrained_aggregate_operation_input::Builder
        1148  +
    {
        1149  +
        crate::input::constrained_list_with_indirectly_constrained_aggregate_operation_input::Builder::default()
        1150  +
    }
        1151  +
}
        1152  +
 1069   1153   
#[::pyo3::pyclass]
 1070   1154   
/// :param nested typing.Optional\[constraints.model.RecursiveShapesInputOutputNested1\]:
 1071   1155   
/// :param recursive_list typing.List\[constraints.model.RecursiveShapesInputOutputNested1\]:
 1072   1156   
/// :rtype None:
 1073   1157   
#[allow(missing_docs)] // documentation missing in model
 1074   1158   
#[derive(
 1075   1159   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
 1076   1160   
)]
 1077   1161   
pub struct ConstrainedRecursiveShapesOperationInput {
 1078   1162   
    #[pyo3(get, set)]
@@ -4115,4199 +4174,4471 @@
 4135   4219   
        }
 4136   4220   
        fn build_enforcing_required_and_enum_traits(
 4137   4221   
            self,
 4138   4222   
        ) -> crate::input::QueryParamsTargetingLengthMapOperationInput {
 4139   4223   
            crate::input::QueryParamsTargetingLengthMapOperationInput {
 4140   4224   
                length_map: self.length_map,
 4141   4225   
            }
 4142   4226   
        }
 4143   4227   
    }
 4144   4228   
}
        4229  +
/// See [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
        4230  +
pub(crate) mod constrained_list_with_indirectly_constrained_aggregate_operation_input_internal {
        4231  +
        4232  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
        4233  +
    /// Holds one variant for each of the ways the builder can fail.
        4234  +
    #[non_exhaustive]
        4235  +
    #[allow(clippy::enum_variant_names)]
        4236  +
    pub(crate) enum ConstraintViolation {
        4237  +
        /// Constraint violation occurred building member `a` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`.
        4238  +
        #[doc(hidden)]
        4239  +
        A(crate::model::list_with_indirectly_constrained_list_internal::ConstraintViolation),
        4240  +
        /// Constraint violation occurred building member `b` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`.
        4241  +
        #[doc(hidden)]
        4242  +
        B(crate::model::list_with_indirectly_constrained_map_internal::ConstraintViolation),
        4243  +
    }
        4244  +
    impl ::std::fmt::Display for ConstraintViolation {
        4245  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        4246  +
            match self {
        4247  +
                ConstraintViolation::A(_) => write!(f, "constraint violation occurred building member `a` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`"),
        4248  +
                ConstraintViolation::B(_) => write!(f, "constraint violation occurred building member `b` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`"),
        4249  +
            }
        4250  +
        }
        4251  +
    }
        4252  +
    impl ::std::error::Error for ConstraintViolation {}
        4253  +
    impl ConstraintViolation {
        4254  +
        pub(crate) fn as_validation_exception_field(
        4255  +
            self,
        4256  +
            path: ::std::string::String,
        4257  +
        ) -> crate::model::ValidationExceptionField {
        4258  +
            match self {
        4259  +
                ConstraintViolation::A(inner) => inner.as_validation_exception_field(path + "/a"),
        4260  +
                ConstraintViolation::B(inner) => inner.as_validation_exception_field(path + "/b"),
        4261  +
            }
        4262  +
        }
        4263  +
    }
        4264  +
    impl ::std::convert::From<ConstraintViolation>
        4265  +
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
        4266  +
    {
        4267  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
        4268  +
            let first_validation_exception_field =
        4269  +
                constraint_violation.as_validation_exception_field("".to_owned());
        4270  +
            let validation_exception = crate::error::ValidationException {
        4271  +
                message: format!(
        4272  +
                    "1 validation error detected. {}",
        4273  +
                    &first_validation_exception_field.message
        4274  +
                ),
        4275  +
                field_list: Some(vec![first_validation_exception_field]),
        4276  +
            };
        4277  +
            Self::ConstraintViolation(
        4278  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
        4279  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
        4280  +
                            )
        4281  +
        }
        4282  +
    }
        4283  +
    impl ::std::convert::From<Builder>
        4284  +
        for crate::constrained::MaybeConstrained<
        4285  +
            crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput,
        4286  +
        >
        4287  +
    {
        4288  +
        fn from(builder: Builder) -> Self {
        4289  +
            Self::Unconstrained(builder)
        4290  +
        }
        4291  +
    }
        4292  +
    impl ::std::convert::TryFrom<Builder>
        4293  +
        for crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput
        4294  +
    {
        4295  +
        type Error = ConstraintViolation;
        4296  +
        4297  +
        fn try_from(builder: Builder) -> Result<Self, Self::Error> {
        4298  +
            builder.build()
        4299  +
        }
        4300  +
    }
        4301  +
    /// A builder for [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
        4302  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        4303  +
    pub(crate) struct Builder {
        4304  +
        pub(crate) a: ::std::option::Option<
        4305  +
            crate::constrained::MaybeConstrained<crate::model::ListWithIndirectlyConstrainedList>,
        4306  +
        >,
        4307  +
        pub(crate) b: ::std::option::Option<
        4308  +
            crate::constrained::MaybeConstrained<crate::model::ListWithIndirectlyConstrainedMap>,
        4309  +
        >,
        4310  +
    }
        4311  +
    impl Builder {
        4312  +
        #[allow(missing_docs)] // documentation missing in model
        4313  +
        pub(crate) fn set_a(
        4314  +
            mut self,
        4315  +
            input: Option<
        4316  +
                impl ::std::convert::Into<
        4317  +
                    crate::constrained::MaybeConstrained<
        4318  +
                        crate::model::ListWithIndirectlyConstrainedList,
        4319  +
                    >,
        4320  +
                >,
        4321  +
            >,
        4322  +
        ) -> Self {
        4323  +
            self.a = input.map(|v| v.into());
        4324  +
            self
        4325  +
        }
        4326  +
        #[allow(missing_docs)] // documentation missing in model
        4327  +
        pub(crate) fn set_b(
        4328  +
            mut self,
        4329  +
            input: Option<
        4330  +
                impl ::std::convert::Into<
        4331  +
                    crate::constrained::MaybeConstrained<
        4332  +
                        crate::model::ListWithIndirectlyConstrainedMap,
        4333  +
                    >,
        4334  +
                >,
        4335  +
            >,
        4336  +
        ) -> Self {
        4337  +
            self.b = input.map(|v| v.into());
        4338  +
            self
        4339  +
        }
        4340  +
        /// Consumes the builder and constructs a [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
        4341  +
        ///
        4342  +
        /// The builder fails to construct a [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput) if a [`ConstraintViolation`] occurs.
        4343  +
        ///
        4344  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
        4345  +
        pub fn build(
        4346  +
            self,
        4347  +
        ) -> Result<
        4348  +
            crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput,
        4349  +
            ConstraintViolation,
        4350  +
        > {
        4351  +
            self.build_enforcing_all_constraints()
        4352  +
        }
        4353  +
        fn build_enforcing_all_constraints(
        4354  +
            self,
        4355  +
        ) -> Result<
        4356  +
            crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput,
        4357  +
            ConstraintViolation,
        4358  +
        > {
        4359  +
            Ok(
        4360  +
                crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        4361  +
                    a: self
        4362  +
                        .a
        4363  +
                        .map(|v| match v {
        4364  +
                            crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
        4365  +
                            crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
        4366  +
                        })
        4367  +
                        .map(|res| res.map_err(ConstraintViolation::A))
        4368  +
                        .transpose()?
        4369  +
                        .map(|v: crate::model::ListWithIndirectlyConstrainedList| v.into()),
        4370  +
                    b: self
        4371  +
                        .b
        4372  +
                        .map(|v| match v {
        4373  +
                            crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
        4374  +
                            crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
        4375  +
                        })
        4376  +
                        .map(|res| res.map_err(ConstraintViolation::B))
        4377  +
                        .transpose()?
        4378  +
                        .map(|v: crate::model::ListWithIndirectlyConstrainedMap| v.into()),
        4379  +
                },
        4380  +
            )
        4381  +
        }
        4382  +
    }
        4383  +
}
        4384  +
/// See [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
        4385  +
pub mod constrained_list_with_indirectly_constrained_aggregate_operation_input {
        4386  +
        4387  +
    impl ::std::convert::From<Builder>
        4388  +
        for crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput
        4389  +
    {
        4390  +
        fn from(builder: Builder) -> Self {
        4391  +
            builder.build()
        4392  +
        }
        4393  +
    }
        4394  +
    /// A builder for [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
        4395  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        4396  +
    pub struct Builder {
        4397  +
        pub(crate) a:
        4398  +
            ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
        4399  +
        pub(crate) b: ::std::option::Option<
        4400  +
            ::std::vec::Vec<
        4401  +
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
        4402  +
            >,
        4403  +
        >,
        4404  +
    }
        4405  +
    impl Builder {
        4406  +
        #[allow(missing_docs)] // documentation missing in model
        4407  +
        pub fn a(
        4408  +
            mut self,
        4409  +
            input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
        4410  +
        ) -> Self {
        4411  +
            self.a = input;
        4412  +
            self
        4413  +
        }
        4414  +
        #[allow(missing_docs)] // documentation missing in model
        4415  +
        pub fn b(
        4416  +
            mut self,
        4417  +
            input: ::std::option::Option<
        4418  +
                ::std::vec::Vec<
        4419  +
                    ::std::collections::HashMap<::std::string::String, ::std::string::String>,
        4420  +
                >,
        4421  +
            >,
        4422  +
        ) -> Self {
        4423  +
            self.b = input;
        4424  +
            self
        4425  +
        }
        4426  +
        /// Consumes the builder and constructs a [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
        4427  +
        pub fn build(
        4428  +
            self,
        4429  +
        ) -> crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        4430  +
            self.build_enforcing_required_and_enum_traits()
        4431  +
        }
        4432  +
        fn build_enforcing_required_and_enum_traits(
        4433  +
            self,
        4434  +
        ) -> crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        4435  +
            crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
        4436  +
                a: self.a,
        4437  +
                b: self.b,
        4438  +
            }
        4439  +
        }
        4440  +
    }
        4441  +
}
 4145   4442   
/// See [`ConstrainedRecursiveShapesOperationInput`](crate::input::ConstrainedRecursiveShapesOperationInput).
 4146   4443   
pub(crate) mod constrained_recursive_shapes_operation_input_internal {
 4147   4444   
 4148   4445   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 4149   4446   
    /// Holds one variant for each of the ways the builder can fail.
 4150   4447   
    #[non_exhaustive]
 4151   4448   
    #[allow(clippy::enum_variant_names)]
 4152   4449   
    pub(crate) enum ConstraintViolation {
 4153   4450   
        /// Constraint violation occurred building member `nested` when building `ConstrainedRecursiveShapesOperationInput`.
 4154   4451   
        #[doc(hidden)]

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/lib.rs

@@ -139,139 +240,245 @@
  159    159   
//! ```rust,no_run
  160    160   
//! # use std::net::SocketAddr;
  161    161   
//! use constraints::{ConstraintsService, ConstraintsServiceConfig};
  162    162   
//!
  163    163   
//! #[::tokio::main]
  164    164   
//! pub async fn main() {
  165    165   
//!    let config = ConstraintsServiceConfig::builder().build();
  166    166   
//!    let app = ConstraintsService::builder(config)
  167    167   
//!        .constrained_http_bound_shapes_operation(constrained_http_bound_shapes_operation)
  168    168   
//!        .constrained_http_payload_bound_shape_operation(constrained_http_payload_bound_shape_operation)
         169  +
//!        .constrained_list_with_indirectly_constrained_aggregate_operation(constrained_list_with_indirectly_constrained_aggregate_operation)
  169    170   
//!        .constrained_recursive_shapes_operation(constrained_recursive_shapes_operation)
  170    171   
//!        .constrained_shapes_only_in_output_operation(constrained_shapes_only_in_output_operation)
  171    172   
//!        .constrained_shapes_operation(constrained_shapes_operation)
  172    173   
//!        .event_streams_operation(event_streams_operation)
  173    174   
//!        .http_prefix_headers_targeting_length_map_operation(http_prefix_headers_targeting_length_map_operation)
  174    175   
//!        .non_streaming_blob_operation(non_streaming_blob_operation)
  175    176   
//!        .query_params_targeting_length_map_operation(query_params_targeting_length_map_operation)
  176    177   
//!        .query_params_targeting_map_of_enum_string_operation(query_params_targeting_map_of_enum_string_operation)
  177    178   
//!        .query_params_targeting_map_of_length_list_of_pattern_string_operation(query_params_targeting_map_of_length_list_of_pattern_string_operation)
  178    179   
//!        .query_params_targeting_map_of_length_pattern_string_operation(query_params_targeting_map_of_length_pattern_string_operation)
  179    180   
//!        .query_params_targeting_map_of_length_string_operation(query_params_targeting_map_of_length_string_operation)
  180    181   
//!        .query_params_targeting_map_of_list_of_enum_string_operation(query_params_targeting_map_of_list_of_enum_string_operation)
  181    182   
//!        .query_params_targeting_map_of_list_of_length_pattern_string_operation(query_params_targeting_map_of_list_of_length_pattern_string_operation)
  182    183   
//!        .query_params_targeting_map_of_list_of_length_string_operation(query_params_targeting_map_of_list_of_length_string_operation)
  183    184   
//!        .query_params_targeting_map_of_list_of_pattern_string_operation(query_params_targeting_map_of_list_of_pattern_string_operation)
  184    185   
//!        .query_params_targeting_map_of_pattern_string_operation(query_params_targeting_map_of_pattern_string_operation)
  185    186   
//!        .query_params_targeting_map_of_set_of_length_string_operation(query_params_targeting_map_of_set_of_length_string_operation)
  186    187   
//!        .streaming_blob_operation(streaming_blob_operation)
  187    188   
//!        .build()
  188    189   
//!        .expect("failed to build an instance of ConstraintsService");
  189    190   
//!
  190    191   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  191    192   
//!        .expect("unable to parse the server bind address and port");
  192    193   
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
  193    194   
//!    # let server = async { Ok::<_, ()>(()) };
  194    195   
//!
  195    196   
//!    // Run your service!
  196    197   
//!    if let Err(err) = server.await {
  197    198   
//!        eprintln!("server error: {:?}", err);
  198    199   
//!    }
  199    200   
//! }
  200    201   
//!
  201    202   
//! use constraints::{input, output, error};
  202    203   
//!
  203    204   
//! async fn constrained_http_bound_shapes_operation(input: input::ConstrainedHttpBoundShapesOperationInput) -> Result<output::ConstrainedHttpBoundShapesOperationOutput, error::ConstrainedHttpBoundShapesOperationError> {
  204    205   
//!     todo!()
  205    206   
//! }
  206    207   
//!
  207    208   
//! async fn constrained_http_payload_bound_shape_operation(input: input::ConstrainedHttpPayloadBoundShapeOperationInput) -> Result<output::ConstrainedHttpPayloadBoundShapeOperationOutput, error::ConstrainedHttpPayloadBoundShapeOperationError> {
  208    209   
//!     todo!()
  209    210   
//! }
  210    211   
//!
         212  +
//! async fn constrained_list_with_indirectly_constrained_aggregate_operation(input: input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput) -> Result<output::ConstrainedListWithIndirectlyConstrainedAggregateOperationOutput, error::ConstrainedListWithIndirectlyConstrainedAggregateOperationError> {
         213  +
//!     todo!()
         214  +
//! }
         215  +
//!
  211    216   
//! async fn constrained_recursive_shapes_operation(input: input::ConstrainedRecursiveShapesOperationInput) -> Result<output::ConstrainedRecursiveShapesOperationOutput, error::ConstrainedRecursiveShapesOperationError> {
  212    217   
//!     todo!()
  213    218   
//! }
  214    219   
//!
  215    220   
//! async fn constrained_shapes_only_in_output_operation(input: input::ConstrainedShapesOnlyInOutputOperationInput) -> Result<output::ConstrainedShapesOnlyInOutputOperationOutput, error::ConstrainedShapesOnlyInOutputOperationError> {
  216    221   
//!     todo!()
  217    222   
//! }
  218    223   
//!
  219    224   
//! async fn constrained_shapes_operation(input: input::ConstrainedShapesOperationInput) -> Result<output::ConstrainedShapesOperationOutput, error::ConstrainedShapesOperationError> {
  220    225   
//!     todo!()

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/model.rs

@@ -769,769 +828,966 @@
  789    789   
impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<::std::string::String> {
  790    790   
    fn from(value: SetOfLengthString) -> Self {
  791    791   
        value.into_inner().into_iter().map(|v| v.into()).collect()
  792    792   
    }
  793    793   
}
  794    794   
impl crate::constrained::Constrained for SetOfLengthString {
  795    795   
    type Unconstrained =
  796    796   
        crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
  797    797   
}
  798    798   
         799  +
#[allow(missing_docs)] // documentation missing in model
         800  +
///
         801  +
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
         802  +
/// [constraint traits]. Use [`ListWithIndirectlyConstrainedMap::try_from`] to construct values of this type.
         803  +
///
         804  +
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
         805  +
///
         806  +
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         807  +
pub(crate) struct ListWithIndirectlyConstrainedMap(
         808  +
    pub(crate)  ::std::vec::Vec<
         809  +
        ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
         810  +
    >,
         811  +
);
         812  +
impl ListWithIndirectlyConstrainedMap {
         813  +
    /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::collections::HashMap::<crate::model::LengthString, crate::model::LengthString>>`].
         814  +
    pub fn into_inner(
         815  +
        self,
         816  +
    ) -> ::std::vec::Vec<
         817  +
        ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
         818  +
    > {
         819  +
        self.0
         820  +
    }
         821  +
         822  +
    fn check_length(
         823  +
        length: usize,
         824  +
    ) -> Result<(), crate::model::list_with_indirectly_constrained_map_internal::ConstraintViolation>
         825  +
    {
         826  +
        if (1..=10).contains(&length) {
         827  +
            Ok(())
         828  +
        } else {
         829  +
            Err(crate::model::list_with_indirectly_constrained_map_internal::ConstraintViolation::Length(length))
         830  +
        }
         831  +
    }
         832  +
}
         833  +
impl
         834  +
    ::std::convert::TryFrom<
         835  +
        ::std::vec::Vec<
         836  +
            ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
         837  +
        >,
         838  +
    > for ListWithIndirectlyConstrainedMap
         839  +
{
         840  +
    type Error = crate::model::list_with_indirectly_constrained_map_internal::ConstraintViolation;
         841  +
         842  +
    /// Constructs a `ListWithIndirectlyConstrainedMap` from an [`::std::vec::Vec<::std::collections::HashMap::<crate::model::LengthString, crate::model::LengthString>>`], failing when the provided value does not satisfy the modeled constraints.
         843  +
    fn try_from(
         844  +
        value: ::std::vec::Vec<
         845  +
            ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
         846  +
        >,
         847  +
    ) -> Result<Self, Self::Error> {
         848  +
        Self::check_length(value.len())?;
         849  +
         850  +
        Ok(Self(value))
         851  +
    }
         852  +
}
         853  +
         854  +
impl ::std::convert::From<ListWithIndirectlyConstrainedMap>
         855  +
    for ::std::vec::Vec<
         856  +
        ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthString>,
         857  +
    >
         858  +
{
         859  +
    fn from(value: ListWithIndirectlyConstrainedMap) -> Self {
         860  +
        value.into_inner()
         861  +
    }
         862  +
}
         863  +
impl ::std::convert::From<ListWithIndirectlyConstrainedMap>
         864  +
    for ::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>
         865  +
{
         866  +
    fn from(value: ListWithIndirectlyConstrainedMap) -> Self {
         867  +
        value.into_inner().into_iter().map(|v| v.into()).collect()
         868  +
    }
         869  +
}
         870  +
impl crate::constrained::Constrained for ListWithIndirectlyConstrainedMap {
         871  +
    type Unconstrained = crate::unconstrained::list_with_indirectly_constrained_map_unconstrained::ListWithIndirectlyConstrainedMapUnconstrained;
         872  +
}
         873  +
         874  +
#[allow(missing_docs)] // documentation missing in model
         875  +
///
         876  +
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
         877  +
/// [constraint traits]. Use [`ListWithIndirectlyConstrainedList::try_from`] to construct values of this type.
         878  +
///
         879  +
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
         880  +
///
         881  +
#[derive(
         882  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         883  +
)]
         884  +
pub(crate) struct ListWithIndirectlyConstrainedList(
         885  +
    pub(crate) ::std::vec::Vec<::std::vec::Vec<crate::model::LengthString>>,
         886  +
);
         887  +
impl ListWithIndirectlyConstrainedList {
         888  +
    /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::vec::Vec::<crate::model::LengthString>>`].
         889  +
    pub fn into_inner(self) -> ::std::vec::Vec<::std::vec::Vec<crate::model::LengthString>> {
         890  +
        self.0
         891  +
    }
         892  +
         893  +
    fn check_length(
         894  +
        length: usize,
         895  +
    ) -> Result<(), crate::model::list_with_indirectly_constrained_list_internal::ConstraintViolation>
         896  +
    {
         897  +
        if (1..=10).contains(&length) {
         898  +
            Ok(())
         899  +
        } else {
         900  +
            Err(crate::model::list_with_indirectly_constrained_list_internal::ConstraintViolation::Length(length))
         901  +
        }
         902  +
    }
         903  +
}
         904  +
impl ::std::convert::TryFrom<::std::vec::Vec<::std::vec::Vec<crate::model::LengthString>>>
         905  +
    for ListWithIndirectlyConstrainedList
         906  +
{
         907  +
    type Error = crate::model::list_with_indirectly_constrained_list_internal::ConstraintViolation;
         908  +
         909  +
    /// Constructs a `ListWithIndirectlyConstrainedList` from an [`::std::vec::Vec<::std::vec::Vec::<crate::model::LengthString>>`], failing when the provided value does not satisfy the modeled constraints.
         910  +
    fn try_from(
         911  +
        value: ::std::vec::Vec<::std::vec::Vec<crate::model::LengthString>>,
         912  +
    ) -> Result<Self, Self::Error> {
         913  +
        Self::check_length(value.len())?;
         914  +
         915  +
        Ok(Self(value))
         916  +
    }
         917  +
}
         918  +
         919  +
impl ::std::convert::From<ListWithIndirectlyConstrainedList>
         920  +
    for ::std::vec::Vec<::std::vec::Vec<crate::model::LengthString>>
         921  +
{
         922  +
    fn from(value: ListWithIndirectlyConstrainedList) -> Self {
         923  +
        value.into_inner()
         924  +
    }
         925  +
}
         926  +
impl ::std::convert::From<ListWithIndirectlyConstrainedList>
         927  +
    for ::std::vec::Vec<::std::vec::Vec<::std::string::String>>
         928  +
{
         929  +
    fn from(value: ListWithIndirectlyConstrainedList) -> Self {
         930  +
        value.into_inner().into_iter().map(|v| v.into()).collect()
         931  +
    }
         932  +
}
         933  +
impl crate::constrained::Constrained for ListWithIndirectlyConstrainedList {
         934  +
    type Unconstrained = crate::unconstrained::list_with_indirectly_constrained_list_unconstrained::ListWithIndirectlyConstrainedListUnconstrained;
         935  +
}
         936  +
  799    937   
#[::pyo3::pyclass]
  800    938   
/// :param recursive_member constraints.model.RecursiveShapesInputOutputNested2:
  801    939   
/// :rtype None:
  802    940   
#[allow(missing_docs)] // documentation missing in model
  803    941   
#[derive(
  804    942   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  805    943   
)]
  806    944   
pub struct RecursiveShapesInputOutputNested1 {
  807    945   
    #[pyo3(get, set)]
  808    946   
    /// :type constraints.model.RecursiveShapesInputOutputNested2:
@@ -6172,6310 +6231,6548 @@
 6192   6330   
            match self {
 6193   6331   
                Self::Key(key_constraint_violation) => {
 6194   6332   
                    key_constraint_violation.as_validation_exception_field(path)
 6195   6333   
                }
 6196   6334   
                Self::Value(key, value_constraint_violation) => value_constraint_violation
 6197   6335   
                    .as_validation_exception_field(path + "/" + key.as_str()),
 6198   6336   
            }
 6199   6337   
        }
 6200   6338   
    }
 6201   6339   
}
        6340  +
pub(crate) mod list_with_indirectly_constrained_map_internal {
        6341  +
        6342  +
    #[allow(clippy::enum_variant_names)]
        6343  +
    #[derive(Debug, PartialEq)]
        6344  +
    pub(crate) enum ConstraintViolation {
        6345  +
        /// Constraint violation error when the list doesn't have the required length
        6346  +
        Length(usize),
        6347  +
        /// Constraint violation error when an element doesn't satisfy its own constraints.
        6348  +
        /// The first component of the tuple is the index in the collection where the
        6349  +
        /// first constraint violation was found.
        6350  +
        #[doc(hidden)]
        6351  +
        Member(
        6352  +
            usize,
        6353  +
            crate::model::indirectly_constrained_map_internal::ConstraintViolation,
        6354  +
        ),
        6355  +
    }
        6356  +
        6357  +
    impl ::std::fmt::Display for ConstraintViolation {
        6358  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        6359  +
            let message = match self {
        6360  +
                Self::Length(length) => {
        6361  +
                    format!("Value with length {} provided for 'com.amazonaws.constraints#ListWithIndirectlyConstrainedMap' failed to satisfy constraint: Member must have length between 1 and 10, inclusive", length)
        6362  +
                }
        6363  +
                Self::Member(index, failing_member) => format!(
        6364  +
                    "Value at index {index} failed to satisfy constraint. {}",
        6365  +
                    failing_member
        6366  +
                ),
        6367  +
            };
        6368  +
            write!(f, "{message}")
        6369  +
        }
        6370  +
    }
        6371  +
        6372  +
    impl ::std::error::Error for ConstraintViolation {}
        6373  +
    impl ConstraintViolation {
        6374  +
        pub(crate) fn as_validation_exception_field(
        6375  +
            self,
        6376  +
            path: ::std::string::String,
        6377  +
        ) -> crate::model::ValidationExceptionField {
        6378  +
            match self {
        6379  +
                        Self::Length(length) => crate::model::ValidationExceptionField {
        6380  +
                                message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 10, inclusive", length, &path),
        6381  +
                                path,
        6382  +
                            },
        6383  +
    Self::Member(index, member_constraint_violation) =>
        6384  +
                        member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
        6385  +
                    }
        6386  +
        }
        6387  +
    }
        6388  +
}
        6389  +
pub(crate) mod indirectly_constrained_map_internal {
        6390  +
        6391  +
    #[allow(clippy::enum_variant_names)]
        6392  +
    #[derive(Debug, PartialEq)]
        6393  +
    pub(crate) enum ConstraintViolation {
        6394  +
        #[doc(hidden)]
        6395  +
        Key(crate::model::length_string_internal::ConstraintViolation),
        6396  +
        #[doc(hidden)]
        6397  +
        Value(
        6398  +
            crate::model::LengthString,
        6399  +
            crate::model::length_string_internal::ConstraintViolation,
        6400  +
        ),
        6401  +
    }
        6402  +
        6403  +
    impl ::std::fmt::Display for ConstraintViolation {
        6404  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        6405  +
            match self {
        6406  +
                Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
        6407  +
                Self::Value(_, value_constraint_violation) => {
        6408  +
                    write!(f, "{}", value_constraint_violation)
        6409  +
                }
        6410  +
            }
        6411  +
        }
        6412  +
    }
        6413  +
        6414  +
    impl ::std::error::Error for ConstraintViolation {}
        6415  +
    impl ConstraintViolation {
        6416  +
        pub(crate) fn as_validation_exception_field(
        6417  +
            self,
        6418  +
            path: ::std::string::String,
        6419  +
        ) -> crate::model::ValidationExceptionField {
        6420  +
            match self {
        6421  +
                Self::Key(key_constraint_violation) => {
        6422  +
                    key_constraint_violation.as_validation_exception_field(path)
        6423  +
                }
        6424  +
                Self::Value(key, value_constraint_violation) => value_constraint_violation
        6425  +
                    .as_validation_exception_field(path + "/" + key.as_str()),
        6426  +
            }
        6427  +
        }
        6428  +
    }
        6429  +
}
        6430  +
pub(crate) mod list_with_indirectly_constrained_list_internal {
        6431  +
        6432  +
    #[allow(clippy::enum_variant_names)]
        6433  +
    #[derive(Debug, PartialEq)]
        6434  +
    pub(crate) enum ConstraintViolation {
        6435  +
        /// Constraint violation error when the list doesn't have the required length
        6436  +
        Length(usize),
        6437  +
        /// Constraint violation error when an element doesn't satisfy its own constraints.
        6438  +
        /// The first component of the tuple is the index in the collection where the
        6439  +
        /// first constraint violation was found.
        6440  +
        #[doc(hidden)]
        6441  +
        Member(
        6442  +
            usize,
        6443  +
            crate::model::indirectly_constrained_list_internal::ConstraintViolation,
        6444  +
        ),
        6445  +
    }
        6446  +
        6447  +
    impl ::std::fmt::Display for ConstraintViolation {
        6448  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        6449  +
            let message = match self {
        6450  +
                Self::Length(length) => {
        6451  +
                    format!("Value with length {} provided for 'com.amazonaws.constraints#ListWithIndirectlyConstrainedList' failed to satisfy constraint: Member must have length between 1 and 10, inclusive", length)
        6452  +
                }
        6453  +
                Self::Member(index, failing_member) => format!(
        6454  +
                    "Value at index {index} failed to satisfy constraint. {}",
        6455  +
                    failing_member
        6456  +
                ),
        6457  +
            };
        6458  +
            write!(f, "{message}")
        6459  +
        }
        6460  +
    }
        6461  +
        6462  +
    impl ::std::error::Error for ConstraintViolation {}
        6463  +
    impl ConstraintViolation {
        6464  +
        pub(crate) fn as_validation_exception_field(
        6465  +
            self,
        6466  +
            path: ::std::string::String,
        6467  +
        ) -> crate::model::ValidationExceptionField {
        6468  +
            match self {
        6469  +
                        Self::Length(length) => crate::model::ValidationExceptionField {
        6470  +
                                message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 10, inclusive", length, &path),
        6471  +
                                path,
        6472  +
                            },
        6473  +
    Self::Member(index, member_constraint_violation) =>
        6474  +
                        member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
        6475  +
                    }
        6476  +
        }
        6477  +
    }
        6478  +
}
        6479  +
pub(crate) mod indirectly_constrained_list_internal {
        6480  +
        6481  +
    #[allow(clippy::enum_variant_names)]
        6482  +
    #[derive(Debug, PartialEq)]
        6483  +
    pub(crate) enum ConstraintViolation {
        6484  +
        /// Constraint violation error when an element doesn't satisfy its own constraints.
        6485  +
        /// The first component of the tuple is the index in the collection where the
        6486  +
        /// first constraint violation was found.
        6487  +
        #[doc(hidden)]
        6488  +
        Member(
        6489  +
            usize,
        6490  +
            crate::model::length_string_internal::ConstraintViolation,
        6491  +
        ),
        6492  +
    }
        6493  +
        6494  +
    impl ::std::fmt::Display for ConstraintViolation {
        6495  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        6496  +
            let message = match self {
        6497  +
                Self::Member(index, failing_member) => format!(
        6498  +
                    "Value at index {index} failed to satisfy constraint. {}",
        6499  +
                    failing_member
        6500  +
                ),
        6501  +
            };
        6502  +
            write!(f, "{message}")
        6503  +
        }
        6504  +
    }
        6505  +
        6506  +
    impl ::std::error::Error for ConstraintViolation {}
        6507  +
    impl ConstraintViolation {
        6508  +
        pub(crate) fn as_validation_exception_field(
        6509  +
            self,
        6510  +
            path: ::std::string::String,
        6511  +
        ) -> crate::model::ValidationExceptionField {
        6512  +
            match self {
        6513  +
                Self::Member(index, member_constraint_violation) => member_constraint_violation
        6514  +
                    .as_validation_exception_field(path + "/" + &index.to_string()),
        6515  +
            }
        6516  +
        }
        6517  +
    }
        6518  +
}
 6202   6519   
pub(crate) mod recursive_list_internal {
 6203   6520   
 6204   6521   
    #[allow(clippy::enum_variant_names)]
 6205   6522   
    #[derive(Debug, PartialEq)]
 6206   6523   
    pub(crate) enum ConstraintViolation {
 6207   6524   
        /// Constraint violation error when an element doesn't satisfy its own constraints.
 6208   6525   
        /// The first component of the tuple is the index in the collection where the
 6209   6526   
        /// first constraint violation was found.
 6210   6527   
        #[doc(hidden)]
 6211   6528   
        Member(