Server Test Python

Server Test Python

rev. 03f9d3736bb06bbe282d7bfe7c28721562f20a05 (ignoring whitespace)

Files changed:

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

@@ -2,2 +61,69 @@
   22     22   
    pub fn path(&self) -> &str {
   23     23   
        use std::ops::Deref;
   24     24   
        self.path.deref()
   25     25   
    }
   26     26   
    /// A detailed description of the validation failure.
   27     27   
    pub fn message(&self) -> &str {
   28     28   
        use std::ops::Deref;
   29     29   
        self.message.deref()
   30     30   
    }
   31     31   
}
          32  +
impl ::std::fmt::Display for ValidationExceptionField {
          33  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          34  +
        ::std::write!(f, "ValidationExceptionField {{")?;
          35  +
        ::std::write!(f, "path={}", &self.path)?;
          36  +
        ::std::write!(f, ", message={}", &self.message)?;
          37  +
        ::std::write!(f, "}}")
          38  +
    }
          39  +
}
   32     40   
#[allow(clippy::new_without_default)]
   33     41   
#[allow(clippy::too_many_arguments)]
   34     42   
#[::pyo3::pymethods]
   35     43   
impl ValidationExceptionField {
   36     44   
    #[new]
   37     45   
    pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
   38     46   
        Self { path, message }
   39     47   
    }
   40     48   
    fn __repr__(&self) -> String {
   41     49   
        format!("{self:?}")

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

@@ -2,2 +61,69 @@
   22     22   
    pub fn path(&self) -> &str {
   23     23   
        use std::ops::Deref;
   24     24   
        self.path.deref()
   25     25   
    }
   26     26   
    /// A detailed description of the validation failure.
   27     27   
    pub fn message(&self) -> &str {
   28     28   
        use std::ops::Deref;
   29     29   
        self.message.deref()
   30     30   
    }
   31     31   
}
          32  +
impl ::std::fmt::Display for ValidationExceptionField {
          33  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          34  +
        ::std::write!(f, "ValidationExceptionField {{")?;
          35  +
        ::std::write!(f, "path={}", &self.path)?;
          36  +
        ::std::write!(f, ", message={}", &self.message)?;
          37  +
        ::std::write!(f, "}}")
          38  +
    }
          39  +
}
   32     40   
#[allow(clippy::new_without_default)]
   33     41   
#[allow(clippy::too_many_arguments)]
   34     42   
#[::pyo3::pymethods]
   35     43   
impl ValidationExceptionField {
   36     44   
    #[new]
   37     45   
    pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
   38     46   
        Self { path, message }
   39     47   
    }
   40     48   
    fn __repr__(&self) -> String {
   41     49   
        format!("{self:?}")

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

@@ -2,2 +61,69 @@
   22     22   
    pub fn path(&self) -> &str {
   23     23   
        use std::ops::Deref;
   24     24   
        self.path.deref()
   25     25   
    }
   26     26   
    /// A detailed description of the validation failure.
   27     27   
    pub fn message(&self) -> &str {
   28     28   
        use std::ops::Deref;
   29     29   
        self.message.deref()
   30     30   
    }
   31     31   
}
          32  +
impl ::std::fmt::Display for ValidationExceptionField {
          33  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          34  +
        ::std::write!(f, "ValidationExceptionField {{")?;
          35  +
        ::std::write!(f, "path={}", &self.path)?;
          36  +
        ::std::write!(f, ", message={}", &self.message)?;
          37  +
        ::std::write!(f, "}}")
          38  +
    }
          39  +
}
   32     40   
#[allow(clippy::new_without_default)]
   33     41   
#[allow(clippy::too_many_arguments)]
   34     42   
#[::pyo3::pymethods]
   35     43   
impl ValidationExceptionField {
   36     44   
    #[new]
   37     45   
    pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
   38     46   
        Self { path, message }
   39     47   
    }
   40     48   
    fn __repr__(&self) -> String {
   41     49   
        format!("{self:?}")

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

@@ -2,2 +61,69 @@
   22     22   
    pub fn path(&self) -> &str {
   23     23   
        use std::ops::Deref;
   24     24   
        self.path.deref()
   25     25   
    }
   26     26   
    /// A detailed description of the validation failure.
   27     27   
    pub fn message(&self) -> &str {
   28     28   
        use std::ops::Deref;
   29     29   
        self.message.deref()
   30     30   
    }
   31     31   
}
          32  +
