Server Test Python

Server Test Python

rev. c67de0508e9d33923e47fd7281531eeca95f7996

Files changed:

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/python/json_rpc11/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/json_rpc11/rust-server-codegen-python/python/json_rpc11/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/json_rpc11/rust-server-codegen-python/python/json_rpc11/model/__init__.pyi

@@ -1,0 +326,0 @@
    1         -
import json_rpc11.model
    2         -
import json_rpc11.types
    3         -
import typing
    4         -
    5         -
class ComplexNestedErrorData:
    6         -
    foo: typing.Optional[str]
    7         -
    8         -
    def __init__(self, foo: typing.Optional[str] = ...) -> None:
    9         -
        ...
   10         -
   11         -
   12         -
class EmptyStruct:
   13         -
    def __init__(self) -> None:
   14         -
        ...
   15         -
   16         -
   17         -
class FooEnum:
   18         -
    Bar: FooEnum
   19         -
   20         -
    Baz: FooEnum
   21         -
   22         -
    Foo: FooEnum
   23         -
   24         -
    One: FooEnum
   25         -
   26         -
    Zero: FooEnum
   27         -
   28         -
    name: typing.Any
   29         -
   30         -
    value: typing.Any
   31         -
   32         -
class GreetingStruct:
   33         -
    hi: typing.Optional[str]
   34         -
   35         -
    def __init__(self, hi: typing.Optional[str] = ...) -> None:
   36         -
        ...
   37         -
   38         -
   39         -
class KitchenSink:
   40         -
    blob: typing.Optional[json_rpc11.types.Blob]
   41         -
   42         -
    boolean: typing.Optional[bool]
   43         -
   44         -
    double: typing.Optional[float]
   45         -
   46         -
    empty_struct: typing.Optional[json_rpc11.model.EmptyStruct]
   47         -
   48         -
    float: typing.Optional[float]
   49         -
   50         -
    httpdate_timestamp: typing.Optional[json_rpc11.types.DateTime]
   51         -
   52         -
    integer: typing.Optional[int]
   53         -
   54         -
    iso8601_timestamp: typing.Optional[json_rpc11.types.DateTime]
   55         -
   56         -
    json_value: typing.Optional[str]
   57         -
   58         -
    list_of_lists: typing.Optional[typing.List[typing.List[str]]]
   59         -
   60         -
    list_of_maps_of_strings: typing.Optional[typing.List[typing.Dict[str, str]]]
   61         -
   62         -
    list_of_strings: typing.Optional[typing.List[str]]
   63         -
   64         -
    list_of_structs: typing.Optional[typing.List[json_rpc11.model.SimpleStruct]]
   65         -
   66         -
    long: typing.Optional[int]
   67         -
   68         -
    map_of_lists_of_strings: typing.Optional[typing.Dict[str, typing.List[str]]]
   69         -
   70         -
    map_of_maps: typing.Optional[typing.Dict[str, typing.Dict[str, str]]]
   71         -
   72         -
    map_of_strings: typing.Optional[typing.Dict[str, str]]
   73         -
   74         -
    map_of_structs: typing.Optional[typing.Dict[str, json_rpc11.model.SimpleStruct]]
   75         -
   76         -
    recursive_list: typing.Optional[typing.List[json_rpc11.model.KitchenSink]]
   77         -
   78         -
    recursive_map: typing.Optional[typing.Dict[str, json_rpc11.model.KitchenSink]]
   79         -
   80         -
    recursive_struct: typing.Optional[json_rpc11.model.KitchenSink]
   81         -
   82         -
    simple_struct: typing.Optional[json_rpc11.model.SimpleStruct]
   83         -
   84         -
    string: typing.Optional[str]
   85         -
   86         -
    struct_with_json_name: typing.Optional[json_rpc11.model.StructWithJsonName]
   87         -
   88         -
    timestamp: typing.Optional[json_rpc11.types.DateTime]
   89         -
   90         -
    unix_timestamp: typing.Optional[json_rpc11.types.DateTime]
   91         -
   92         -
    def __init__(self, blob: typing.Optional[json_rpc11.types.Blob] = ..., boolean: typing.Optional[bool] = ..., double: typing.Optional[float] = ..., empty_struct: typing.Optional[json_rpc11.model.EmptyStruct] = ..., float: typing.Optional[float] = ..., httpdate_timestamp: typing.Optional[json_rpc11.types.DateTime] = ..., integer: typing.Optional[int] = ..., iso8601_timestamp: typing.Optional[json_rpc11.types.DateTime] = ..., json_value: typing.Optional[str] = ..., list_of_lists: typing.Optional[typing.List[typing.List[str]]] = ..., list_of_maps_of_strings: typing.Optional[typing.List[typing.Dict[str, str]]] = ..., list_of_strings: typing.Optional[typing.List[str]] = ..., list_of_structs: typing.Optional[typing.List[json_rpc11.model.SimpleStruct]] = ..., long: typing.Optional[int] = ..., map_of_lists_of_strings: typing.Optional[typing.Dict[str, typing.List[str]]] = ..., map_of_maps: typing.Optional[typing.Dict[str, typing.Dict[str, str]]] = ..., map_of_strings: typing.Optional[typing.Dict[str, str]] = ..., map_of_structs: typing.Optional[typing.Dict[str, json_rpc11.model.SimpleStruct]] = ..., recursive_list: typing.Optional[typing.List[json_rpc11.model.KitchenSink]] = ..., recursive_map: typing.Optional[typing.Dict[str, json_rpc11.model.KitchenSink]] = ..., recursive_struct: typing.Optional[json_rpc11.model.KitchenSink] = ..., simple_struct: typing.Optional[json_rpc11.model.SimpleStruct] = ..., string: typing.Optional[str] = ..., struct_with_json_name: typing.Optional[json_rpc11.model.StructWithJsonName] = ..., timestamp: typing.Optional[json_rpc11.types.DateTime] = ..., unix_timestamp: typing.Optional[json_rpc11.types.DateTime] = ...) -> None:
   93         -
        ...
   94         -
   95         -
   96         -
