-
Notifications
You must be signed in to change notification settings - Fork 66
/
handlers.handlebars
45 lines (42 loc) · 1.16 KB
/
handlers.handlebars
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
###TSAPI_SPLIT_FILE###
{{#apiInfo ~}}
{{#apis ~}}
{{#operations ~}}
{{#operation ~}}
{{#if vendorExtensions.x-handler}}
{{#startsWith vendorExtensions.x-handler.language 'typescript'}}
###TSAPI_WRITE_FILE###
{
"dir": ".",
"name": "{{nickname}}",
"ext": ".ts",
"overwrite": false,
"kebabCaseFileName": true
}
###/TSAPI_WRITE_FILE###import {
{{nickname}}Handler,
{{operationIdCamelCase}}ChainedHandlerFunction,
} from "{{#apiInfo}}{{#apis.0}}{{vendorExtensions.x-runtime-package-name}}{{/apis.0}}{{/apiInfo}}";
/**
* Type-safe handler for the {{operationIdCamelCase}} operation
*/
export const {{nickname}}: {{operationIdCamelCase}}ChainedHandlerFunction = async ({ input }) => {
// TODO: Implement {{operationIdCamelCase}} Operation
return {
statusCode: 500,
body: {
message: "Not Implemented!",
},
};
};
/**
* Entry point for the AWS Lambda handler for the {{operationIdCamelCase}} operation.
* The {{nickname}}Handler method wraps the type-safe handler and manages marshalling inputs and outputs
*/
export const handler = {{nickname}}Handler({{nickname}});
{{~/startsWith}}
{{~/if}}
{{~/operation}}
{{~/operations}}
{{~/apis}}
{{~/apiInfo}}