impl ::std::fmt::Display for ValidationExceptionField {
          33  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          34  +
        ::std::write!(f, "ValidationExceptionField {{")?;
          35  +
        ::std::write!(f, "path={}", &self.path)?;
          36  +
        ::std::write!(f, ", message={}", &self.message)?;
          37  +
        ::std::write!(f, "}}")
          38  +
    }
          39  +
}
   32     40   
#[allow(clippy::new_without_default)]
   33     41   
#[allow(clippy::too_many_arguments)]
   34     42   
#[::pyo3::pymethods]
   35     43   
impl ValidationExceptionField {
   36     44   
    #[new]
   37     45   
    pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
   38     46   
        Self { path, message }
   39     47   
    }
   40     48   
    fn __repr__(&self) -> String {
   41     49   
        format!("{self:?}")
@@ -1432,1440 +1491,1510 @@
 1452   1460   
    /// :type typing.Optional\[str\]:
 1453   1461   
    #[allow(missing_docs)] // documentation missing in model
 1454   1462   
    pub foo: ::std::option::Option<::std::string::String>,
 1455   1463   
}
 1456   1464   
impl ComplexNestedErrorData {
 1457   1465   
    #[allow(missing_docs)] // documentation missing in model
 1458   1466   
    pub fn foo(&self) -> ::std::option::Option<&str> {
 1459   1467   
        self.foo.as_deref()
 1460   1468   
    }
 1461   1469   
}
        1470  +
impl ::std::fmt::Display for ComplexNestedErrorData {
        1471  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        1472  +
        ::std::write!(f, "ComplexNestedErrorData {{")?;
        1473  +
        if let ::std::option::Option::Some(inner) = &self.foo {
        1474  +
            ::std::write!(f, "foo=Some({})", inner)?;
        1475  +
        } else {
        1476  +
            ::std::write!(f, "foo=None")?;
        1477  +
        }
        1478  +
        ::std::write!(f, "}}")
        1479  +
    }
        1480  +
}
 1462   1481   
#[allow(clippy::new_without_default)]
 1463   1482   
#[allow(clippy::too_many_arguments)]
 1464   1483   
#[::pyo3::pymethods]
 1465   1484   