class MyUnion:
   97         -
    def as_blob_value(self) -> json_rpc11.types.Blob:
   98         -
        """
   99         -
        Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_http_server_python::types::Blob).
  100         -
        """
  101         -
        ...
  102         -
  103         -
  104         -
    def as_boolean_value(self) -> bool:
  105         -
        """
  106         -
        Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
  107         -
        """
  108         -
        ...
  109         -
  110         -
  111         -
    def as_enum_value(self) -> json_rpc11.model.FooEnum:
  112         -
        """
  113         -
        Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
  114         -
        """
  115         -
        ...
  116         -
  117         -
  118         -
    def as_list_value(self) -> typing.List[str]:
  119         -
        """
  120         -
        Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
  121         -
        """
  122         -
        ...
  123         -
  124         -
  125         -
    def as_map_value(self) -> typing.Dict[str, str]:
  126         -
        """
  127         -
        Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
  128         -
        """
  129         -
        ...
  130         -
  131         -
  132         -
    def as_number_value(self) -> int:
  133         -
        """
  134         -
        Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
  135         -
        """
  136         -
        ...
  137         -
  138         -
  139         -
    def as_string_value(self) -> str:
  140         -
        """
  141         -
        Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
  142         -
        """
  143         -
        ...
  144         -
  145         -
  146         -
    def as_structure_value(self) -> json_rpc11.model.GreetingStruct:
  147         -
        """
  148         -
        Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
  149         -
        """
  150         -
        ...
  151         -
  152         -
  153         -
    def as_timestamp_value(self) -> json_rpc11.types.DateTime:
  154         -
        """
  155         -
        Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_http_server_python::types::DateTime).
  156         -
        """
  157         -
        ...
  158         -
  159         -
  160         -
    @staticmethod
  161         -
    def blob_value(data: json_rpc11.types.Blob) -> MyUnion:
  162         -
        """
  163         -
        Creates a new union instance of [`BlobValue`](crate::model::MyUnion::BlobValue)
  164         -
        """
  165         -
        ...
  166         -
  167         -
  168         -
    @staticmethod
  169         -
    def boolean_value(data: bool) -> MyUnion:
  170         -
        """
  171         -
        Creates a new union instance of [`BooleanValue`](crate::model::MyUnion::BooleanValue)
  172         -
        """
  173         -
        ...
  174         -
  175         -
  176         -
    @staticmethod
  177         -
    def enum_value(data: json_rpc11.model.FooEnum) -> MyUnion:
  178         -
        """
  179         -
        Creates a new union instance of [`EnumValue`](crate::model::MyUnion::EnumValue)
  180         -
        """
  181         -
        ...
  182         -
  183         -
  184         -
    def is_blob_value(self) -> bool:
  185         -
        """
  186         -
        Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
  187         -
        """
  188         -
        ...
  189         -
  190         -
  191         -
    def is_boolean_value(self) -> bool:
  192         -
        """
  193         -
        Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
  194         -
        """
  195         -
        ...
  196         -
  197         -
  198         -
    def is_enum_value(self) -> bool:
  199         -
        """
  200         -
        Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
  201         -
        """
  202         -
        ...
  203         -
  204         -
  205         -
    def is_list_value(self) -> bool:
  206         -
        """
  207         -
        Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
  208         -
        """
  209         -
        ...
  210         -
  211         -
  212         -
    def is_map_value(self) -> bool:
  213         -
        """
  214         -
        Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
  215         -
        """
  216         -
        ...
  217         -
  218         -
  219         -
    def is_number_value(self) -> bool:
  220         -
        """
  221         -
        Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
  222         -
        """
  223         -
        ...
  224         -
  225         -
  226         -
    def is_string_value(self) -> bool:
  227         -
        """
  228         -
        Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
  229         -
        """
  230         -
        ...
  231         -
  232         -
  233         -
    def is_structure_value(self) -> bool:
  234         -
        """
  235         -
        Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
  236         -
        """
  237         -
        ...
  238         -
  239         -
  240         -
    def is_timestamp_value(self) -> bool:
  241         -
        """
  242         -
        Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
  243         -
        """
  244         -
        ...
  245         -
  246         -
  247         -
    @staticmethod
  248         -
    def list_value(data: typing.List[str]) -> MyUnion:
  249         -
        """
  250         -
        Creates a new union instance of [`ListValue`](crate::model::MyUnion::ListValue)
  251         -
        """
  252         -
        ...
  253         -
  254         -
  255         -
    @staticmethod
  256         -
    def map_value(data: typing.Dict[str, str]) -> MyUnion:
  257         -
        """
  258         -
        Creates a new union instance of [`MapValue`](crate::model::MyUnion::MapValue)
  259         -
        """
  260         -
        ...
  261         -
  262         -
  263         -
    @staticmethod
  264         -
    def number_value(data: int) -> MyUnion:
  265         -
        """
  266         -
        Creates a new union instance of [`NumberValue`](crate::model::MyUnion::NumberValue)
  267         -
        """
  268         -
        ...
  269         -
  270         -
  271         -
    @staticmethod
  272         -
    def string_value(data: str) -> MyUnion:
  273         -
        """
  274         -
        Creates a new union instance of [`StringValue`](crate::model::MyUnion::StringValue)
  275         -
        """
  276         -
        ...
  277         -
  278         -
  279         -
    @staticmethod
  280         -
    def structure_value(data: json_rpc11.model.GreetingStruct) -> MyUnion:
  281         -
        """
  282         -
        Creates a new union instance of [`StructureValue`](crate::model::MyUnion::StructureValue)
  283         -
        """
  284         -
        ...
  285         -
  286         -
  287         -
    @staticmethod
  288         -
    def timestamp_value(data: json_rpc11.types.DateTime) -> MyUnion:
  289         -
        """
  290         -
        Creates a new union instance of [`TimestampValue`](crate::model::MyUnion::TimestampValue)
  291         -
        """
  292         -
        ...
  293         -
  294         -
  295         -
class SimpleStruct:
  296         -
    value: typing.Optional[str]
  297         -
  298         -
    def __init__(self, value: typing.Optional[str] = ...) -> None:
  299         -
        ...
  300         -
  301         -
  302         -
class StructWithJsonName:
  303         -
    value: typing.Optional[str]
  304         -
  305         -
    def __init__(self, value: typing.Optional[str] = ...) -> None:
  306         -
        ...
  307         -
  308         -
  309         -
class ValidationExceptionField:
  310         -
    """
  311         -
    Describes one specific validation failure for an input member.
  312         -
    """
  313         -
  314         -
    message: str
  315         -
    """
  316         -
    A detailed description of the validation failure.
  317         -
    """
  318         -
  319         -
    path: str
  320         -
    """
  321         -
    A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
  322         -
    """
  323         -
  324         -
    def __init__(self, path: str, message: str) -> None:
  325         -
        ...
  326         -

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

@@ -1,0 +198,0 @@
    1         -
import json_rpc11.model
    2         -
import json_rpc11.types
    3         -
import typing
    4         -
    5         -
class ContentTypeParametersOutput:
    6         -
    def __init__(self) -> None:
    7         -
        ...
    8         -
    9         -
   10         -
class DatetimeOffsetsOutput:
   11         -
    datetime: typing.Optional[json_rpc11.types.DateTime]
   12         -
   13         -
    def __init__(self, datetime: typing.Optional[json_rpc11.types.DateTime] = ...) -> None:
   14         -
        ...
   15         -
   16         -
   17         -
class EmptyOperationOutput:
   18         -
    def __init__(self) -> None:
   19         -
        ...
   20         -
   21         -
   22         -
class EndpointOperationOutput:
   23         -
    def __init__(self) -> None:
   24         -
        ...
   25         -
   26         -
   27         -
