Server Test Python

Server Test Python

rev. a7fb2e3446d314cfbe48069306e4e0a389b39aeb

Files changed:

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

@@ -1,0 +323,0 @@
    1         -
import constraints.input
    2         -
import constraints.middleware
    3         -
import constraints.output
    4         -
import constraints.tls
    5         -
import typing
    6         -
    7         -
Ctx = typing.TypeVar('Ctx')
    8         -
    9         -
class App(typing.Generic[Ctx]):
   10         -
    """
   11         -
    Main Python application, used to register operations and context and start multiple
   12         -
    workers on the same shared socket.
   13         -
   14         -
    Operations can be registered using the application object as a decorator (`@app.operation_name`).
   15         -
   16         -
    Here's a full example to get you started:
   17         -
   18         -
    ```python
   19         -
    from constraints import input
   20         -
    from constraints import output
   21         -
    from constraints import error
   22         -
    from constraints import middleware
   23         -
    from constraints import App
   24         -
   25         -
    @dataclass
   26         -
    class Context:
   27         -
        counter: int = 0
   28         -
   29         -
    app = App()
   30         -
    app.context(Context())
   31         -
   32         -
    @app.request_middleware
   33         -
    def request_middleware(request: middleware::Request):
   34         -
        if request.get_header("x-amzn-id") != "secret":
   35         -
            raise middleware.MiddlewareException("Unsupported `x-amz-id` header", 401)
   36         -
   37         -
    @app.constrained_http_bound_shapes_operation
   38         -
    def constrained_http_bound_shapes_operation(input: input::ConstrainedHttpBoundShapesOperationInput, ctx: Context) -> output::ConstrainedHttpBoundShapesOperationOutput:
   39         -
        raise NotImplementedError
   40         -
   41         -
    @app.constrained_http_payload_bound_shape_operation
   42         -
    def constrained_http_payload_bound_shape_operation(input: input::ConstrainedHttpPayloadBoundShapeOperationInput, ctx: Context) -> output::ConstrainedHttpPayloadBoundShapeOperationOutput:
   43         -
        raise NotImplementedError
   44         -
   45         -
    @app.constrained_recursive_shapes_operation
   46         -
    def constrained_recursive_shapes_operation(input: input::ConstrainedRecursiveShapesOperationInput, ctx: Context) -> output::ConstrainedRecursiveShapesOperationOutput:
   47         -
        raise NotImplementedError
   48         -
   49         -
    @app.constrained_shapes_only_in_output_operation
   50         -
    def constrained_shapes_only_in_output_operation(input: input::ConstrainedShapesOnlyInOutputOperationInput, ctx: Context) -> output::ConstrainedShapesOnlyInOutputOperationOutput:
   51         -
        raise NotImplementedError
   52         -
   53         -
    @app.constrained_shapes_operation
   54         -
    def constrained_shapes_operation(input: input::ConstrainedShapesOperationInput, ctx: Context) -> output::ConstrainedShapesOperationOutput:
   55         -
        raise NotImplementedError
   56         -
   57         -
    @app.event_streams_operation
   58         -
    def event_streams_operation(input: input::EventStreamsOperationInput, ctx: Context) -> output::EventStreamsOperationOutput:
   59         -
        raise NotImplementedError
   60         -
   61         -
    @app.http_prefix_headers_targeting_length_map_operation
   62         -
    def http_prefix_headers_targeting_length_map_operation(input: input::HttpPrefixHeadersTargetingLengthMapOperationInput, ctx: Context) -> output::HttpPrefixHeadersTargetingLengthMapOperationOutput:
   63         -
        raise NotImplementedError
   64         -
   65         -
    @app.non_streaming_blob_operation
   66         -
    def non_streaming_blob_operation(input: input::NonStreamingBlobOperationInput, ctx: Context) -> output::NonStreamingBlobOperationOutput:
   67         -
        raise NotImplementedError
   68         -
   69         -
    @app.query_params_targeting_length_map_operation
   70         -
    def query_params_targeting_length_map_operation(input: input::QueryParamsTargetingLengthMapOperationInput, ctx: Context) -> output::QueryParamsTargetingLengthMapOperationOutput:
   71         -
        raise NotImplementedError
   72         -
   73         -
    @app.query_params_targeting_map_of_enum_string_operation
   74         -
    def query_params_targeting_map_of_enum_string_operation(input: input::QueryParamsTargetingMapOfEnumStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfEnumStringOperationOutput:
   75         -
        raise NotImplementedError
   76         -
   77         -
    @app.query_params_targeting_map_of_length_list_of_pattern_string_operation
   78         -
    def query_params_targeting_map_of_length_list_of_pattern_string_operation(input: input::QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput:
   79         -
        raise NotImplementedError
   80         -
   81         -
    @app.query_params_targeting_map_of_length_pattern_string_operation
   82         -
    def query_params_targeting_map_of_length_pattern_string_operation(input: input::QueryParamsTargetingMapOfLengthPatternStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput:
   83         -
        raise NotImplementedError
   84         -
   85         -
    @app.query_params_targeting_map_of_length_string_operation
   86         -
    def query_params_targeting_map_of_length_string_operation(input: input::QueryParamsTargetingMapOfLengthStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfLengthStringOperationOutput:
   87         -
        raise NotImplementedError
   88         -
   89         -
    @app.query_params_targeting_map_of_list_of_enum_string_operation
   90         -
    def query_params_targeting_map_of_list_of_enum_string_operation(input: input::QueryParamsTargetingMapOfListOfEnumStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput:
   91         -
        raise NotImplementedError
   92         -
   93         -
    @app.query_params_targeting_map_of_list_of_length_pattern_string_operation
   94         -
    def query_params_targeting_map_of_list_of_length_pattern_string_operation(input: input::QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput:
   95         -
        raise NotImplementedError
   96         -
   97         -
    @app.query_params_targeting_map_of_list_of_length_string_operation
   98         -
    def query_params_targeting_map_of_list_of_length_string_operation(input: input::QueryParamsTargetingMapOfListOfLengthStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput:
   99         -
        raise NotImplementedError
  100         -
  101         -
    @app.query_params_targeting_map_of_list_of_pattern_string_operation
  102         -
    def query_params_targeting_map_of_list_of_pattern_string_operation(input: input::QueryParamsTargetingMapOfListOfPatternStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput:
  103         -
        raise NotImplementedError
  104         -
  105         -
    @app.query_params_targeting_map_of_pattern_string_operation
  106         -
    def query_params_targeting_map_of_pattern_string_operation(input: input::QueryParamsTargetingMapOfPatternStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfPatternStringOperationOutput:
  107         -
        raise NotImplementedError
  108         -
  109         -
    @app.query_params_targeting_map_of_set_of_length_string_operation
  110         -
    def query_params_targeting_map_of_set_of_length_string_operation(input: input::QueryParamsTargetingMapOfSetOfLengthStringOperationInput, ctx: Context) -> output::QueryParamsTargetingMapOfSetOfLengthStringOperationOutput:
  111         -
        raise NotImplementedError
  112         -
  113         -
    @app.streaming_blob_operation
  114         -
    def streaming_blob_operation(input: input::StreamingBlobOperationInput, ctx: Context) -> output::StreamingBlobOperationOutput:
  115         -
        raise NotImplementedError
  116         -
  117         -
    app.run()
  118         -
    ```
  119         -
  120         -
    Any of operations above can be written as well prepending the `async` keyword and
  121         -
    the Python application will automatically handle it and schedule it on the event loop for you.
  122         -
    """
  123         -
  124         -
    def constrained_http_bound_shapes_operation(self, func: typing.Union[typing.Callable[[constraints.input.ConstrainedHttpBoundShapesOperationInput, Ctx], typing.Union[constraints.output.ConstrainedHttpBoundShapesOperationOutput, typing.Awaitable[constraints.output.ConstrainedHttpBoundShapesOperationOutput]]], typing.Callable[[constraints.input.ConstrainedHttpBoundShapesOperationInput], typing.Union[constraints.output.ConstrainedHttpBoundShapesOperationOutput, typing.Awaitable[constraints.output.ConstrainedHttpBoundShapesOperationOutput]]]]) -> None:
  125         -
        """
  126         -
        Method to register `constrained_http_bound_shapes_operation` Python implementation inside the handlers map.
  127         -
        It can be used as a function decorator in Python.
  128         -
        """
  129         -
        ...
  130         -
  131         -
  132         -
    def constrained_http_payload_bound_shape_operation(self, func: typing.Union[typing.Callable[[constraints.input.ConstrainedHttpPayloadBoundShapeOperationInput, Ctx], typing.Union[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput, typing.Awaitable[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput]]], typing.Callable[[constraints.input.ConstrainedHttpPayloadBoundShapeOperationInput], typing.Union[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput, typing.Awaitable[constraints.output.ConstrainedHttpPayloadBoundShapeOperationOutput]]]]) -> None:
  133         -
        """
  134         -
        Method to register `constrained_http_payload_bound_shape_operation` Python implementation inside the handlers map.
  135         -
        It can be used as a function decorator in Python.
  136         -
        """
  137         -
        ...
  138         -
  139         -
  140         -
    def constrained_recursive_shapes_operation(self, func: typing.Union[typing.Callable[[constraints.input.ConstrainedRecursiveShapesOperationInput, Ctx], typing.Union[constraints.output.ConstrainedRecursiveShapesOperationOutput, typing.Awaitable[constraints.output.ConstrainedRecursiveShapesOperationOutput]]], typing.Callable[[constraints.input.ConstrainedRecursiveShapesOperationInput], typing.Union[constraints.output.ConstrainedRecursiveShapesOperationOutput, typing.Awaitable[constraints.output.ConstrainedRecursiveShapesOperationOutput]]]]) -> None:
  141         -
        """
  142         -
        Method to register `constrained_recursive_shapes_operation` Python implementation inside the handlers map.
  143         -
        It can be used as a function decorator in Python.
  144         -
        """
  145         -
        ...
  146         -
  147         -
  148         -
    def constrained_shapes_only_in_output_operation(self, func: typing.Union[typing.Callable[[constraints.input.ConstrainedShapesOnlyInOutputOperationInput, Ctx], typing.Union[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput, typing.Awaitable[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput]]], typing.Callable[[constraints.input.ConstrainedShapesOnlyInOutputOperationInput], typing.Union[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput, typing.Awaitable[constraints.output.ConstrainedShapesOnlyInOutputOperationOutput]]]]) -> None:
  149         -
        """
  150         -
        Method to register `constrained_shapes_only_in_output_operation` Python implementation inside the handlers map.
  151         -
        It can be used as a function decorator in Python.
  152         -
        """
  153         -
        ...
  154         -
  155         -
  156         -
    def constrained_shapes_operation(self, func: typing.Union[typing.Callable[[constraints.input.ConstrainedShapesOperationInput, Ctx], typing.Union[constraints.output.ConstrainedShapesOperationOutput, typing.Awaitable[constraints.output.ConstrainedShapesOperationOutput]]], typing.Callable[[constraints.input.ConstrainedShapesOperationInput], typing.Union[constraints.output.ConstrainedShapesOperationOutput, typing.Awaitable[constraints.output.ConstrainedShapesOperationOutput]]]]) -> None:
  157         -
        """
  158         -
        Method to register `constrained_shapes_operation` Python implementation inside the handlers map.
  159         -
        It can be used as a function decorator in Python.
  160         -
        """
  161         -
        ...
  162         -
  163         -
  164         -
    def context(self, context: Ctx) -> None:
  165         -
        """
  166         -
        Register a context object that will be shared between handlers.
  167         -
        """
  168         -
        ...
  169         -
  170         -
  171         -
    def event_streams_operation(self, func: typing.Union[typing.Callable[[constraints.input.EventStreamsOperationInput, Ctx], typing.Union[constraints.output.EventStreamsOperationOutput, typing.Awaitable[constraints.output.EventStreamsOperationOutput]]], typing.Callable[[constraints.input.EventStreamsOperationInput], typing.Union[constraints.output.EventStreamsOperationOutput, typing.Awaitable[constraints.output.EventStreamsOperationOutput]]]]) -> None:
  172         -
        """
  173         -
        Method to register `event_streams_operation` Python implementation inside the handlers map.
  174         -
        It can be used as a function decorator in Python.
  175         -
        """
  176         -
        ...
  177         -
  178         -
  179         -
    def http_prefix_headers_targeting_length_map_operation(self, func: typing.Union[typing.Callable[[constraints.input.HttpPrefixHeadersTargetingLengthMapOperationInput, Ctx], typing.Union[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput, typing.Awaitable[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput]]], typing.Callable[[constraints.input.HttpPrefixHeadersTargetingLengthMapOperationInput], typing.Union[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput, typing.Awaitable[constraints.output.HttpPrefixHeadersTargetingLengthMapOperationOutput]]]]) -> None:
  180         -
        """
  181         -
        Method to register `http_prefix_headers_targeting_length_map_operation` Python implementation inside the handlers map.
  182         -
        It can be used as a function decorator in Python.
  183         -
        """
  184         -
        ...
  185         -
  186         -
  187         -
    def middleware(self, func: typing.Callable[[constraints.middleware.Request, typing.Callable[[constraints.middleware.Request], typing.Awaitable[constraints.middleware.Response]]], typing.Awaitable[constraints.middleware.Response]]) -> None:
  188         -
        """
  189         -
        Register a Python function to be executed inside a Tower middleware layer.
  190         -
        """
  191         -
        ...
  192         -
  193         -
  194         -
    def non_streaming_blob_operation(self, func: typing.Union[typing.Callable[[constraints.input.NonStreamingBlobOperationInput, Ctx], typing.Union[constraints.output.NonStreamingBlobOperationOutput, typing.Awaitable[constraints.output.NonStreamingBlobOperationOutput]]], typing.Callable[[constraints.input.NonStreamingBlobOperationInput], typing.Union[constraints.output.NonStreamingBlobOperationOutput, typing.Awaitable[constraints.output.NonStreamingBlobOperationOutput]]]]) -> None:
  195         -
        """
  196         -
        Method to register `non_streaming_blob_operation` Python implementation inside the handlers map.
  197         -
        It can be used as a function decorator in Python.
  198         -
        """
  199         -
        ...
  200         -
  201         -
  202         -
    def query_params_targeting_length_map_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingLengthMapOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingLengthMapOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingLengthMapOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingLengthMapOperationInput], typing.Union[constraints.output.QueryParamsTargetingLengthMapOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingLengthMapOperationOutput]]]]) -> None:
  203         -
        """
  204         -
        Method to register `query_params_targeting_length_map_operation` Python implementation inside the handlers map.
  205         -
        It can be used as a function decorator in Python.
  206         -
        """
  207         -
        ...
  208         -
  209         -
  210         -
    def query_params_targeting_map_of_enum_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfEnumStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfEnumStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfEnumStringOperationOutput]]]]) -> None:
  211         -
        """
  212         -
        Method to register `query_params_targeting_map_of_enum_string_operation` Python implementation inside the handlers map.
  213         -
        It can be used as a function decorator in Python.
  214         -
        """
  215         -
        ...
  216         -
  217         -
  218         -
    def query_params_targeting_map_of_length_list_of_pattern_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput]]]]) -> None:
  219         -
        """
  220         -
        Method to register `query_params_targeting_map_of_length_list_of_pattern_string_operation` Python implementation inside the handlers map.
  221         -
        It can be used as a function decorator in Python.
  222         -
        """
  223         -
        ...
  224         -
  225         -
  226         -
    def query_params_targeting_map_of_length_pattern_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfLengthPatternStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfLengthPatternStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfLengthPatternStringOperationOutput]]]]) -> None:
  227         -
        """
  228         -
        Method to register `query_params_targeting_map_of_length_pattern_string_operation` Python implementation inside the handlers map.
  229         -
        It can be used as a function decorator in Python.
  230         -
        """
  231         -
        ...
  232         -
  233         -
  234         -
    def query_params_targeting_map_of_length_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfLengthStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfLengthStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfLengthStringOperationOutput]]]]) -> None:
  235         -
        """
  236         -
        Method to register `query_params_targeting_map_of_length_string_operation` Python implementation inside the handlers map.
  237         -
        It can be used as a function decorator in Python.
  238         -
        """
  239         -
        ...
  240         -
  241         -
  242         -
    def query_params_targeting_map_of_list_of_enum_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfEnumStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfEnumStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfEnumStringOperationOutput]]]]) -> None:
  243         -
        """
  244         -
        Method to register `query_params_targeting_map_of_list_of_enum_string_operation` Python implementation inside the handlers map.
  245         -
        It can be used as a function decorator in Python.
  246         -
        """
  247         -
        ...
  248         -
  249         -
  250         -
    def query_params_targeting_map_of_list_of_length_pattern_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput]]]]) -> None:
  251         -
        """
  252         -
        Method to register `query_params_targeting_map_of_list_of_length_pattern_string_operation` Python implementation inside the handlers map.
  253         -
        It can be used as a function decorator in Python.
  254         -
        """
  255         -
        ...
  256         -
  257         -
  258         -
    def query_params_targeting_map_of_list_of_length_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfLengthStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfLengthStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfLengthStringOperationOutput]]]]) -> None:
  259         -
        """
  260         -
        Method to register `query_params_targeting_map_of_list_of_length_string_operation` Python implementation inside the handlers map.
  261         -
        It can be used as a function decorator in Python.
  262         -
        """
  263         -
        ...
  264         -
  265         -
  266         -
    def query_params_targeting_map_of_list_of_pattern_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfPatternStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfListOfPatternStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfListOfPatternStringOperationOutput]]]]) -> None:
  267         -
        """
  268         -
        Method to register `query_params_targeting_map_of_list_of_pattern_string_operation` Python implementation inside the handlers map.
  269         -
        It can be used as a function decorator in Python.
  270         -
        """
  271         -
        ...
  272         -
  273         -
  274         -
    def query_params_targeting_map_of_pattern_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfPatternStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfPatternStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfPatternStringOperationOutput]]]]) -> None:
  275         -
        """
  276         -
        Method to register `query_params_targeting_map_of_pattern_string_operation` Python implementation inside the handlers map.
  277         -
        It can be used as a function decorator in Python.
  278         -
        """
  279         -
        ...
  280         -
  281         -
  282         -
    def query_params_targeting_map_of_set_of_length_string_operation(self, func: typing.Union[typing.Callable[[constraints.input.QueryParamsTargetingMapOfSetOfLengthStringOperationInput, Ctx], typing.Union[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput]]], typing.Callable[[constraints.input.QueryParamsTargetingMapOfSetOfLengthStringOperationInput], typing.Union[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput, typing.Awaitable[constraints.output.QueryParamsTargetingMapOfSetOfLengthStringOperationOutput]]]]) -> None:
  283         -
        """
  284         -
        Method to register `query_params_targeting_map_of_set_of_length_string_operation` Python implementation inside the handlers map.
  285         -
        It can be used as a function decorator in Python.
  286         -
        """
  287         -
        ...
  288         -
  289         -
  290         -
    def run(self, address: typing.Optional[str] = ..., port: typing.Optional[int] = ..., backlog: typing.Optional[int] = ..., workers: typing.Optional[int] = ..., tls: typing.Optional[constraints.tls.TlsConfig] = ...) -> None:
  291         -
        """
  292         -
        Main entrypoint: start the server on multiple workers.
  293         -
        """
  294         -
        ...
  295         -
  296         -
  297         -
    def run_lambda(self) -> None:
  298         -
        """
  299         -
        Lambda entrypoint: start the server on Lambda.
  300         -
        """
  301         -
        ...
  302         -
  303         -
  304         -
    def start_worker(self) -> None:
  305         -
        """
  306         -
        Build the service and start a single worker.
  307         -
        """
  308         -
        ...
  309         -
  310         -
  311         -
    def streaming_blob_operation(self, func: typing.Union[typing.Callable[[constraints.input.StreamingBlobOperationInput, Ctx], typing.Union[constraints.output.StreamingBlobOperationOutput, typing.Awaitable[constraints.output.StreamingBlobOperationOutput]]], typing.Callable[[constraints.input.StreamingBlobOperationInput], typing.Union[constraints.output.StreamingBlobOperationOutput, typing.Awaitable[constraints.output.StreamingBlobOperationOutput]]]]) -> None:
  312         -
        """
  313         -
        Method to register `streaming_blob_operation` Python implementation inside the handlers map.
  314         -
        It can be used as a function decorator in Python.
  315         -
        """
  316         -
        ...
  317         -
  318         -
  319         -
    def __init__(self) -> None:
  320         -
        ...
  321         -
  322         -
  323         -
CODEGEN_VERSION: str = ...

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

@@ -1,0 +143,0 @@
    1         -
import typing
    2         -
    3         -
class ClientApplication:
    4         -
    """
    5         -
    AWS Mobile SDK client fields.
    6         -
    """
    7         -
    8         -
    app_package_name: str
    9         -
    """
   10         -
    The package name for the mobile application invoking the function
   11         -
    """
   12         -
   13         -
    app_title: str
   14         -
    """
   15         -
    The app title for the mobile app as registered with AWS' mobile services.
   16         -
    """
   17         -
   18         -
    app_version_code: str
   19         -
    """
   20         -
    The app version code.
   21         -
    """
   22         -
   23         -
    app_version_name: str
   24         -
    """
   25         -
    The version name of the application as registered with AWS' mobile services.
   26         -
    """
   27         -
   28         -
    installation_id: str
   29         -
    """
   30         -
    The mobile app installation id
   31         -
    """
   32         -
   33         -
class ClientContext:
   34         -
    """
   35         -
    Client context sent by the AWS Mobile SDK.
   36         -
    """
   37         -
   38         -
    client: ClientApplication
   39         -
    """
   40         -
    Information about the mobile application invoking the function.
   41         -
    """
   42         -
   43         -
    custom: typing.Dict[str, str]
   44         -
    """
   45         -
    Custom properties attached to the mobile event context.
   46         -
    """
   47         -
   48         -
    environment: typing.Dict[str, str]
   49         -
    """
   50         -
    Environment settings from the mobile client.
   51         -
    """
   52         -
   53         -