impl ComplexNestedErrorData {
 1466   1485   
    #[new]
 1467   1486   
    pub fn new(foo: ::std::option::Option<::std::string::String>) -> Self {
 1468   1487   
        Self { foo }
 1469   1488   
    }
 1470   1489   
    fn __repr__(&self) -> String {
 1471   1490   
        format!("{self:?}")

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

@@ -1,0 +300,0 @@
    1         -
import json_rpc11.input
    2         -
import json_rpc11.middleware
    3         -
import json_rpc11.output
    4         -
import json_rpc11.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 json_rpc11 import input
   20         -
    from json_rpc11 import output
   21         -
    from json_rpc11 import error
   22         -
    from json_rpc11 import middleware
   23         -
    from json_rpc11 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         -
    # The example tests how servers must support requests
   38         -
    # containing a `Content-Type` header with parameters.
   39         -
    @app.content_type_parameters
   40         -
    def content_type_parameters(input: input::ContentTypeParametersInput, ctx: Context) -> output::ContentTypeParametersOutput:
   41         -
        raise NotImplementedError
   42         -
   43         -
    @app.datetime_offsets
   44         -
    def datetime_offsets(input: input::DatetimeOffsetsInput, ctx: Context) -> output::DatetimeOffsetsOutput:
   45         -
        raise NotImplementedError
   46         -
   47         -
    @app.empty_operation
   48         -
    def empty_operation(input: input::EmptyOperationInput, ctx: Context) -> output::EmptyOperationOutput:
   49         -
        raise NotImplementedError
   50         -
   51         -
    @app.endpoint_operation
   52         -
    def endpoint_operation(input: input::EndpointOperationInput, ctx: Context) -> output::EndpointOperationOutput:
   53         -
        raise NotImplementedError
   54         -
   55         -
    @app.endpoint_with_host_label_operation
   56         -
    def endpoint_with_host_label_operation(input: input::EndpointWithHostLabelOperationInput, ctx: Context) -> output::EndpointWithHostLabelOperationOutput:
   57         -
        raise NotImplementedError
   58         -
   59         -
    @app.fractional_seconds
   60         -
    def fractional_seconds(input: input::FractionalSecondsInput, ctx: Context) -> output::FractionalSecondsOutput:
   61         -
        raise NotImplementedError
   62         -
   63         -
    # This operation has three possible return values:
   64         -
    #
   65         -
    # 1. A successful response in the form of GreetingWithErrorsOutput
   66         -
    # 2. An InvalidGreeting error.
   67         -
    # 3. A ComplexError error.
   68         -
    #
   69         -
    # Implementations must be able to successfully take a response and
   70         -
    # properly deserialize successful and error responses.
   71         -
    @app.greeting_with_errors
   72         -
    def greeting_with_errors(input: input::GreetingWithErrorsInput, ctx: Context) -> output::GreetingWithErrorsOutput:
   73         -
        raise NotImplementedError
   74         -
   75         -
    @app.host_with_path_operation
   76         -
    def host_with_path_operation(input: input::HostWithPathOperationInput, ctx: Context) -> output::HostWithPathOperationOutput:
   77         -
        raise NotImplementedError
   78         -
   79         -
    # This example serializes enums as top level properties, in lists, sets, and maps.
   80         -
    @app.json_enums
   81         -
    def json_enums(input: input::JsonEnumsInput, ctx: Context) -> output::JsonEnumsOutput:
   82         -
        raise NotImplementedError
   83         -
   84         -
    # This operation uses unions for inputs and outputs.
   85         -
    @app.json_unions
   86         -
    def json_unions(input: input::JsonUnionsInput, ctx: Context) -> output::JsonUnionsOutput:
   87         -
        raise NotImplementedError
   88         -
   89         -
    @app.kitchen_sink_operation
   90         -
    def kitchen_sink_operation(input: input::KitchenSinkOperationInput, ctx: Context) -> output::KitchenSinkOperationOutput:
   91         -
        raise NotImplementedError
   92         -
   93         -
    @app.null_operation
   94         -
    def null_operation(input: input::NullOperationInput, ctx: Context) -> output::NullOperationOutput:
   95         -
        raise NotImplementedError
   96         -
   97         -
    @app.operation_with_optional_input_output
   98         -
    def operation_with_optional_input_output(input: input::OperationWithOptionalInputOutputInput, ctx: Context) -> output::OperationWithOptionalInputOutputOutput:
   99         -
        raise NotImplementedError
  100         -
  101         -
    # This example serializes an inline document as part of the payload.
  102         -
    @app.put_and_get_inline_documents
  103         -
    def put_and_get_inline_documents(input: input::PutAndGetInlineDocumentsInput, ctx: Context) -> output::PutAndGetInlineDocumentsOutput:
  104         -
        raise NotImplementedError
  105         -
  106         -
    @app.put_with_content_encoding
  107         -
    def put_with_content_encoding(input: input::PutWithContentEncodingInput, ctx: Context) -> output::PutWithContentEncodingOutput:
  108         -
        raise NotImplementedError
  109         -
  110         -
    @app.simple_scalar_properties
  111         -
    def simple_scalar_properties(input: input::SimpleScalarPropertiesInput, ctx: Context) -> output::SimpleScalarPropertiesOutput:
  112         -
        raise NotImplementedError
  113         -
  114         -
    @app.sparse_nulls_operation
  115         -
    def sparse_nulls_operation(input: input::SparseNullsOperationInput, ctx: Context) -> output::SparseNullsOperationOutput:
  116         -
        raise NotImplementedError
  117         -
  118         -
    app.run()
  119         -
    ```
  120         -
  121         -
    Any of operations above can be written as well prepending the `async` keyword and
  122         -
    the Python application will automatically handle it and schedule it on the event loop for you.
  123         -
    """
  124         -
  125         -
    def content_type_parameters(self, func: typing.Union[typing.Callable[[json_rpc11.input.ContentTypeParametersInput, Ctx], typing.Union[json_rpc11.output.ContentTypeParametersOutput, typing.Awaitable[json_rpc11.output.ContentTypeParametersOutput]]], typing.Callable[[json_rpc11.input.ContentTypeParametersInput], typing.Union[json_rpc11.output.ContentTypeParametersOutput, typing.Awaitable[json_rpc11.output.ContentTypeParametersOutput]]]]) -> None:
  126         -
        """
  127         -
        Method to register `content_type_parameters` Python implementation inside the handlers map.
  128         -
        It can be used as a function decorator in Python.
  129         -
        """
  130         -
        ...
  131         -
  132         -
  133         -
    def context(self, context: Ctx) -> None:
  134         -
        """
  135         -
        Register a context object that will be shared between handlers.
  136         -
        """
  137         -
        ...
  138         -
  139         -
  140         -
    def datetime_offsets(self, func: typing.Union[typing.Callable[[json_rpc11.input.DatetimeOffsetsInput, Ctx], typing.Union[json_rpc11.output.DatetimeOffsetsOutput, typing.Awaitable[json_rpc11.output.DatetimeOffsetsOutput]]], typing.Callable[[json_rpc11.input.DatetimeOffsetsInput], typing.Union[json_rpc11.output.DatetimeOffsetsOutput, typing.Awaitable[json_rpc11.output.DatetimeOffsetsOutput]]]]) -> None:
  141         -
        """
  142         -
        Method to register `datetime_offsets` Python implementation inside the handlers map.
  143         -
        It can be used as a function decorator in Python.
  144         -
        """
  145         -
        ...
  146         -
  147         -
  148         -
    def empty_operation(self, func: typing.Union[typing.Callable[[json_rpc11.input.EmptyOperationInput, Ctx], typing.Union[json_rpc11.output.EmptyOperationOutput, typing.Awaitable[json_rpc11.output.EmptyOperationOutput]]], typing.Callable[[json_rpc11.input.EmptyOperationInput], typing.Union[json_rpc11.output.EmptyOperationOutput, typing.Awaitable[json_rpc11.output.EmptyOperationOutput]]]]) -> None:
  149         -
        """
  150         -
        Method to register `empty_operation` Python implementation inside the handlers map.
  151         -
        It can be used as a function decorator in Python.
  152         -
        """
  153         -
        ...
  154         -
  155         -
  156         -
    def endpoint_operation(self, func: typing.Union[typing.Callable[[json_rpc11.input.EndpointOperationInput, Ctx], typing.Union[json_rpc11.output.EndpointOperationOutput, typing.Awaitable[json_rpc11.output.EndpointOperationOutput]]], typing.Callable[[json_rpc11.input.EndpointOperationInput], typing.Union[json_rpc11.output.EndpointOperationOutput, typing.Awaitable[json_rpc11.output.EndpointOperationOutput]]]]) -> None:
  157         -
        """
  158         -
        Method to register `endpoint_operation` Python implementation inside the handlers map.
  159         -
        It can be used as a function decorator in Python.
  160         -
        """
  161         -
        ...
  162         -
  163         -
  164         -
    def endpoint_with_host_label_operation(self, func: typing.Union[typing.Callable[[json_rpc11.input.EndpointWithHostLabelOperationInput, Ctx], typing.Union[json_rpc11.output.EndpointWithHostLabelOperationOutput, typing.Awaitable[json_rpc11.output.EndpointWithHostLabelOperationOutput]]], typing.Callable[[json_rpc11.input.EndpointWithHostLabelOperationInput], typing.Union[json_rpc11.output.EndpointWithHostLabelOperationOutput, typing.Awaitable[json_rpc11.output.EndpointWithHostLabelOperationOutput]]]]) -> None:
  165         -
        """
  166         -
        Method to register `endpoint_with_host_label_operation` Python implementation inside the handlers map.
  167         -
        It can be used as a function decorator in Python.
  168         -
        """
  169         -
        ...
  170         -
  171         -
  172         -
    def fractional_seconds(self, func: typing.Union[typing.Callable[[json_rpc11.input.FractionalSecondsInput, Ctx], typing.Union[json_rpc11.output.FractionalSecondsOutput, typing.Awaitable[json_rpc11.output.FractionalSecondsOutput]]], typing.Callable[[json_rpc11.input.FractionalSecondsInput], typing.Union[json_rpc11.output.FractionalSecondsOutput, typing.Awaitable[json_rpc11.output.FractionalSecondsOutput]]]]) -> None:
  173         -
        """
  174         -
        Method to register `fractional_seconds` Python implementation inside the handlers map.
  175         -
        It can be used as a function decorator in Python.
  176         -
        """
  177         -
        ...
  178         -
  179         -
  180         -
    def greeting_with_errors(self, func: typing.Union[typing.Callable[[json_rpc11.input.GreetingWithErrorsInput, Ctx], typing.Union[json_rpc11.output.GreetingWithErrorsOutput, typing.Awaitable[json_rpc11.output.GreetingWithErrorsOutput]]], typing.Callable[[json_rpc11.input.GreetingWithErrorsInput], typing.Union[json_rpc11.output.GreetingWithErrorsOutput, typing.Awaitable[json_rpc11.output.GreetingWithErrorsOutput]]]]) -> None:
  181         -
        """
  182         -
        Method to register `greeting_with_errors` Python implementation inside the handlers map.
  183         -
        It can be used as a function decorator in Python.
  184         -
        """
  185         -
        ...
  186         -
  187         -
  188         -
    def host_with_path_operation(self, func: typing.Union[typing.Callable[[json_rpc11.input.HostWithPathOperationInput, Ctx], typing.Union[json_rpc11.output.HostWithPathOperationOutput, typing.Awaitable[json_rpc11.output.HostWithPathOperationOutput]]], typing.Callable[[json_rpc11.input.HostWithPathOperationInput], typing.Union[json_rpc11.output.HostWithPathOperationOutput, typing.Awaitable[json_rpc11.output.HostWithPathOperationOutput]]]]) -> None:
  189         -
        """
  190         -
        Method to register `host_with_path_operation` Python implementation inside the handlers map.
  191         -
        It can be used as a function decorator in Python.
  192         -
        """
  193         -
        ...
  194         -
  195         -
  196         -
    def json_enums(self, func: typing.Union[typing.Callable[[json_rpc11.input.JsonEnumsInput, Ctx], typing.Union[json_rpc11.output.JsonEnumsOutput, typing.Awaitable[json_rpc11.output.JsonEnumsOutput]]], typing.Callable[[json_rpc11.input.JsonEnumsInput], typing.Union[json_rpc11.output.JsonEnumsOutput, typing.Awaitable[json_rpc11.output.JsonEnumsOutput]]]]) -> None:
  197         -
        """
  198         -
        Method to register `json_enums` Python implementation inside the handlers map.
  199         -
        It can be used as a function decorator in Python.
  200         -
        """
  201         -
        ...
  202         -
  203         -
  204         -
    def json_unions(self, func: typing.Union[typing.Callable[[json_rpc11.input.JsonUnionsInput, Ctx], typing.Union[json_rpc11.output.JsonUnionsOutput, typing.Awaitable[json_rpc11.output.JsonUnionsOutput]]], typing.Callable[[json_rpc11.input.JsonUnionsInput], typing.Union[json_rpc11.output.JsonUnionsOutput, typing.Awaitable[json_rpc11.output.JsonUnionsOutput]]]]) -> None:
  205         -
        """
  206         -
        Method to register `json_unions` Python implementation inside the handlers map.
  207         -
        It can be used as a function decorator in Python.
  208         -
        """
  209         -
        ...
  210         -
  211         -
  212         -
    def kitchen_sink_operation(self, func: typing.Union[typing.Callable[[json_rpc11.input.KitchenSinkOperationInput, Ctx], typing.Union[json_rpc11.output.KitchenSinkOperationOutput, typing.Awaitable[json_rpc11.output.KitchenSinkOperationOutput]]], typing.Callable[[json_rpc11.input.KitchenSinkOperationInput], typing.Union[json_rpc11.output.KitchenSinkOperationOutput, typing.Awaitable[json_rpc11.output.KitchenSinkOperationOutput]]]]) -> None:
  213         -
        """
  214         -
        Method to register `kitchen_sink_operation` Python implementation inside the handlers map.
  215         -
        It can be used as a function decorator in Python.
  216         -
        """
  217         -
        ...
  218         -
  219         -
  220         -
    def middleware(self, func: typing.Callable[[json_rpc11.middleware.Request, typing.Callable[[json_rpc11.middleware.Request], typing.Awaitable[json_rpc11.middleware.Response]]], typing.Awaitable[json_rpc11.middleware.Response]]) -> None:
  221         -
        """
  222         -
        Register a Python function to be executed inside a Tower middleware layer.
  223         -
        """
  224         -
        ...
  225         -
  226         -
  227         -
    def null_operation(self, func: typing.Union[typing.Callable[[json_rpc11.input.NullOperationInput, Ctx], typing.Union[json_rpc11.output.NullOperationOutput, typing.Awaitable[json_rpc11.output.NullOperationOutput]]], typing.Callable[[json_rpc11.input.NullOperationInput], typing.Union[json_rpc11.output.NullOperationOutput, typing.Awaitable[json_rpc11.output.NullOperationOutput]]]]) -> None:
  228         -
        """
  229         -
        Method to register `null_operation` Python implementation inside the handlers map.
  230         -
        It can be used as a function decorator in Python.
  231         -
        """
  232         -
        ...
  233         -
  234         -
  235         -
    def operation_with_optional_input_output(self, func: typing.Union[typing.Callable[[json_rpc11.input.OperationWithOptionalInputOutputInput, Ctx], typing.Union[json_rpc11.output.OperationWithOptionalInputOutputOutput, typing.Awaitable[json_rpc11.output.OperationWithOptionalInputOutputOutput]]], typing.Callable[[json_rpc11.input.OperationWithOptionalInputOutputInput], typing.Union[json_rpc11.output.OperationWithOptionalInputOutputOutput, typing.Awaitable[json_rpc11.output.OperationWithOptionalInputOutputOutput]]]]) -> None:
  236         -
        """
  237         -
        Method to register `operation_with_optional_input_output` Python implementation inside the handlers map.
  238         -
        It can be used as a function decorator in Python.
  239         -
        """
  240         -
        ...
  241         -
  242         -
  243         -
    def put_and_get_inline_documents(self, func: typing.Union[typing.Callable[[json_rpc11.input.PutAndGetInlineDocumentsInput, Ctx], typing.Union[json_rpc11.output.PutAndGetInlineDocumentsOutput, typing.Awaitable[json_rpc11.output.PutAndGetInlineDocumentsOutput]]], typing.Callable[[json_rpc11.input.PutAndGetInlineDocumentsInput], typing.Union[json_rpc11.output.PutAndGetInlineDocumentsOutput, typing.Awaitable[json_rpc11.output.PutAndGetInlineDocumentsOutput]]]]) -> None:
  244         -
        """
  245         -
        Method to register `put_and_get_inline_documents` Python implementation inside the handlers map.
  246         -
        It can be used as a function decorator in Python.
  247         -
        """
  248         -
        ...
  249         -
  250         -
  251         -
    def put_with_content_encoding(self, func: typing.Union[typing.Callable[[json_rpc11.input.PutWithContentEncodingInput, Ctx], typing.Union[json_rpc11.output.PutWithContentEncodingOutput, typing.Awaitable[json_rpc11.output.PutWithContentEncodingOutput]]], typing.Callable[[json_rpc11.input.PutWithContentEncodingInput], typing.Union[json_rpc11.output.PutWithContentEncodingOutput, typing.Awaitable[json_rpc11.output.PutWithContentEncodingOutput]]]]) -> None:
  252         -
        """
  253         -
        Method to register `put_with_content_encoding` Python implementation inside the handlers map.
  254         -
        It can be used as a function decorator in Python.
  255         -
        """
  256         -
        ...
  257         -
  258         -
  259         -
    def run(self, address: typing.Optional[str] = ..., port: typing.Optional[int] = ..., backlog: typing.Optional[int] = ..., workers: typing.Optional[int] = ..., tls: typing.Optional[json_rpc11.tls.TlsConfig] = ...) -> None:
  260         -
        """
  261         -
        Main entrypoint: start the server on multiple workers.
  262         -
        """
  263         -
        ...
  264         -
  265         -
  266         -
    def run_lambda(self) -> None:
  267         -
        """
  268         -
        Lambda entrypoint: start the server on Lambda.
  269         -
        """
  270         -
        ...
  271         -
  272         -
  273         -
    def simple_scalar_properties(self, func: typing.Union[typing.Callable[[json_rpc11.input.SimpleScalarPropertiesInput, Ctx], typing.Union[json_rpc11.output.SimpleScalarPropertiesOutput, typing.Awaitable[json_rpc11.output.SimpleScalarPropertiesOutput]]], typing.Callable[[json_rpc11.input.SimpleScalarPropertiesInput], typing.Union[json_rpc11.output.SimpleScalarPropertiesOutput, typing.Awaitable[json_rpc11.output.SimpleScalarPropertiesOutput]]]]) -> None:
  274         -
        """
  275         -
        Method to register `simple_scalar_properties` Python implementation inside the handlers map.
  276         -
        It can be used as a function decorator in Python.
  277         -
        """
  278         -
        ...
  279         -
  280         -
  281         -
    def sparse_nulls_operation(self, func: typing.Union[typing.Callable[[json_rpc11.input.SparseNullsOperationInput, Ctx], typing.Union[json_rpc11.output.SparseNullsOperationOutput, typing.Awaitable[json_rpc11.output.SparseNullsOperationOutput]]], typing.Callable[[json_rpc11.input.SparseNullsOperationInput], typing.Union[json_rpc11.output.SparseNullsOperationOutput, typing.Awaitable[json_rpc11.output.SparseNullsOperationOutput]]]]) -> None:
  282         -
        """
  283         -
        Method to register `sparse_nulls_operation` Python implementation inside the handlers map.
  284         -
        It can be used as a function decorator in Python.
  285         -
        """
  286         -
        ...
  287         -
  288         -
  289         -
    def start_worker(self) -> None:
  290         -
        """
  291         -
        Build the service and start a single worker.
  292         -
        """
  293         -
        ...
  294         -
  295         -
  296         -
    def __init__(self) -> None:
  297         -
        ...
  298         -
  299         -
  300         -
CODEGEN_VERSION: str = ...

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

@@ -1,0 +88,0 @@
    1         -
import json_rpc11.model
    2         -
import typing
    3         -
    4         -
class ComplexError(Exception):
    5         -
    """
    6         -
    This error is thrown when a request is invalid.
    7         -
    """
    8         -
    9         -
    nested: typing.Optional[json_rpc11.model.ComplexNestedErrorData]
   10         -
   11         -
    top_level: typing.Optional[str]
   12         -
   13         -
    def __init__(self, top_level: typing.Optional[str] = ..., nested: typing.Optional[json_rpc11.model.ComplexNestedErrorData] = ...) -> None:
   14         -
        ...
   15         -
   16         -
   17         -
class ErrorWithMembers(Exception):
   18         -
    code: typing.Optional[str]
   19         -
   20         -
    complex_data: typing.Optional[json_rpc11.model.KitchenSink]
   21         -
   22         -
    integer_field: typing.Optional[int]
   23         -
   24         -
    list_field: typing.Optional[typing.List[str]]
   25         -
   26         -
    map_field: typing.Optional[typing.Dict[str, str]]
   27         -
   28         -
    message: typing.Optional[str]
   29         -
   30         -
    string_field: typing.Optional[str]
   31         -
    """
   32         -
    abc
   33         -
    """
   34         -
   35         -
    def __init__(self, code: typing.Optional[str] = ..., complex_data: typing.Optional[json_rpc11.model.KitchenSink] = ..., integer_field: typing.Optional[int] = ..., list_field: typing.Optional[typing.List[str]] = ..., map_field: typing.Optional[typing.Dict[str, str]] = ..., message: typing.Optional[str] = ..., string_field: typing.Optional[str] = ...) -> None:
   36         -
        ...
   37         -
   38         -
   39         -
class ErrorWithoutMembers(Exception):
   40         -
    def __init__(self) -> None:
   41         -
        ...
   42         -
   43         -
   44         -
class FooError(Exception):
   45         -
    """
   46         -
    This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
   47         -
    """
   48         -
   49         -
    def __init__(self) -> None:
   50         -
        ...
   51         -
   52         -
   53         -
class InternalServerError(Exception):
   54         -
    message: str
   55         -
   56         -
    def __init__(self, message: str) -> None:
   57         -
        ...
   58         -
   59         -
   60         -
class InvalidGreeting(Exception):
   61         -
    """
   62         -
    This error is thrown when an invalid greeting value is provided.
   63         -
    """
   64         -
   65         -
    message: typing.Optional[str]
   66         -
   67         -
    def __init__(self, message: typing.Optional[str] = ...) -> None:
   68         -
        ...
   69         -
   70         -
   71         -
class ValidationException(Exception):
   72         -
    """
   73         -
    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.
   74         -
    """
   75         -
   76         -
    field_list: typing.Optional[typing.List[json_rpc11.model.ValidationExceptionField]]
   77         -
    """
   78         -
    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.
   79         -
    """
   80         -
   81         -
    message: str
   82         -
    """
   83         -
    A summary of the validation failure.
   84         -
    """
   85         -
   86         -
    def __init__(self, message: str, field_list: typing.Optional[typing.List[json_rpc11.model.ValidationExceptionField]] = ...) -> None:
   87         -
        ...
   88         -

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

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

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         -