class EndpointWithHostLabelOperationOutput:
   28         -
    def __init__(self) -> None:
   29         -
        ...
   30         -
   31         -
   32         -
class FractionalSecondsOutput:
   33         -
    datetime: typing.Optional[json_rpc11.types.DateTime]
   34         -
   35         -
    def __init__(self, datetime: typing.Optional[json_rpc11.types.DateTime] = ...) -> None:
   36         -
        ...
   37         -
   38         -
   39         -
class GreetingWithErrorsOutput:
   40         -
    greeting: typing.Optional[str]
   41         -
   42         -
    def __init__(self, greeting: typing.Optional[str] = ...) -> None:
   43         -
        ...
   44         -
   45         -
   46         -
class HostWithPathOperationOutput:
   47         -
    def __init__(self) -> None:
   48         -
        ...
   49         -
   50         -
   51         -
class JsonEnumsOutput:
   52         -
    foo_enum1: typing.Optional[json_rpc11.model.FooEnum]
   53         -
   54         -
    foo_enum2: typing.Optional[json_rpc11.model.FooEnum]
   55         -
   56         -
    foo_enum3: typing.Optional[json_rpc11.model.FooEnum]
   57         -
   58         -
    foo_enum_list: typing.Optional[typing.List[json_rpc11.model.FooEnum]]
   59         -
   60         -
    foo_enum_map: typing.Optional[typing.Dict[str, json_rpc11.model.FooEnum]]
   61         -
   62         -
    foo_enum_set: typing.Optional[typing.List[json_rpc11.model.FooEnum]]
   63         -
   64         -
    def __init__(self, foo_enum1: typing.Optional[json_rpc11.model.FooEnum] = ..., foo_enum2: typing.Optional[json_rpc11.model.FooEnum] = ..., foo_enum3: typing.Optional[json_rpc11.model.FooEnum] = ..., foo_enum_list: typing.Optional[typing.List[json_rpc11.model.FooEnum]] = ..., foo_enum_set: typing.Optional[typing.List[json_rpc11.model.FooEnum]] = ..., foo_enum_map: typing.Optional[typing.Dict[str, json_rpc11.model.FooEnum]] = ...) -> None:
   65         -
        ...
   66         -
   67         -
   68         -
class JsonIntEnumsOutput:
   69         -
    int_enum1: typing.Optional[int]
   70         -
   71         -
    int_enum2: typing.Optional[int]
   72         -
   73         -
    int_enum3: typing.Optional[int]
   74         -
   75         -
    int_enum_list: typing.Optional[typing.List[int]]
   76         -
   77         -
    int_enum_map: typing.Optional[typing.Dict[str, int]]
   78         -
   79         -
    int_enum_set: typing.Optional[typing.List[int]]
   80         -
   81         -
    def __init__(self, int_enum1: typing.Optional[int] = ..., int_enum2: typing.Optional[int] = ..., int_enum3: typing.Optional[int] = ..., int_enum_list: typing.Optional[typing.List[int]] = ..., int_enum_set: typing.Optional[typing.List[int]] = ..., int_enum_map: typing.Optional[typing.Dict[str, int]] = ...) -> None:
   82         -
        ...
   83         -
   84         -
   85         -
class JsonUnionsOutput:
   86         -
    """
   87         -
    A shared structure that contains a single union member.
   88         -
    """
   89         -
   90         -
    contents: typing.Optional[json_rpc11.model.MyUnion]
   91         -
    """
   92         -
    A union with a representative set of types for members.
   93         -
    """
   94         -
   95         -
    def __init__(self, contents: typing.Optional[json_rpc11.model.MyUnion] = ...) -> None:
   96         -
        ...
   97         -
   98         -
   99         -
