@@ -23,6 +23,7 @@ import org.springframework.http.HttpHeaders;
23
23
import org.springframework.http.HttpMethod;
24
24
import org.springframework.http.HttpStatus;
25
25
import org.springframework.http.MediaType;
26
+ import org.springframework.http.ResponseEntity;
26
27
27
28
{ {> generatedAnnotation} }
28
29
@Component("{ {package} }.{ {classname} }")
@@ -51,16 +52,53 @@ public class {{classname}} {
51
52
/**
52
53
* { {summary} }
53
54
* { {notes} }
54
- { {#responses} } * <p ><b >{ {code} }</b >{ {#message} } - { {message} }{ {/message} }
55
- { {/responses} }{ {#allParams} } * @param { {paramName} } { {description} }{ {^description} }The { {paramName} } parameter{ {/description} }
56
- { {/allParams} }{ {#returnType} } * @return { {returnType} }
57
- { {/returnType} } * @throws RestClientException if an error occurs while attempting to invoke the API
58
- { {#externalDocs} }
59
- * { {description} }
60
- * @see <a href =" { { url} } " >{ {summary} } Documentation</a >
61
- { {/externalDocs} }
55
+ { {#responses} }
56
+ * <p ><b >{ {code} }</b >{ {#message} } - { {message} }{ {/message} }
57
+ { {/responses} }
58
+ { {#allParams} }
59
+ * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }
60
+ { {/allParams} }
61
+ { {#returnType} }
62
+ * @return { {returnType} }
63
+ { {/returnType} }
64
+ * @throws RestClientException if an error occurs while attempting to invoke the API
65
+ { {#externalDocs} }
66
+ * { {description} }
67
+ * @see <a href =" { { url} } " >{ {summary} } Documentation</a >
68
+ { {/externalDocs} }
62
69
*/
70
+ { {#isDeprecated} }
71
+ @Deprecated
72
+ { {/isDeprecated} }
63
73
public { {#returnType} }{ {{returnType} }} { {/returnType} }{ {^returnType} }void { {/returnType} }{ {operationId} }({ {#allParams} }{ {{dataType} }} { {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} }) throws RestClientException {
74
+ {{#returnType} }
75
+ return { {operationId} }WithHttpInfo({ {#allParams} }{ {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} }).getBody();
76
+ { {/returnType} }
77
+ { {^returnType} }
78
+ { {operationId} }WithHttpInfo({ {#allParams} }{ {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} });
79
+ { {/returnType} }
80
+ }
81
+
82
+ /**
83
+ * { {summary} }
84
+ * { {notes} }
85
+ { {#responses} }
86
+ * <p ><b >{ {code} }</b >{ {#message} } - { {message} }{ {/message} }
87
+ { {/responses} }
88
+ { {#allParams} }
89
+ * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }
90
+ { {/allParams} }
91
+ * @return ResponseEntity< ; { {#returnType} }{ {returnType} }{ {/returnType} }{ {^returnType} }Void{ {/returnType} }> ;
92
+ * @throws RestClientException if an error occurs while attempting to invoke the API
93
+ { {#externalDocs} }
94
+ * { {description} }
95
+ * @see <a href =" { { url} } " >{ {summary} } Documentation</a >
96
+ { {/externalDocs} }
97
+ */
98
+ { {#isDeprecated} }
99
+ @Deprecated
100
+ { {/isDeprecated} }
101
+ public ResponseEntity<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }Void{ {/returnType} }> { {operationId} }WithHttpInfo({ {#allParams} }{ {{dataType} }} { {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} }) throws RestClientException {
64
102
Object {{localVariablePrefix} }postBody = { {#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }null{ {/bodyParam} };
65
103
{ {#allParams} }{ {#required} }
66
104
// verify the required parameter '{ {paramName} }' is set
@@ -72,18 +110,18 @@ public class {{classname}} {
72
110
final Map<String , Object > uriVariables = new HashMap<String , Object >();{ {#pathParams} }
73
111
uriVariables.put("{ {baseName} }", { {{paramName} }});{ {/pathParams} }{ {/hasPathParams} }
74
112
String { {localVariablePrefix} }path = UriComponentsBuilder.fromPath("{ {{path} }}"){ {#hasPathParams} }.buildAndExpand(uriVariables){ {/hasPathParams} }{ {^hasPathParams} }.build(){ {/hasPathParams} }.toUriString();
75
-
113
+
76
114
final MultiValueMap<String , String > { {localVariablePrefix} }queryParams = new LinkedMultiValueMap<String , String >();
77
115
final HttpHeaders { {localVariablePrefix} }headerParams = new HttpHeaders();
78
116
final MultiValueMap<String , Object > { {localVariablePrefix} }formParams = new LinkedMultiValueMap<String , Object >();{ {#hasQueryParams} }
79
-
117
+
80
118
{ {#queryParams} }{ {localVariablePrefix} }queryParams.putAll({ {localVariablePrefix} }apiClient.parameterToMultiValueMap({ {#collectionFormat} }ApiClient.CollectionFormat.valueOf("{ {{collectionFormat} }}".toUpperCase()){ {/collectionFormat} }{ {^collectionFormat} }null{ {/collectionFormat} }, "{ {baseName} }", { {paramName} }));{ {#hasMore} }
81
119
{ {/hasMore} }{ {/queryParams} }{ {/hasQueryParams} }{ {#hasHeaderParams} }
82
-
120
+
83
121
{ {#headerParams} }if ({ {paramName} } != null)
84
122
{ {localVariablePrefix} }headerParams.add("{ {baseName} }", { {localVariablePrefix} }apiClient.parameterToString({ {paramName} }));{ {#hasMore} }
85
123
{ {/hasMore} }{ {/headerParams} }{ {/hasHeaderParams} }{ {#hasFormParams} }
86
-
124
+
87
125
{ {#formParams} }if ({ {paramName} } != null)
88
126
{ {localVariablePrefix} }formParams.add("{ {baseName} }", { {#isFile} }new FileSystemResource({ {paramName} }){ {/isFile} }{ {^isFile} }{ {paramName} }{ {/isFile} });{ {#hasMore} }
89
127
{ {/hasMore} }{ {/formParams} }{ {/hasFormParams} }
@@ -100,7 +138,7 @@ public class {{classname}} {
100
138
String[] { {localVariablePrefix} }authNames = new String[] { {{#authMethods} }"{ {name} }"{ {#hasMore} }, { {/hasMore} }{ {/authMethods} } };
101
139
102
140
{ {#returnType} }ParameterizedTypeReference<{ {{returnType} }}> { {localVariablePrefix} }returnType = new ParameterizedTypeReference<{ {{returnType} }}>() { } ;{ {/returnType} }{ {^returnType} }ParameterizedTypeReference<Void > { {localVariablePrefix} }returnType = new ParameterizedTypeReference<Void >() { } ;{ {/returnType} }
103
- { {#returnType } } return { {/returnType } } { {localVariablePrefix} }apiClient.invokeAPI({ {localVariablePrefix} }path, HttpMethod.{ {httpMethod} }, { {localVariablePrefix} }queryParams, { {localVariablePrefix} }postBody, { {localVariablePrefix} }headerParams, { {localVariablePrefix} }formParams, { {localVariablePrefix} }accept, { {localVariablePrefix} }contentType, { {localVariablePrefix} }authNames, { {localVariablePrefix} }returnType);
141
+ return { {localVariablePrefix} }apiClient.invokeAPI({ {localVariablePrefix} }path, HttpMethod.{ {httpMethod} }, { {localVariablePrefix} }queryParams, { {localVariablePrefix} }postBody, { {localVariablePrefix} }headerParams, { {localVariablePrefix} }formParams, { {localVariablePrefix} }accept, { {localVariablePrefix} }contentType, { {localVariablePrefix} }authNames, { {localVariablePrefix} }returnType);
104
142
}
105
143
{ {/operation} }
106
144
}
0 commit comments