| [3a89adb] | 1 | import connexion
|
|---|
| 2 | import six
|
|---|
| 3 |
|
|---|
| 4 | {{#imports}}{{import}} # noqa: E501
|
|---|
| 5 | {{/imports}}
|
|---|
| 6 | from {{packageName}} import util
|
|---|
| [9f0f35e] | 7 | from {{packageName}}_impl.controllers import {{classFilename}}
|
|---|
| [3a89adb] | 8 | {{#operations}}
|
|---|
| 9 | {{#operation}}
|
|---|
| 10 |
|
|---|
| 11 | def {{operationId}}({{#allParams}}{{paramName}}{{^required}}=None{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): # noqa: E501
|
|---|
| 12 | """{{#summary}}{{.}}{{/summary}}{{^summary}}{{operationId}}{{/summary}}
|
|---|
| 13 |
|
|---|
| 14 | {{#notes}}{{.}}{{/notes}} # noqa: E501
|
|---|
| 15 |
|
|---|
| 16 | {{#allParams}}
|
|---|
| 17 | :param {{paramName}}: {{description}}
|
|---|
| 18 | {{^isContainer}}
|
|---|
| 19 | {{#isPrimitiveType}}
|
|---|
| 20 | :type {{paramName}}: {{>param_type}}
|
|---|
| 21 | {{/isPrimitiveType}}
|
|---|
| 22 | {{#isUuid}}
|
|---|
| 23 | :type {{paramName}}: {{>param_type}}
|
|---|
| 24 | {{/isUuid}}
|
|---|
| 25 | {{^isPrimitiveType}}
|
|---|
| 26 | {{#isFile}}
|
|---|
| 27 | :type {{paramName}}: werkzeug.datastructures.FileStorage
|
|---|
| 28 | {{/isFile}}
|
|---|
| 29 | {{^isFile}}
|
|---|
| 30 | {{^isUuid}}
|
|---|
| 31 | :type {{paramName}}: dict | bytes
|
|---|
| 32 | {{/isUuid}}
|
|---|
| 33 | {{/isFile}}
|
|---|
| 34 | {{/isPrimitiveType}}
|
|---|
| 35 | {{/isContainer}}
|
|---|
| 36 | {{#isListContainer}}
|
|---|
| 37 | {{#items}}
|
|---|
| 38 | {{#isPrimitiveType}}
|
|---|
| 39 | :type {{paramName}}: List[{{>param_type}}]
|
|---|
| 40 | {{/isPrimitiveType}}
|
|---|
| 41 | {{^isPrimitiveType}}
|
|---|
| 42 | :type {{paramName}}: list | bytes
|
|---|
| 43 | {{/isPrimitiveType}}
|
|---|
| 44 | {{/items}}
|
|---|
| 45 | {{/isListContainer}}
|
|---|
| 46 | {{#isMapContainer}}
|
|---|
| 47 | {{#items}}
|
|---|
| 48 | {{#isPrimitiveType}}
|
|---|
| 49 | :type {{paramName}}: Dict[str, {{>param_type}}]
|
|---|
| 50 | {{/isPrimitiveType}}
|
|---|
| 51 | {{^isPrimitiveType}}
|
|---|
| 52 | :type {{paramName}}: dict | bytes
|
|---|
| 53 | {{/isPrimitiveType}}
|
|---|
| 54 | {{/items}}
|
|---|
| 55 | {{/isMapContainer}}
|
|---|
| 56 | {{/allParams}}
|
|---|
| 57 |
|
|---|
| 58 | :rtype: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}None{{/returnType}}
|
|---|
| 59 | """
|
|---|
| 60 | {{#allParams}}
|
|---|
| 61 | {{^isContainer}}
|
|---|
| 62 | {{#isDate}}
|
|---|
| 63 | {{paramName}} = util.deserialize_date({{paramName}})
|
|---|
| 64 | {{/isDate}}
|
|---|
| 65 | {{#isDateTime}}
|
|---|
| 66 | {{paramName}} = util.deserialize_datetime({{paramName}})
|
|---|
| 67 | {{/isDateTime}}
|
|---|
| 68 | {{^isPrimitiveType}}
|
|---|
| 69 | {{^isFile}}
|
|---|
| 70 | {{^isUuid}}
|
|---|
| 71 | if connexion.request.is_json:
|
|---|
| 72 | {{paramName}} = {{baseType}}.from_dict(connexion.request.get_json()) # noqa: E501
|
|---|
| 73 | {{/isUuid}}
|
|---|
| 74 | {{/isFile}}
|
|---|
| 75 | {{/isPrimitiveType}}
|
|---|
| 76 | {{/isContainer}}
|
|---|
| 77 | {{#isListContainer}}
|
|---|
| 78 | {{#items}}
|
|---|
| 79 | {{#isDate}}
|
|---|
| 80 | if connexion.request.is_json:
|
|---|
| 81 | {{paramName}} = [util.deserialize_date(s) for s in connexion.request.get_json()] # noqa: E501
|
|---|
| 82 | {{/isDate}}
|
|---|
| 83 | {{#isDateTime}}
|
|---|
| 84 | if connexion.request.is_json:
|
|---|
| 85 | {{paramName}} = [util.deserialize_datetime(s) for s in connexion.request.get_json()] # noqa: E501
|
|---|
| 86 | {{/isDateTime}}
|
|---|
| 87 | {{#complexType}}
|
|---|
| 88 | if connexion.request.is_json:
|
|---|
| 89 | {{paramName}} = [{{complexType}}.from_dict(d) for d in connexion.request.get_json()] # noqa: E501
|
|---|
| 90 | {{/complexType}}
|
|---|
| 91 | {{/items}}
|
|---|
| 92 | {{/isListContainer}}
|
|---|
| 93 | {{#isMapContainer}}
|
|---|
| 94 | {{#items}}
|
|---|
| 95 | {{#isDate}}
|
|---|
| 96 | if connexion.request.is_json:
|
|---|
| 97 | {{paramName}} = {k: util.deserialize_date(v) for k, v in six.iteritems(connexion.request.get_json())} # noqa: E501
|
|---|
| 98 | {{/isDate}}
|
|---|
| 99 | {{#isDateTime}}
|
|---|
| 100 | if connexion.request.is_json:
|
|---|
| 101 | {{paramName}} = {k: util.deserialize_datetime(v) for k, v in six.iteritems(connexion.request.get_json())} # noqa: E501
|
|---|
| 102 | {{/isDateTime}}
|
|---|
| 103 | {{#complexType}}
|
|---|
| 104 | if connexion.request.is_json:
|
|---|
| 105 | {{paramName}} = {k: {{baseType}}.from_dict(v) for k, v in six.iteritems(connexion.request.get_json())} # noqa: E501
|
|---|
| 106 | {{/complexType}}
|
|---|
| 107 | {{/items}}
|
|---|
| 108 | {{/isMapContainer}}
|
|---|
| 109 | {{/allParams}}
|
|---|
| [9f0f35e] | 110 | return {{classFilename}}.{{operationId}}({{#allParams}}{{paramName}}{{^required}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
|---|
| [3a89adb] | 111 | {{/operation}}
|
|---|
| 112 | {{/operations}}
|
|---|