
python.endpoint_parameter_schema_and_def.handlebars Maven / Gradle / Ivy
# {{xParamsName}} params
{{#each xParams}}
{{#if schema}}
{{#with schema}}
{{> model_templates/schema }}
{{/with}}
{{else}}
{{#if getContent}}
{{#each getContent}}
{{#with this}}
{{#with schema}}
{{> model_templates/schema }}
{{/with}}
{{/with}}
{{/each}}
{{/if}}
{{/if}}
{{/each}}
RequestRequired{{xParamsName}}Params = typing_extensions.TypedDict(
'RequestRequired{{xParamsName}}Params',
{
{{#each xParams}}
{{#if required}}
{{#if schema}}
'{{baseName}}': {{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}}
{{else}}
'{{baseName}}': {{#each getContent}}{{#with this}}{{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}}{{/with}}{{/each}}
{{/if}}
{{/if}}
{{/each}}
}
)
RequestOptional{{xParamsName}}Params = typing_extensions.TypedDict(
'RequestOptional{{xParamsName}}Params',
{
{{#each xParams}}
{{#unless required}}
{{#if schema}}
'{{baseName}}': {{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}}
{{else}}
'{{baseName}}': {{#each getContent}}{{#with this}}{{#with schema}}typing.Union[{{baseName}}, {{> model_templates/schema_python_types }}],{{/with}}{{/with}}{{/each}}
{{/if}}
{{/unless}}
{{/each}}
},
total=False
)
class Request{{xParamsName}}Params(RequestRequired{{xParamsName}}Params, RequestOptional{{xParamsName}}Params):
pass
{{#each xParams}}
{{> endpoint_parameter }}
{{/each}}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy