chore: Simplify async/non-async api method templates (#16820)

This commit is contained in:
Robert Schweizer 2023-10-15 04:44:43 +02:00 committed by GitHub
parent 769990d654
commit 438bf25a47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,24 +36,13 @@ class {{classname}}:
{{#operation}}
@validate_call
{{#asyncio}}
async def {{operationId}}(
{{#asyncio}}async {{/asyncio}}def {{operationId}}(
self,
{{#allParams}}
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
{{/allParams}}
**kwargs,
) -> {{{returnType}}}{{^returnType}}None{{/returnType}}:
{{/asyncio}}
{{^asyncio}}
def {{operationId}}(
self,
{{#allParams}}
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
{{/allParams}}
**kwargs,
) -> {{{returnType}}}{{^returnType}}None{{/returnType}}:
{{/asyncio}}
"""{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
{{#notes}}
@ -97,24 +86,13 @@ class {{classname}}:
)
@validate_call
{{#asyncio}}
async def {{operationId}}_with_http_info(
{{#asyncio}}async {{/asyncio}}def {{operationId}}_with_http_info(
self,
{{#allParams}}
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
{{/allParams}}
**kwargs,
) -> ApiResponse:
{{/asyncio}}
{{^asyncio}}
def {{operationId}}_with_http_info(
self,
{{#allParams}}
{{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}},
{{/allParams}}
**kwargs,
) -> ApiResponse:
{{/asyncio}}
"""{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
{{#notes}}