class CognitoIdentity:
   54         -
    """
   55         -
    Cognito identity information sent with the event
   56         -
    """
   57         -
   58         -
    identity_id: str
   59         -
    """
   60         -
    The unique identity id for the Cognito credentials invoking the function.
   61         -
    """
   62         -
   63         -
    identity_pool_id: str
   64         -
    """
   65         -
    The identity pool id the caller is "registered" with.
   66         -
    """
   67         -
   68         -
class Config:
   69         -
    """
   70         -
    Configuration derived from environment variables.
   71         -
    """
   72         -
   73         -
    function_name: str
   74         -
    """
   75         -
    The name of the function.
   76         -
    """
   77         -
   78         -
    log_group: str
   79         -
    """
   80         -
    The name of the Amazon CloudWatch Logs group for the function.
   81         -
    """
   82         -
   83         -
    log_stream: str
   84         -
    """
   85         -
    The name of the Amazon CloudWatch Logs stream for the function.
   86         -
    """
   87         -
   88         -
    memory: int
   89         -
    """
   90         -
    The amount of memory available to the function in MB.
   91         -
    """
   92         -
   93         -
    version: str
   94         -
    """
   95         -
    The version of the function being executed.
   96         -
    """
   97         -
   98         -
class LambdaContext:
   99         -
    """
  100         -
    The Lambda function execution context. The values in this struct
  101         -
    are populated using the [Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html)
  102         -
    and the headers returned by the poll request to the Runtime APIs.
  103         -
    """
  104         -
  105         -
    client_context: typing.Optional[ClientContext]
  106         -
    """
  107         -
    The client context object sent by the AWS mobile SDK. This field is
  108         -
    empty unless the function is invoked using an AWS mobile SDK.
  109         -
    """
  110         -
  111         -
    deadline: int
  112         -
    """
  113         -
    The execution deadline for the current invocation in milliseconds.
  114         -
    """
  115         -
  116         -
    env_config: Config
  117         -
    """
  118         -
    Lambda function configuration from the local environment variables.
  119         -
    Includes information such as the function name, memory allocation,
  120         -
    version, and log streams.
  121         -
    """
  122         -
  123         -
    identity: typing.Optional[CognitoIdentity]
  124         -
    """
  125         -
    The Cognito identity that invoked the function. This field is empty
  126         -
    unless the invocation request to the Lambda APIs was made using AWS
  127         -
    credentials issues by Amazon Cognito Identity Pools.
  128         -
    """
  129         -
  130         -
    invoked_function_arn: str
  131         -
    """
  132         -
    The ARN of the Lambda function being invoked.
  133         -
    """
  134         -
  135         -
    request_id: str
  136         -
    """
  137         -
    The AWS request ID generated by the Lambda service.
  138         -
    """
  139         -
  140         -
    xray_trace_id: typing.Optional[str]
  141         -
    """
  142         -
    The X-Ray trace ID for the current invocation.
  143         -
    """

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

@@ -1,0 +35,0 @@
    1         -
import constraints.model
    2         -
import typing
    3         -
    4         -
class EventStreamErrorMessage(Exception):
    5         -
    message_content: typing.Optional[str]
    6         -
    7         -
    def __init__(self, message_content: typing.Optional[str] = ...) -> None:
    8         -
        ...
    9         -
   10         -
   11         -
class InternalServerError(Exception):
   12         -
    message: str
   13         -
   14         -
    def __init__(self, message: str) -> None:
   15         -
        ...
   16         -
   17         -
   18         -
class ValidationException(Exception):
   19         -
    """
   20         -
    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.
   21         -
    """
   22         -
   23         -
    field_list: typing.Optional[typing.List[constraints.model.ValidationExceptionField]]
   24         -
    """
   25         -
    A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   26         -
    """
   27         -
   28         -
    message: str
   29         -
    """
   30         -
    A summary of the validation failure.
   31         -
    """
   32         -
   33         -
    def __init__(self, message: str, field_list: typing.Optional[typing.List[constraints.model.ValidationExceptionField]] = ...) -> None:
   34         -
        ...
   35         -

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

@@ -1,0 +225,0 @@
    1         -
import constraints.model
    2         -
import constraints.types
    3         -
import typing
    4         -
    5         -