class KitchenSinkOperationOutput:
  100         -
    blob: typing.Optional[json_rpc11.types.Blob]
  101         -
  102         -
    boolean: typing.Optional[bool]
  103         -
  104         -
    double: typing.Optional[float]
  105         -
  106         -
    empty_struct: typing.Optional[json_rpc11.model.EmptyStruct]
  107         -
  108         -
    float: typing.Optional[float]
  109         -
  110         -
    httpdate_timestamp: typing.Optional[json_rpc11.types.DateTime]
  111         -
  112         -
    integer: typing.Optional[int]
  113         -
  114         -
    iso8601_timestamp: typing.Optional[json_rpc11.types.DateTime]
  115         -
  116         -
    json_value: typing.Optional[str]
  117         -
  118         -
    list_of_lists: typing.Optional[typing.List[typing.List[str]]]
  119         -
  120         -
    list_of_maps_of_strings: typing.Optional[typing.List[typing.Dict[str, str]]]
  121         -
  122         -
    list_of_strings: typing.Optional[typing.List[str]]
  123         -
  124         -
    list_of_structs: typing.Optional[typing.List[json_rpc11.model.SimpleStruct]]
  125         -
  126         -
    long: typing.Optional[int]
  127         -
  128         -
    map_of_lists_of_strings: typing.Optional[typing.Dict[str, typing.List[str]]]
  129         -
  130         -
    map_of_maps: typing.Optional[typing.Dict[str, typing.Dict[str, str]]]
  131         -
  132         -
    map_of_strings: typing.Optional[typing.Dict[str, str]]
  133         -
  134         -
    map_of_structs: typing.Optional[typing.Dict[str, json_rpc11.model.SimpleStruct]]
  135         -
  136         -
    recursive_list: typing.Optional[typing.List[json_rpc11.model.KitchenSink]]
  137         -
  138         -
    recursive_map: typing.Optional[typing.Dict[str, json_rpc11.model.KitchenSink]]
  139         -
  140         -
    recursive_struct: typing.Optional[json_rpc11.model.KitchenSink]
  141         -
  142         -
    simple_struct: typing.Optional[json_rpc11.model.SimpleStruct]
  143         -
  144         -
    string: typing.Optional[str]
  145         -
  146         -
    struct_with_json_name: typing.Optional[json_rpc11.model.StructWithJsonName]
  147         -
  148         -
    timestamp: typing.Optional[json_rpc11.types.DateTime]
  149         -
  150         -
    unix_timestamp: typing.Optional[json_rpc11.types.DateTime]
  151         -
  152         -
    def __init__(self, blob: typing.Optional[json_rpc11.types.Blob] = ..., boolean: typing.Optional[bool] = ..., double: typing.Optional[float] = ..., empty_struct: typing.Optional[json_rpc11.model.EmptyStruct] = ..., float: typing.Optional[float] = ..., httpdate_timestamp: typing.Optional[json_rpc11.types.DateTime] = ..., integer: typing.Optional[int] = ..., iso8601_timestamp: typing.Optional[json_rpc11.types.DateTime] = ..., json_value: typing.Optional[str] = ..., list_of_lists: typing.Optional[typing.List[typing.List[str]]] = ..., list_of_maps_of_strings: typing.Optional[typing.List[typing.Dict[str, str]]] = ..., list_of_strings: typing.Optional[typing.List[str]] = ..., list_of_structs: typing.Optional[typing.List[json_rpc11.model.SimpleStruct]] = ..., long: typing.Optional[int] = ..., map_of_lists_of_strings: typing.Optional[typing.Dict[str, typing.List[str]]] = ..., map_of_maps: typing.Optional[typing.Dict[str, typing.Dict[str, str]]] = ..., map_of_strings: typing.Optional[typing.Dict[str, str]] = ..., map_of_structs: typing.Optional[typing.Dict[str, json_rpc11.model.SimpleStruct]] = ..., recursive_list: typing.Optional[typing.List[json_rpc11.model.KitchenSink]] = ..., recursive_map: typing.Optional[typing.Dict[str, json_rpc11.model.KitchenSink]] = ..., recursive_struct: typing.Optional[json_rpc11.model.KitchenSink] = ..., simple_struct: typing.Optional[json_rpc11.model.SimpleStruct] = ..., string: typing.Optional[str] = ..., struct_with_json_name: typing.Optional[json_rpc11.model.StructWithJsonName] = ..., timestamp: typing.Optional[json_rpc11.types.DateTime] = ..., unix_timestamp: typing.Optional[json_rpc11.types.DateTime] = ...) -> None:
  153         -
        ...
  154         -
  155         -
  156         -
class NullOperationOutput:
  157         -
    string: typing.Optional[str]
  158         -
  159         -
    def __init__(self, string: typing.Optional[str] = ...) -> None:
  160         -
        ...
  161         -
  162         -
  163         -
class OperationWithOptionalInputOutputOutput:
  164         -
    value: typing.Optional[str]
  165         -
  166         -
    def __init__(self, value: typing.Optional[str] = ...) -> None:
  167         -
        ...
  168         -
  169         -
  170         -
class PutAndGetInlineDocumentsOutput:
  171         -
    inline_document: typing.Optional[json_rpc11.types.Document]
  172         -
  173         -
    def __init__(self, inline_document: typing.Optional[json_rpc11.types.Document] = ...) -> None:
  174         -
        ...
  175         -
  176         -
  177         -
class PutWithContentEncodingOutput:
  178         -
    def __init__(self) -> None:
  179         -
        ...
  180         -
  181         -
  182         -
