1
1
package { {package} }
2
2
3
3
{ {#imports} }
4
- import { {import} }
4
+ import { {import} }
5
5
{ {/imports} }
6
6
import { {invokerPackage} }._
7
7
import { {invokerPackage} }.CollectionFormats._
8
8
import { {invokerPackage} }.ApiKeyLocations._
9
9
10
10
{ {#operations} }
11
- object { {classname} } {
11
+ object { {classname} } {
12
12
13
- {{#operation} }
14
- { {#javadocRenderer} }
15
- { {> javadoc} }
16
- { {/javadocRenderer} }
17
- def { {operationId} }({ {> methodParameters} }): ApiRequest[{ {> operationReturnType} }] =
18
- ApiRequest[{ {> operationReturnType} }](ApiMethods.{ {httpMethod.toUpperCase} }, "{ {basePath} }", "{ {path} }", { {#consumes.0} }"{ {mediaType} }"{ {/consumes.0} }{ {^consumes} }"application/json"{ {/consumes} })
19
- { {#authMethods} }{ {#isApiKey} }.withApiKey(apiKey, "{ {keyParamName} }", { {#isKeyInQuery} }QUERY{ {/isKeyInQuery} }{ {#isKeyInHeader} }HEADER{ {/isKeyInHeader} })
20
- { {/isApiKey} }{ {#isBasic} }.withCredentials(basicAuth)
21
- { {/isBasic} }{ {/authMethods} }{ {#bodyParam} }.withBody({ {paramName} })
22
- { {/bodyParam} }{ {#formParams} }.withFormParam({ {> paramCreation} })
23
- { {/formParams} }{ {#queryParams} }.withQueryParam({ {> paramCreation} })
24
- { {/queryParams} }{ {#pathParams} }.withPathParam({ {> paramCreation} })
25
- { {/pathParams} }{ {#headerParams} }.withHeaderParam({ {> paramCreation} })
26
- { {/headerParams} }{ {#responses} }{ {^isWildcard} }{ {#dataType} }.with{ {> responseState} }Response[{ {dataType} }]({ {code} })
27
- { {/dataType} }{ {^dataType} }.with{ {> responseState} }Response[Unit]({ {code} })
28
- { {/dataType} }{ {/isWildcard} }{ {/responses} }{ {#responses} }{ {#isWildcard} }{ {#dataType} }.withDefault{ {> responseState} }Response[{ {dataType} }]
29
- { {/dataType} }{ {^dataType} }.withDefault{ {> responseState} }Response[Unit]
30
- { {/dataType} }{ {/isWildcard} }{ {/responses} }{ {^responseHeaders.isEmpty} }
31
- object { {#fnCapitalize} }{ {operationId} }{ {/fnCapitalize} }Headers { {{#responseHeaders} }
32
- def { {name} }(r: ApiReturnWithHeaders) = r.get{ {^isContainer} }{ {baseType} }{ {/isContainer} }{ {#isContainer} }String{ {/isContainer} }Header("{ {baseName} }"){ {/responseHeaders} }
33
- }
34
- { {/responseHeaders.isEmpty} }
35
- { {/operation} }
13
+ {{#operation} }
14
+ { {#javadocRenderer} }
15
+ { {> javadoc} }
16
+ { {/javadocRenderer} }
17
+ def { {operationId} }({ {> methodParameters} }): ApiRequest[{ {> operationReturnType} }] =
18
+ ApiRequest[{ {> operationReturnType} }](ApiMethods.{ {httpMethod.toUpperCase} }, "{ {basePath} }", "{ {path} }", { {#consumes.0} }"{ {mediaType} }"{ {/consumes.0} }{ {^consumes} }"application/json"{ {/consumes} })
19
+ { {#authMethods} }{ {#isApiKey} }.withApiKey(apiKey, "{ {keyParamName} }", { {#isKeyInQuery} }QUERY{ {/isKeyInQuery} }{ {#isKeyInHeader} }HEADER{ {/isKeyInHeader} })
20
+ { {/isApiKey} }{ {#isBasic} }.withCredentials(basicAuth)
21
+ { {/isBasic} }{ {/authMethods} }{ {#bodyParam} }.withBody({ {paramName} })
22
+ { {/bodyParam} }{ {#formParams} }.withFormParam({ {> paramCreation} })
23
+ { {/formParams} }{ {#queryParams} }.withQueryParam({ {> paramCreation} })
24
+ { {/queryParams} }{ {#pathParams} }.withPathParam({ {> paramCreation} })
25
+ { {/pathParams} }{ {#headerParams} }.withHeaderParam({ {> paramCreation} })
26
+ { {/headerParams} }{ {#responses} }{ {^isWildcard} }{ {#dataType} }.with{ {> responseState} }Response[{ {dataType} }]({ {code} })
27
+ { {/dataType} }{ {^dataType} }.with{ {> responseState} }Response[Unit]({ {code} })
28
+ { {/dataType} }{ {/isWildcard} }{ {/responses} }{ {#responses} }{ {#isWildcard} }{ {#dataType} }.withDefault{ {> responseState} }Response[{ {dataType} }]
29
+ { {/dataType} }{ {^dataType} }.withDefault{ {> responseState} }Response[Unit]
30
+ { {/dataType} }{ {/isWildcard} }{ {/responses} }{ {^responseHeaders.isEmpty} }
31
+ object { {#fnCapitalize} }{ {operationId} }{ {/fnCapitalize} }Headers { {{#responseHeaders} }
32
+ def { {name} }(r: ApiReturnWithHeaders) = r.get{ {^isContainer} }{ {baseType} }{ {/isContainer} }{ {#isContainer} }String{ {/isContainer} }Header("{ {baseName} }"){ {/responseHeaders} }
33
+ }
34
+ { {/responseHeaders.isEmpty} }
35
+ { {/operation} }
36
36
37
- { {#unknownStatusCodes} }
38
- ApiInvoker.addCustomStatusCode({ {value} }, isSuccess = false)
39
- { {/unknownStatusCodes} }
37
+ { {#unknownStatusCodes} }
38
+ ApiInvoker.addCustomStatusCode({ {value} }, isSuccess = false)
39
+ { {/unknownStatusCodes} }
40
40
41
- }
41
+ }
42
42
43
43
{ {/operations} }
0 commit comments