class ConstrainedHttpBoundShapesOperationInput:
    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 ConstrainedHttpPayloadBoundShapeOperationInput:
   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 ConstrainedRecursiveShapesOperationInput:
  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 ConstrainedShapesOnlyInOutputOperationInput:
  111         -
    def __init__(self) -> None:
  112         -
        ...
  113         -
  114         -
  115         -
class ConstrainedShapesOperationInput:
  116         -
    con_a: constraints.model.ConA
  117         -
  118         -
    def __init__(self, con_a: constraints.model.ConA) -> None:
  119         -
        ...
  120         -
  121         -
  122         -
class EventStreamsOperationInput:
  123         -
    events: typing.AsyncIterator[constraints.model.Event]
  124         -
  125         -
    def __init__(self, events: typing.AsyncIterator[constraints.model.Event]) -> None:
  126         -
        ...
  127         -
  128         -
  129         -
class HttpPrefixHeadersTargetingLengthMapOperationInput:
  130         -
    length_map: typing.Optional[typing.Dict[str, str]]
  131         -
  132         -
    def __init__(self, length_map: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  133         -
        ...
  134         -
  135         -
  136         -
class NonStreamingBlobOperationInput:
  137         -
    non_streaming_blob: typing.Optional[constraints.types.Blob]
  138         -
  139         -
    def __init__(self, non_streaming_blob: typing.Optional[constraints.types.Blob] = ...) -> None:
  140         -
        ...
  141         -
  142         -
  143         -
class QueryParamsTargetingLengthMapOperationInput:
  144         -
    length_map: typing.Optional[typing.Dict[str, str]]
  145         -
  146         -
    def __init__(self, length_map: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  147         -
        ...
  148         -
  149         -
  150         -
class QueryParamsTargetingMapOfEnumStringOperationInput:
  151         -
    map_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, constraints.model.EnumString]]
  152         -
  153         -
    def __init__(self, map_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, constraints.model.EnumString]] = ...) -> None:
  154         -
        ...
  155         -
  156         -
  157         -
class QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput:
  158         -
    map_of_length_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  159         -
  160         -
    def __init__(self, map_of_length_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  161         -
        ...
  162         -
  163         -
  164         -
class QueryParamsTargetingMapOfLengthPatternStringOperationInput:
  165         -
    map_of_length_pattern_string: typing.Optional[typing.Dict[str, str]]
  166         -
  167         -
    def __init__(self, map_of_length_pattern_string: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  168         -
        ...
  169         -
  170         -
  171         -
class QueryParamsTargetingMapOfLengthStringOperationInput:
  172         -
    map_of_length_string: typing.Optional[typing.Dict[str, str]]
  173         -
  174         -
    def __init__(self, map_of_length_string: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  175         -
        ...
  176         -
  177         -
  178         -
class QueryParamsTargetingMapOfListOfEnumStringOperationInput:
  179         -
    map_of_list_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, typing.List[constraints.model.EnumString]]]
  180         -
  181         -
    def __init__(self, map_of_list_of_enum_string: typing.Optional[typing.Dict[constraints.model.EnumString, typing.List[constraints.model.EnumString]]] = ...) -> None:
  182         -
        ...
  183         -
  184         -
  185         -
class QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput:
  186         -
    map_of_length_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  187         -
  188         -
    def __init__(self, map_of_length_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  189         -
        ...
  190         -
  191         -
  192         -
class QueryParamsTargetingMapOfListOfLengthStringOperationInput:
  193         -
    map_of_list_of_length_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  194         -
  195         -
    def __init__(self, map_of_list_of_length_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  196         -
        ...
  197         -
  198         -
  199         -
class QueryParamsTargetingMapOfListOfPatternStringOperationInput:
  200         -
    map_of_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]]
  201         -
  202         -
    def __init__(self, map_of_list_of_pattern_string: typing.Optional[typing.Dict[str, typing.List[str]]] = ...) -> None:
  203         -
        ...
  204         -
  205         -
  206         -
class QueryParamsTargetingMapOfPatternStringOperationInput:
  207         -
    map_of_pattern_string: typing.Optional[typing.Dict[str, str]]
  208         -
  209         -
    def __init__(self, map_of_pattern_string: typing.Optional[typing.Dict[str, str]] = ...) -> None:
  210         -
        ...
  211         -
  212         -
  213         -
class QueryParamsTargetingMapOfSetOfLengthStringOperationInput:
  214         -
    map_of_set_of_length_string: typing.Optional[typing.Dict[str, typing.Set[str]]]
  215         -
  216         -
    def __init__(self, map_of_set_of_length_string: typing.Optional[typing.Dict[str, typing.Set[str]]] = ...) -> None:
  217         -
        ...
  218         -
  219         -
  220         -
class StreamingBlobOperationInput:
  221         -
    streaming_blob: constraints.types.ByteStream
  222         -
  223         -
    def __init__(self, streaming_blob: constraints.types.ByteStream) -> None:
  224         -
        ...
  225         -

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

@@ -1,0 +26,0 @@
    1         -
import pathlib
    2         -
import typing
    3         -
    4         -
class TracingHandler:
    5         -
    """
    6         -
    Modifies the Python `logging` module to deliver its log messages using [tracing::Subscriber] events.
    7         -
    8         -
    To achieve this goal, the following changes are made to the module:
    9         -
    - A new builtin function `logging.py_tracing_event` transcodes `logging.LogRecord`s to `tracing::Event`s. This function
   10         -
      is not exported in `logging.__all__`, as it is not intended to be called directly.
   11         -
    - A new class `logging.TracingHandler` provides a `logging.Handler` that delivers all records to `python_tracing`.
   12         -
    """
   13         -
   14         -
    def handler(self) -> typing.Any:
   15         -
        ...
   16         -
   17         -
   18         -
    def __init__(self, level: typing.Optional[int] = ..., logfile: typing.Optional[pathlib.Path] = ..., format: typing.Optional[typing.Literal['compact', 'pretty', 'json']] = ...) -> None:
   19         -
        ...
   20         -
   21         -
   22         -
def py_tracing_event() -> None:
   23         -
    """
   24         -
    Consumes a Python `logging.LogRecord` and emits a Rust [tracing::Event] instead.
   25         -
    """
   26         -
    ...

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

@@ -1,0 +78,0 @@
    1         -
import typing
    2         -
    3         -
class MiddlewareException(Exception):
    4         -
    """
    5         -
    Exception that can be thrown from a Python middleware.
    6         -
    7         -
    It allows to specify a message and HTTP status code and implementing protocol specific capabilities
    8         -
    to build a [aws_smithy_http_server::response::Response] from it.
    9         -
    """
   10         -
   11         -
    message: str
   12         -
   13         -
    status_code: int
   14         -
   15         -
    def __init__(self, message: str, status_code: typing.Optional[int] = ...) -> None:
   16         -
        ...
   17         -
   18         -
   19         -
class Request:
   20         -
    """
   21         -
    Python-compatible [Request] object.
   22         -
    """
   23         -
   24         -
    body: typing.Awaitable[bytes]
   25         -
    """
   26         -
    Return the HTTP body of this request.
   27         -
    Note that this is a costly operation because the whole request body is cloned.
   28         -
    """
   29         -
   30         -
    headers: typing.MutableMapping[str, str]
   31         -
    """
   32         -
    Return the HTTP headers of this request.
   33         -
    """
   34         -
   35         -
    method: str
   36         -
    """
   37         -
    Return the HTTP method of this request.
   38         -
    """
   39         -
   40         -
    uri: str
   41         -
    """
   42         -
    Return the URI of this request.
   43         -
    """
   44         -
   45         -
    version: str
   46         -
    """
   47         -
    Return the HTTP version of this request.
   48         -
    """
   49         -
   50         -
class Response:
   51         -
    """
   52         -
    Python-compatible [Response] object.
   53         -
    """
   54         -
   55         -
    body: typing.Awaitable[bytes]
   56         -
    """
   57         -
    Return the HTTP body of this response.
   58         -
    Note that this is a costly operation because the whole response body is cloned.
   59         -
    """
   60         -
   61         -
    headers: typing.MutableMapping[str, str]
   62         -
    """
   63         -
    Return the HTTP headers of this response.
   64         -
    """
   65         -
   66         -
    status: int
   67         -
    """
   68         -
    Return the HTTP status of this response.
   69         -
    """
   70         -
   71         -
    version: str
   72         -
    """
   73         -
    Return the HTTP version of this response.
   74         -
    """
   75         -
   76         -
    def __init__(self, status: int, headers: typing.Optional[typing.Dict[str, str]] = ..., body: typing.Optional[bytes] = ...) -> None:
   77         -
        ...
   78         -

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

@@ -1,0 +400,0 @@
    1         -
import constraints.model
    2         -
import constraints.types
    3         -
import typing
    4         -
    5         -
class ConA:
    6         -
    con_b: constraints.model.ConB
    7         -
    8         -
    con_b_list: typing.Optional[typing.List[typing.List[constraints.model.ConB]]]
    9         -
   10         -
    con_b_map: typing.Optional[typing.Dict[str, str]]
   11         -
   12         -
    con_b_set: typing.Optional[typing.List[typing.Set[str]]]
   13         -
   14         -
    constrained_union: typing.Optional[constraints.model.ConstrainedUnion]
   15         -
    """
   16         -
    A union with constrained members.
   17         -
    """
   18         -
   19         -
    enum_string: typing.Optional[constraints.model.EnumString]
   20         -
   21         -
    fixed_length_blob: typing.Optional[constraints.types.Blob]
   22         -
   23         -
    fixed_length_string: typing.Optional[str]
   24         -
   25         -
    fixed_value_byte: int
   26         -
   27         -
    fixed_value_integer: int
   28         -
   29         -
    fixed_value_long: int
   30         -
   31         -
    fixed_value_short: int
   32         -
   33         -
    length_blob: typing.Optional[constraints.types.Blob]
   34         -
   35         -
    length_length_pattern_string: typing.Optional[str]
   36         -
   37         -
    length_list: typing.Optional[typing.List[str]]
   38         -
   39         -
    length_list_of_pattern_string: typing.Optional[typing.List[str]]
   40         -
   41         -
    length_map: typing.Optional[typing.Dict[str, str]]
   42         -
   43         -
    length_set_of_pattern_string: typing.Optional[typing.Set[str]]
   44         -
   45         -
    length_string: typing.Optional[str]
   46         -
   47         -
    list_of_length_blob: typing.Optional[typing.List[constraints.types.Blob]]
   48         -
   49         -
    list_of_length_pattern_string: typing.Optional[typing.List[str]]
   50         -
   51         -
    list_of_length_string: typing.Optional[typing.List[str]]
   52         -
   53         -
    list_of_pattern_string: typing.Optional[typing.List[str]]
   54         -
   55         -
    list_of_range_byte: typing.Optional[typing.List[int]]
   56         -
   57         -
    list_of_range_integer: typing.Optional[typing.List[int]]
   58         -
   59         -
    list_of_range_long: typing.Optional[typing.List[int]]
   60         -
   61         -
    list_of_range_short: typing.Optional[typing.List[int]]
   62         -
   63         -
    map_of_length_blob: typing.Optional[typing.Dict[str, constraints.types.Blob]]
   64         -
   65         -
    map_of_length_pattern_string: typing.Optional[typing.Dict[str, str]]
   66         -
   67         -
    map_of_length_string: typing.Optional[typing.Dict[str, str]]
   68         -
   69         -
    map_of_map_of_list_of_list_of_con_b: typing.Optional[typing.Dict[str, typing.Dict[str, typing.List[typing.List[constraints.model.ConB]]]]]
   70         -
   71         -
    map_of_pattern_string: typing.Optional[typing.Dict[str, str]]
   72         -
   73         -
    map_of_range_byte: typing.Optional[typing.Dict[str, int]]
   74         -
   75         -
    map_of_range_integer: typing.Optional[typing.Dict[str, int]]
   76         -
   77         -
    map_of_range_long: typing.Optional[typing.Dict[str, int]]
   78         -
   79         -
    map_of_range_short: typing.Optional[typing.Dict[str, int]]
   80         -
   81         -
    max_length_blob: typing.Optional[constraints.types.Blob]
   82         -
   83         -
    max_length_string: typing.Optional[str]
   84         -
   85         -
    max_range_byte: int
   86         -
   87         -
    max_range_integer: int
   88         -
   89         -
    max_range_long: int
   90         -
   91         -
    max_range_short: int
   92         -
   93         -
    min_length_blob: typing.Optional[constraints.types.Blob]
   94         -
   95         -
    min_length_string: typing.Optional[str]
   96         -
   97         -
    min_range_byte: int
   98         -
   99         -
    min_range_integer: int
  100         -
  101         -
    min_range_long: int
  102         -
  103         -
    min_range_short: int
  104         -
  105         -
    non_streaming_blob: typing.Optional[constraints.types.Blob]
  106         -
  107         -
    opt_con_b: typing.Optional[constraints.model.ConB]
  108         -
  109         -
    pattern_string: typing.Optional[str]
  110         -
  111         -
    range_byte: int
  112         -
  113         -
    range_integer: int
  114         -
  115         -
    range_long: int
  116         -
  117         -
    range_short: int
  118         -
  119         -
    sensitive_length_list: typing.Optional[typing.List[constraints.model.SensitiveStructure]]
  120         -
  121         -
    set_of_length_pattern_string: typing.Optional[typing.Set[str]]
  122         -
  123         -
    set_of_length_string: typing.Optional[typing.Set[str]]
  124         -
  125         -
    set_of_pattern_string: typing.Optional[typing.Set[str]]
  126         -
  127         -
    set_of_range_byte: typing.Optional[typing.List[int]]
  128         -
  129         -
    set_of_range_integer: typing.Optional[typing.List[int]]
  130         -
  131         -
    set_of_range_long: typing.Optional[typing.List[int]]
  132         -
  133         -
    set_of_range_short: typing.Optional[typing.List[int]]
  134         -
  135         -
    sparse_length_list: typing.Optional[typing.List[typing.Optional[str]]]
  136         -
  137         -
    sparse_length_map: typing.Optional[typing.Dict[str, typing.Optional[str]]]
  138         -
  139         -
    sparse_list: typing.Optional[typing.List[typing.Optional[str]]]
  140         -
  141         -
    sparse_map: typing.Optional[typing.Dict[str, typing.Optional[typing.List[str]]]]
  142         -
  143         -
    def __init__(self, con_b: constraints.model.ConB, opt_con_b: typing.Optional[constraints.model.ConB] = ..., length_string: typing.Optional[str] = ..., min_length_string: typing.Optional[str] = ..., max_length_string: typing.Optional[str] = ..., fixed_length_string: typing.Optional[str] = ..., length_blob: typing.Optional[constraints.types.Blob] = ..., min_length_blob: typing.Optional[constraints.types.Blob] = ..., max_length_blob: typing.Optional[constraints.types.Blob] = ..., fixed_length_blob: typing.Optional[constraints.types.Blob] = ..., range_integer: int, min_range_integer: int, max_range_integer: int, fixed_value_integer: int, range_short: int, min_range_short: int, max_range_short: int, fixed_value_short: int, range_long: int, min_range_long: int, max_range_long: int, fixed_value_long: int, range_byte: int, min_range_byte: int, max_range_byte: int, fixed_value_byte: int, con_b_list: typing.Optional[typing.List[typing.List[constraints.model.ConB]]] = ..., length_list: typing.Optional[typing.List[str]] = ..., sensitive_length_list: typing.Optional[typing.List[constraints.model.SensitiveStructure]] = ..., con_b_set: typing.Optional[typing.List[typing.Set[str]]] = ..., con_b_map: typing.Optional[typing.Dict[str, str]] = ..., length_map: typing.Optional[typing.Dict[str, str]] = ..., map_of_map_of_list_of_list_of_con_b: typing.Optional[typing.Dict[str, typing.Dict[str, typing.List[typing.List[constraints.model.ConB]]]]] = ..., sparse_map: typing.Optional[typing.Dict[str, typing.Optional[typing.List[str]]]] = ..., sparse_list: typing.Optional[typing.List[typing.Optional[str]]] = ..., sparse_length_map: typing.Optional[typing.Dict[str, typing.Optional[str]]] = ..., sparse_length_list: typing.Optional[typing.List[typing.Optional[str]]] = ..., constrained_union: typing.Optional[constraints.model.ConstrainedUnion] = ..., enum_string: typing.Optional[constraints.model.EnumString] = ..., list_of_length_string: typing.Optional[typing.List[str]] = ..., set_of_length_string: typing.Optional[typing.Set[str]] = ..., map_of_length_string: typing.Optional[typing.Dict[str, str]] = ..., list_of_length_blob: typing.Optional[typing.List[constraints.types.Blob]] = ..., map_of_length_blob: typing.Optional[typing.Dict[str, constraints.types.Blob]] = ..., list_of_range_integer: typing.Optional[typing.List[int]] = ..., set_of_range_integer: typing.Optional[typing.List[int]] = ..., map_of_range_integer: typing.Optional[typing.Dict[str, int]] = ..., list_of_range_short: typing.Optional[typing.List[int]] = ..., set_of_range_short: typing.Optional[typing.List[int]] = ..., map_of_range_short: typing.Optional[typing.Dict[str, int]] = ..., list_of_range_long: typing.Optional[typing.List[int]] = ..., set_of_range_long: typing.Optional[typing.List[int]] = ..., map_of_range_long: typing.Optional[typing.Dict[str, int]] = ..., list_of_range_byte: typing.Optional[typing.List[int]] = ..., set_of_range_byte: typing.Optional[typing.List[int]] = ..., map_of_range_byte: typing.Optional[typing.Dict[str, int]] = ..., non_streaming_blob: typing.Optional[constraints.types.Blob] = ..., pattern_string: typing.Optional[str] = ..., map_of_pattern_string: typing.Optional[typing.Dict[str, str]] = ..., list_of_pattern_string: typing.Optional[typing.List[str]] = ..., set_of_pattern_string: typing.Optional[typing.Set[str]] = ..., length_length_pattern_string: typing.Optional[str] = ..., map_of_length_pattern_string: typing.Optional[typing.Dict[str, str]] = ..., list_of_length_pattern_string: typing.Optional[typing.List[str]] = ..., set_of_length_pattern_string: typing.Optional[typing.Set[str]] = ..., length_list_of_pattern_string: typing.Optional[typing.List[str]] = ..., length_set_of_pattern_string: typing.Optional[typing.Set[str]] = ...) -> None:
  144         -
        ...
  145         -
  146         -
  147         -
class ConB:
  148         -
    int: int
  149         -
  150         -
    nice: str
  151         -
  152         -
    opt_int: typing.Optional[int]
  153         -
  154         -
    opt_nice: typing.Optional[str]
  155         -
  156         -
    def __init__(self, nice: str, int: int, opt_nice: typing.Optional[str] = ..., opt_int: typing.Optional[int] = ...) -> None:
  157         -
        ...
  158         -
  159         -
  160         -
class ConstrainedUnion:
  161         -
    def as_con_b_list(self) -> typing.List[typing.List[constraints.model.ConB]]:
  162         -
        """
  163         -
        Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
  164         -
        """
  165         -
        ...
  166         -
  167         -
  168         -
    def as_con_b_map(self) -> typing.Dict[str, str]:
  169         -
        """
  170         -
        Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
  171         -
        """
  172         -
        ...
  173         -
  174         -
  175         -
    def as_con_b_set(self) -> typing.List[typing.Set[str]]:
  176         -
        """
  177         -
        Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
  178         -
        """
  179         -
        ...
  180         -
  181         -
  182         -
    def as_constrained_structure(self) -> constraints.model.ConB:
  183         -
        """
  184         -
        Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
  185         -
        """
  186         -
        ...
  187         -
  188         -
  189         -
    def as_enum_string(self) -> constraints.model.EnumString:
  190         -
        """
  191         -
        Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
  192         -
        """
  193         -
        ...
  194         -
  195         -
  196         -
    def as_length_string(self) -> str:
  197         -
        """
  198         -
        Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
  199         -
        """
  200         -
        ...
  201         -
  202         -
  203         -
    @staticmethod
  204         -
    def con_b_list(data: typing.List[typing.List[constraints.model.ConB]]) -> ConstrainedUnion:
  205         -
        """
  206         -
        Creates a new union instance of [`ConBList`](crate::model::ConstrainedUnion::ConBList)
  207         -
        """
  208         -
        ...
  209         -
  210         -
  211         -
    @staticmethod
  212         -
    def con_b_map(data: typing.Dict[str, str]) -> ConstrainedUnion:
  213         -
        """
  214         -
        Creates a new union instance of [`ConBMap`](crate::model::ConstrainedUnion::ConBMap)
  215         -
        """
  216         -
        ...
  217         -
  218         -
  219         -
    @staticmethod
  220         -
    def con_b_set(data: typing.List[typing.Set[str]]) -> ConstrainedUnion:
  221         -
        """
  222         -
        Creates a new union instance of [`ConBSet`](crate::model::ConstrainedUnion::ConBSet)
  223         -
        """
  224         -
        ...
  225         -
  226         -
  227         -
    @staticmethod
  228         -
    def constrained_structure(data: constraints.model.ConB) -> ConstrainedUnion:
  229         -
        """
  230         -
        Creates a new union instance of [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure)
  231         -
        """
  232         -
        ...
  233         -
  234         -
  235         -
    @staticmethod
  236         -
    def enum_string(data: constraints.model.EnumString) -> ConstrainedUnion:
  237         -
        """
  238         -
        Creates a new union instance of [`EnumString`](crate::model::ConstrainedUnion::EnumString)
  239         -
        """
  240         -
        ...
  241         -
  242         -
  243         -
    def is_con_b_list(self) -> bool:
  244         -
        """
  245         -
        Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
  246         -
        """
  247         -
        ...
  248         -
  249         -
  250         -
    def is_con_b_map(self) -> bool:
  251         -
        """
  252         -
        Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
  253         -
        """
  254         -
        ...
  255         -
  256         -
  257         -
    def is_con_b_set(self) -> bool:
  258         -
        """
  259         -
        Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
  260         -
        """
  261         -
        ...
  262         -
  263         -
  264         -
    def is_constrained_structure(self) -> bool:
  265         -
        """
  266         -
        Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
  267         -
        """
  268         -
        ...
  269         -
  270         -
  271         -
    def is_enum_string(self) -> bool:
  272         -
        """
  273         -
        Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
  274         -
        """
  275         -
        ...
  276         -
  277         -
  278         -
    def is_length_string(self) -> bool:
  279         -
        """
  280         -
        Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
  281         -
        """
  282         -
        ...
  283         -
  284         -
  285         -
    @staticmethod
  286         -
    def length_string(data: str) -> ConstrainedUnion:
  287         -
        """
  288         -
        Creates a new union instance of [`LengthString`](crate::model::ConstrainedUnion::LengthString)
  289         -
        """
  290         -
        ...
  291         -
  292         -
  293         -
class ConstrainedUnionInOutput:
  294         -
    def as_structure(self) -> constraints.model.TransitivelyConstrainedStructureInOutput:
  295         -
        """
  296         -
        Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
  297         -
        """
  298         -
        ...
  299         -
  300         -
  301         -
    def is_structure(self) -> bool:
  302         -
        """
  303         -
        Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
  304         -
        """
  305         -
        ...
  306         -
  307         -
  308         -
    @staticmethod
  309         -
    def structure(data: constraints.model.TransitivelyConstrainedStructureInOutput) -> ConstrainedUnionInOutput:
  310         -
        """
  311         -
        Creates a new union instance of [`Structure`](crate::model::ConstrainedUnionInOutput::Structure)
  312         -
        """
  313         -
        ...
  314         -
  315         -
  316         -
class EnumString:
  317         -
    M256Mega: EnumString
  318         -
  319         -
    T2Micro: EnumString
  320         -
  321         -
    T2Nano: EnumString
  322         -
  323         -
    name: typing.Any
  324         -
  325         -
    value: typing.Any
  326         -
  327         -
class Event:
  328         -
    def as_regular_message(self) -> constraints.model.EventStreamRegularMessage:
  329         -
        """
  330         -
        Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
  331         -
        """
  332         -
        ...
  333         -
  334         -
  335         -
    def is_regular_message(self) -> bool:
  336         -
        """
  337         -
        Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
  338         -
        """
  339         -
        ...
  340         -
  341         -
  342         -
    @staticmethod
  343         -
    def regular_message(data: constraints.model.EventStreamRegularMessage) -> Event:
  344         -
        """
  345         -
        Creates a new union instance of [`RegularMessage`](crate::model::Event::RegularMessage)
  346         -
        """
  347         -
        ...
  348         -
  349         -
  350         -
class EventStreamRegularMessage:
  351         -
    message_content: typing.Optional[str]
  352         -
  353         -
    def __init__(self, message_content: typing.Optional[str] = ...) -> None:
  354         -
        ...
  355         -
  356         -
  357         -
class RecursiveShapesInputOutputNested1:
  358         -
    recursive_member: constraints.model.RecursiveShapesInputOutputNested2
  359         -
  360         -
    def __init__(self, recursive_member: constraints.model.RecursiveShapesInputOutputNested2) -> None:
  361         -
        ...
  362         -
  363         -
  364         -
class RecursiveShapesInputOutputNested2:
  365         -
    recursive_member: typing.Optional[constraints.model.RecursiveShapesInputOutputNested1]
  366         -
  367         -
    def __init__(self, recursive_member: typing.Optional[constraints.model.RecursiveShapesInputOutputNested1] = ...) -> None:
  368         -
        ...
  369         -
  370         -
  371         -
class SensitiveStructure:
  372         -
    def __init__(self) -> None:
  373         -
        ...
  374         -
  375         -
  376         -
class TransitivelyConstrainedStructureInOutput:
  377         -
    length_string: typing.Optional[str]
  378         -
  379         -
    def __init__(self, length_string: typing.Optional[str] = ...) -> None:
  380         -
        ...
  381         -
  382         -
  383         -
class ValidationExceptionField:
  384         -
    """
  385         -
    Describes one specific validation failure for an input member.
  386         -
    """
  387         -
  388         -
    message: str
  389         -
    """
  390         -
    A detailed description of the validation failure.
  391         -
    """
  392         -
  393         -
    path: str
  394         -
    """
  395         -
    A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
  396         -
    """
  397         -
  398         -
    def __init__(self, path: str, message: str) -> None:
  399         -
        ...
  400         -