class SimpleScalarPropertiesOutput:
  183         -
    double_value: typing.Optional[float]
  184         -
  185         -
    float_value: typing.Optional[float]
  186         -
  187         -
    def __init__(self, float_value: typing.Optional[float] = ..., double_value: typing.Optional[float] = ...) -> None:
  188         -
        ...
  189         -
  190         -
  191         -
class SparseNullsOperationOutput:
  192         -
    sparse_string_list: typing.Optional[typing.List[typing.Optional[str]]]
  193         -
  194         -
    sparse_string_map: typing.Optional[typing.Dict[str, typing.Optional[str]]]
  195         -
  196         -
    def __init__(self, sparse_string_list: typing.Optional[typing.List[typing.Optional[str]]] = ..., sparse_string_map: typing.Optional[typing.Dict[str, typing.Optional[str]]] = ...) -> None:
  197         -
        ...
  198         -

tmp-codegen-diff/codegen-server-test-python/json_rpc11/rust-server-codegen-python/python/json_rpc11/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/json_rpc11/rust-server-codegen-python/python/json_rpc11/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/json_rpc11/rust-server-codegen-python/python/json_rpc11/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/json_rpc11/rust-server-codegen-python/src/protocol_serde/shape_my_union.rs

@@ -115,115 +200,200 @@
  135    135   
        );
  136    136   
    }
  137    137   
    Ok(variant)
  138    138   
}
  139    139   
  140    140   
pub fn ser_my_union(
  141    141   
    object_2: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  142    142   
    input: &crate::model::MyUnion,
  143    143   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
  144    144   
    match input {
  145         -
        crate::model::MyUnion::StringValue(inner) => {
         145  +
        crate::model::MyUnion::StringValue(_inner) => {
  146    146   
            object_2.key("stringValue").string(inner.as_str());
  147    147   
        }
  148         -
        crate::model::MyUnion::BooleanValue(inner) => {
         148  +
        crate::model::MyUnion::BooleanValue(_inner) => {
  149    149   
            object_2.key("booleanValue").boolean(*inner);
  150    150   
        }
  151         -
        crate::model::MyUnion::NumberValue(inner) => {
         151  +
        crate::model::MyUnion::NumberValue(_inner) => {
  152    152   
            object_2.key("numberValue").number(
  153    153   
                #[allow(clippy::useless_conversion)]
  154    154   
                ::aws_smithy_types::Number::NegInt((*inner).into()),
  155    155   
            );
  156    156   
        }
  157         -
        crate::model::MyUnion::BlobValue(inner) => {
         157  +
        crate::model::MyUnion::BlobValue(_inner) => {
  158    158   
            object_2
  159    159   
                .key("blobValue")
  160    160   
                .string_unchecked(&::aws_smithy_types::base64::encode(inner));
  161    161   
        }
  162         -
        crate::model::MyUnion::TimestampValue(inner) => {
         162  +
        crate::model::MyUnion::TimestampValue(_inner) => {
  163    163   
            object_2
  164    164   
                .key("timestampValue")
  165    165   
                .date_time(inner, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  166    166   
        }
  167         -
        crate::model::MyUnion::EnumValue(inner) => {
         167  +
        crate::model::MyUnion::EnumValue(_inner) => {
  168    168   
            object_2.key("enumValue").string(inner.as_str());
  169    169   
        }
  170         -
        crate::model::MyUnion::ListValue(inner) => {
         170  +
        crate::model::MyUnion::ListValue(_inner) => {
  171    171   
            let mut array_1 = object_2.key("listValue").start_array();
  172    172   
            for item_2 in inner {
  173    173   
                {
  174    174   
                    array_1.value().string(item_2.as_str());
  175    175   
                }
  176    176   
            }
  177    177   
            array_1.finish();
  178    178   
        }
  179         -
        crate::model::MyUnion::MapValue(inner) => {
         179  +
        crate::model::MyUnion::MapValue(_inner) => {
  180    180   
            #[allow(unused_mut)]
  181    181   
            let mut object_3 = object_2.key("mapValue").start_object();
  182    182   
            for (key_4, value_5) in inner {
  183    183   
                {
  184    184   
                    object_3.key(key_4.as_str()).string(value_5.as_str());
  185    185   
                }
  186    186   
            }
  187    187   
            object_3.finish();
  188    188   
        }
  189         -
        crate::model::MyUnion::StructureValue(inner) => {
         189  +
        crate::model::MyUnion::StructureValue(_inner) => {
  190    190   
            #[allow(unused_mut)]
  191    191   
            let mut object_6 = object_2.key("structureValue").start_object();
  192    192   
            crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(
  193    193   
                &mut object_6,
  194    194   
                inner,
  195    195   
            )?;
  196    196   
            object_6.finish();
  197    197   
        }
  198    198   
    }
  199    199   
    Ok(())

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

@@ -1,0 +164,0 @@
    1         -
import misc.input
    2         -
import misc.middleware
    3         -
import misc.output
    4         -
import misc.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 misc import input
   20         -
    from misc import output
   21         -
    from misc import error
   22         -
    from misc import middleware
   23         -
    from misc 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.required_header_collection_operation
   38         -
    def required_header_collection_operation(input: input::RequiredHeaderCollectionOperationInput, ctx: Context) -> output::RequiredHeaderCollectionOperationOutput:
   39         -
        raise NotImplementedError
   40         -
   41         -
    # This operation tests that (de)serializing required values from a nested
   42         -
    # shape works correctly.
   43         -
    @app.required_inner_shape_operation
   44         -
    def required_inner_shape_operation(input: input::RequiredInnerShapeOperationInput, ctx: Context) -> output::RequiredInnerShapeOperationOutput:
   45         -
        raise NotImplementedError
   46         -
   47         -
    # This operation tests that the response code defaults to 200 when no other
   48         -
    # code is set.
   49         -
    @app.response_code_default_operation
   50         -
    def response_code_default_operation(input: input::ResponseCodeDefaultOperationInput, ctx: Context) -> output::ResponseCodeDefaultOperationOutput:
   51         -
        raise NotImplementedError
   52         -
   53         -
    # This operation tests that the response code defaults to `@http`'s code.
   54         -
    @app.response_code_http_fallback_operation
   55         -
    def response_code_http_fallback_operation(input: input::ResponseCodeHttpFallbackOperationInput, ctx: Context) -> output::ResponseCodeHttpFallbackOperationOutput:
   56         -
        raise NotImplementedError
   57         -
   58         -
    # This operation tests that `@httpResponseCode` is `@required`
   59         -
    # and is used over `@http's` code.
   60         -
    @app.response_code_required_operation
   61         -
    def response_code_required_operation(input: input::ResponseCodeRequiredOperationInput, ctx: Context) -> output::ResponseCodeRequiredOperationOutput:
   62         -
        raise NotImplementedError
   63         -
   64         -
    # An operation whose shapes generate complex Rust types.
   65         -
    # See https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity.
   66         -
    @app.type_complexity_operation
   67         -
    def type_complexity_operation(input: input::TypeComplexityOperationInput, ctx: Context) -> output::TypeComplexityOperationOutput:
   68         -
        raise NotImplementedError
   69         -
   70         -
    app.run()
   71         -
    ```
   72         -
   73         -
    Any of operations above can be written as well prepending the `async` keyword and
   74         -
    the Python application will automatically handle it and schedule it on the event loop for you.
   75         -
    """
   76         -
   77         -
    def context(self, context: Ctx) -> None:
   78         -
        """
   79         -
        Register a context object that will be shared between handlers.
   80         -
        """
   81         -
        ...
   82         -
   83         -
   84         -
    def middleware(self, func: typing.Callable[[misc.middleware.Request, typing.Callable[[misc.middleware.Request], typing.Awaitable[misc.middleware.Response]]], typing.Awaitable[misc.middleware.Response]]) -> None:
   85         -
        """
   86         -
        Register a Python function to be executed inside a Tower middleware layer.
   87         -
        """
   88         -
        ...
   89         -
   90         -
   91         -
    def required_header_collection_operation(self, func: typing.Union[typing.Callable[[misc.input.RequiredHeaderCollectionOperationInput, Ctx], typing.Union[misc.output.RequiredHeaderCollectionOperationOutput, typing.Awaitable[misc.output.RequiredHeaderCollectionOperationOutput]]], typing.Callable[[misc.input.RequiredHeaderCollectionOperationInput], typing.Union[misc.output.RequiredHeaderCollectionOperationOutput, typing.Awaitable[misc.output.RequiredHeaderCollectionOperationOutput]]]]) -> None:
   92         -
        """
   93         -
        Method to register `required_header_collection_operation` Python implementation inside the handlers map.
   94         -
        It can be used as a function decorator in Python.
   95         -
        """
   96         -
        ...
   97         -
   98         -
   99         -
    def required_inner_shape_operation(self, func: typing.Union[typing.Callable[[misc.input.RequiredInnerShapeOperationInput, Ctx], typing.Union[misc.output.RequiredInnerShapeOperationOutput, typing.Awaitable[misc.output.RequiredInnerShapeOperationOutput]]], typing.Callable[[misc.input.RequiredInnerShapeOperationInput], typing.Union[misc.output.RequiredInnerShapeOperationOutput, typing.Awaitable[misc.output.RequiredInnerShapeOperationOutput]]]]) -> None:
  100         -
        """
  101         -
        Method to register `required_inner_shape_operation` Python implementation inside the handlers map.
  102         -
        It can be used as a function decorator in Python.
  103         -
        """
  104         -
        ...
  105         -
  106         -
  107         -
    def response_code_default_operation(self, func: typing.Union[typing.Callable[[misc.input.ResponseCodeDefaultOperationInput, Ctx], typing.Union[misc.output.ResponseCodeDefaultOperationOutput, typing.Awaitable[misc.output.ResponseCodeDefaultOperationOutput]]], typing.Callable[[misc.input.ResponseCodeDefaultOperationInput], typing.Union[misc.output.ResponseCodeDefaultOperationOutput, typing.Awaitable[misc.output.ResponseCodeDefaultOperationOutput]]]]) -> None:
  108         -
        """
  109         -
        Method to register `response_code_default_operation` Python implementation inside the handlers map.
  110         -
        It can be used as a function decorator in Python.
  111         -
        """
  112         -
        ...
  113         -
  114         -
  115         -
    def response_code_http_fallback_operation(self, func: typing.Union[typing.Callable[[misc.input.ResponseCodeHttpFallbackOperationInput, Ctx], typing.Union[misc.output.ResponseCodeHttpFallbackOperationOutput, typing.Awaitable[misc.output.ResponseCodeHttpFallbackOperationOutput]]], typing.Callable[[misc.input.ResponseCodeHttpFallbackOperationInput], typing.Union[misc.output.ResponseCodeHttpFallbackOperationOutput, typing.Awaitable[misc.output.ResponseCodeHttpFallbackOperationOutput]]]]) -> None:
  116         -
        """
  117         -
        Method to register `response_code_http_fallback_operation` Python implementation inside the handlers map.
  118         -
        It can be used as a function decorator in Python.
  119         -
        """
  120         -
        ...
  121         -
  122         -
  123         -
    def response_code_required_operation(self, func: typing.Union[typing.Callable[[misc.input.ResponseCodeRequiredOperationInput, Ctx], typing.Union[misc.output.ResponseCodeRequiredOperationOutput, typing.Awaitable[misc.output.ResponseCodeRequiredOperationOutput]]], typing.Callable[[misc.input.ResponseCodeRequiredOperationInput], typing.Union[misc.output.ResponseCodeRequiredOperationOutput, typing.Awaitable[misc.output.ResponseCodeRequiredOperationOutput]]]]) -> None:
  124         -
        """
  125         -
        Method to register `response_code_required_operation` Python implementation inside the handlers map.
  126         -
        It can be used as a function decorator in Python.
  127         -
        """
  128         -
        ...
  129         -
  130         -
  131         -
    def run(self, address: typing.Optional[str] = ..., port: typing.Optional[int] = ..., backlog: typing.Optional[int] = ..., workers: typing.Optional[int] = ..., tls: typing.Optional[misc.tls.TlsConfig] = ...) -> None:
  132         -
        """
  133         -
        Main entrypoint: start the server on multiple workers.
  134         -
        """
  135         -
        ...
  136         -
  137         -
  138         -
    def run_lambda(self) -> None:
  139         -
        """
  140         -
        Lambda entrypoint: start the server on Lambda.
  141         -
        """
  142         -
        ...
  143         -
  144         -
  145         -
    def start_worker(self) -> None:
  146         -
        """
  147         -
        Build the service and start a single worker.
  148         -
        """
  149         -
        ...
  150         -
  151         -
  152         -
    def type_complexity_operation(self, func: typing.Union[typing.Callable[[misc.input.TypeComplexityOperationInput, Ctx], typing.Union[misc.output.TypeComplexityOperationOutput, typing.Awaitable[misc.output.TypeComplexityOperationOutput]]], typing.Callable[[misc.input.TypeComplexityOperationInput], typing.Union[misc.output.TypeComplexityOperationOutput, typing.Awaitable[misc.output.TypeComplexityOperationOutput]]]]) -> None:
  153         -
        """
  154         -
        Method to register `type_complexity_operation` Python implementation inside the handlers map.
  155         -
        It can be used as a function decorator in Python.
  156         -
        """
  157         -
        ...
  158         -
  159         -
  160         -
    def __init__(self) -> None:
  161         -
        ...
  162         -
  163         -
  164         -
CODEGEN_VERSION: str = ...