@@ -63,26 +63,21 @@ public class {{classname}} {
63
63
}
64
64
65
65
{ {#operation} }
66
+ { {#contents} }
66
67
/**
67
- * Build call for { {operationId} }{ {#allParams } }
68
- * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/allParams } }
68
+ * Build call for { {operationId} }{ {#parameters } }
69
+ * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/parameters } }
69
70
* @param progressListener Progress listener
70
71
* @param progressRequestListener Progress request listener
71
72
* @return Call to execute
72
73
* @throws ApiException If fail to serialize the request body object
73
- { {#isDeprecated} }
74
- * @deprecated
75
- { {/isDeprecated} }
76
74
{ {#externalDocs} }
77
75
* { {description} }
78
76
* @see <a href =" { { url} } " >{ {summary} } Documentation</a >
79
77
{ {/externalDocs} }
80
78
*/
81
- { {#isDeprecated} }
82
- @Deprecated
83
- { {/isDeprecated} }
84
- public okhttp3.Call { {operationId} }Call({ {#allParams} }{ {{dataType} }} { {paramName} }, { {/allParams} }final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
85
- Object {{localVariablePrefix} }localVarPostBody = { {#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }null{ {/bodyParam} };
79
+ public okhttp3.Call { {operationId} }Call({ {#parameters} }{ {{dataType} }} { {paramName} }, { {/parameters} }final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
80
+ Object {{localVariablePrefix} }localVarPostBody = { {^isForm} }{ {#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }null{ {/bodyParam} }{ {/isForm} }{ {#isForm} }null{ {/isForm} };
86
81
87
82
// create path and map variables
88
83
String { {localVariablePrefix} }localVarPath = "{ {{path} }}"{ {#pathParams} }
@@ -97,9 +92,13 @@ public class {{classname}} {
97
92
if ({ {paramName} } != null)
98
93
{ {localVariablePrefix} }localVarHeaderParams.put("{ {baseName} }", { {localVariablePrefix} }apiClient.parameterToString({ {paramName} }));{ {/headerParams} }
99
94
100
- { {javaUtilPrefix} }Map<String , Object > { {localVariablePrefix} }localVarFormParams = new { {javaUtilPrefix} }HashMap<String , Object >();{ {#formParams} }
95
+ { {javaUtilPrefix} }Map<String , Object > { {localVariablePrefix} }localVarFormParams = new { {javaUtilPrefix} }HashMap<String , Object >();
96
+ { {#isForm} }
97
+ { {#formParams} }
101
98
if ({ {paramName} } != null)
102
- { {localVariablePrefix} }localVarFormParams.put("{ {baseName} }", { {paramName} });{ {/formParams} }
99
+ { {localVariablePrefix} }localVarFormParams.put("{ {baseName} }", { {paramName} });
100
+ { {/formParams} }
101
+ { {/isForm} }
103
102
104
103
final String[] { {localVariablePrefix} }localVarAccepts = {
105
104
{{#produces} }"{ {{mediaType} }}"{ {#hasMore} }, { {/hasMore} }{ {/produces} }
@@ -133,16 +132,16 @@ public class {{classname}} {
133
132
@Deprecated
134
133
{ {/isDeprecated} }
135
134
@SuppressWarnings("rawtypes")
136
- private okhttp3.Call { {operationId} }ValidateBeforeCall({ {#allParams } }{ {{dataType} }} { {paramName} }, { {/allParams } }final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
135
+ private okhttp3.Call { {operationId} }ValidateBeforeCall({ {#parameters } }{ {{dataType} }} { {paramName} }, { {/parameters } }final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
137
136
{{^performBeanValidation} }
138
- { {#allParams } }{ {#required} }
137
+ { {#parameters } }{ {#required} }
139
138
// verify the required parameter '{ {paramName} }' is set
140
139
if ({ {paramName} } == null) {
141
140
throw new ApiException(" Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)" );
142
141
}
143
- { {/required} }{ {/allParams } }
142
+ { {/required} }{ {/parameters } }
144
143
145
- okhttp3.Call { {localVariablePrefix} }call = { {operationId} }Call({ {#allParams } }{ {paramName} }, { {/allParams } }progressListener, progressRequestListener);
144
+ okhttp3.Call { {localVariablePrefix} }call = { {operationId} }Call({ {#parameters } }{ {paramName} }, { {/parameters } }progressListener, progressRequestListener);
146
145
return { {localVariablePrefix} }call;
147
146
148
147
{ {/performBeanValidation} }
@@ -151,13 +150,13 @@ public class {{classname}} {
151
150
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
152
151
ExecutableValidator executableValidator = factory.getValidator().forExecutables();
153
152
154
- Object[] parameterValues = { {{#allParams } }{ {paramName} }{ {#hasMore } }, { {/hasMore } }{ {/allParams } } };
155
- Method method = this.getClass().getMethod("{ {operationId} }WithHttpInfo"{ {#allParams } }, { {#isListContainer } }java.util.List{ {/isListContainer } }{ {#isMapContainer } }java.util.Map{ {/isMapContainer } }{ {^isListContainer } }{ {^isMapContainer } }{ {{dataType} }}{ {/isMapContainer } }{ {/isListContainer } }.class{ {/allParams } });
153
+ Object[] parameterValues = { {{#parameters } }{ {paramName} }{ {#has this ' more ' } }, { {/has } }{ {/parameters } } };
154
+ Method method = this.getClass().getMethod("{ {operationId} }WithHttpInfo"{ {#parameters } }, { {#is this ' list-container ' } }java.util.List{ {/is } }{ {#is this ' map-container ' } }java.util.Map{ {/is } }{ {#isNot this ' list-container ' } }{ {#isNot this ' map-container ' } }{ {{dataType} }}{ {/isNot } }{ {/isNot } }.class{ {/parameters } });
156
155
Set<ConstraintViolation <{ { classname} } >> violations = executableValidator.validateParameters(this, method,
157
156
parameterValues);
158
157
159
158
if (violations.size() == 0) {
160
- okhttp3.Call {{localVariablePrefix} }call = { {operationId} }Call({ {#allParams } }{ {paramName} }, { {/allParams } }progressListener, progressRequestListener);
159
+ okhttp3.Call {{localVariablePrefix} }call = { {operationId} }Call({ {#parameters } }{ {paramName} }, { {/parameters } }progressListener, progressRequestListener);
161
160
return { {localVariablePrefix} }call;
162
161
163
162
} else {
@@ -176,68 +175,50 @@ public class {{classname}} {
176
175
177
176
/**
178
177
* { {summary} }
179
- * { {notes} }{ {#allParams } }
180
- * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/allParams } }{ {#returnType} }
178
+ * { {notes} }{ {#parameters } }
179
+ * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/parameters } }{ {#returnType} }
181
180
* @return { {returnType} }{ {/returnType} }
182
181
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
183
- { {#isDeprecated} }
184
- * @deprecated
185
- { {/isDeprecated} }
186
182
{ {#externalDocs} }
187
183
* { {description} }
188
184
* @see <a href =" { { url} } " >{ {summary} } Documentation</a >
189
185
{ {/externalDocs} }
190
186
*/
191
- { {#isDeprecated} }
192
- @Deprecated
193
- { {/isDeprecated} }
194
- public { {#returnType} }{ {{returnType} }} { {/returnType} }{ {^returnType} }void { {/returnType} }{ {operationId} }({ {#allParams} }{ {{dataType} }} { {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} }) throws ApiException {
195
- {{#returnType} }ApiResponse<{ {{returnType} }}> { {localVariablePrefix} }resp = { {/returnType} }{ {operationId} }WithHttpInfo({ {#allParams} }{ {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} });{ {#returnType} }
187
+ public { {#returnType} }{ {{returnType} }} { {/returnType} }{ {^returnType} }void { {/returnType} }{ {operationId} }({ {#parameters} }{ {{dataType} }} { {paramName} }{ {#has this ' more' } }, { {/has} }{ {/parameters} }) throws ApiException {
188
+ {{#returnType} }ApiResponse<{ {{returnType} }}> { {localVariablePrefix} }resp = { {/returnType} }{ {operationId} }WithHttpInfo({ {#parameters} }{ {paramName} }{ {#has this ' more' } }, { {/has} }{ {/parameters} });{ {#returnType} }
196
189
return { {localVariablePrefix} }resp.getData();{ {/returnType} }
197
190
}
198
191
199
192
/**
200
193
* { {summary} }
201
- * { {notes} }{ {#allParams } }
202
- * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/allParams } }
194
+ * { {notes} }{ {#parameters } }
195
+ * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/parameters } }
203
196
* @return ApiResponse< ; { {#returnType} }{ {returnType} }{ {/returnType} }{ {^returnType} }Void{ {/returnType} }> ;
204
197
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
205
- { {#isDeprecated} }
206
- * @deprecated
207
- { {/isDeprecated} }
208
198
{ {#externalDocs} }
209
199
* { {description} }
210
200
* @see <a href =" { { url} } " >{ {summary} } Documentation</a >
211
201
{ {/externalDocs} }
212
202
*/
213
- { {#isDeprecated} }
214
- @Deprecated
215
- { {/isDeprecated} }
216
- public ApiResponse<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }Void{ {/returnType} }> { {operationId} }WithHttpInfo({ {#allParams} }{ {#useBeanValidation} }{ {> beanValidationQueryParams} }{ {/useBeanValidation} }{ {{dataType} }} { {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} }) throws ApiException {
217
- okhttp3.Call {{localVariablePrefix} }call = { {operationId} }ValidateBeforeCall({ {#allParams} }{ {paramName} }, { {/allParams} }null, null);
203
+ public ApiResponse<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }Void{ {/returnType} }> { {operationId} }WithHttpInfo({ {#parameters} }{ {#if useBeanValidation} }{ {> beanValidationQueryParams} }{ {/if } }{ {{dataType} }} { {paramName} }{ {#has this ' more' } }, { {/has} }{ {/parameters} }) throws ApiException {
204
+ okhttp3.Call {{localVariablePrefix} }call = { {operationId} }ValidateBeforeCall({ {#parameters} }{ {paramName} }, { {/parameters} }null, null);
218
205
{ {#returnType} }Type { {localVariablePrefix} }localVarReturnType = new TypeToken<{ {{returnType} }}>(){ } .getType();
219
206
return { {localVariablePrefix} }apiClient.execute({ {localVariablePrefix} }call, { {localVariablePrefix} }localVarReturnType);{ {/returnType} }{ {^returnType} }return { {localVariablePrefix} }apiClient.execute({ {localVariablePrefix} }call);{ {/returnType} }
220
207
}
221
208
222
209
/**
223
210
* { {summary} } (asynchronously)
224
- * { {notes} }{ {#allParams } }
225
- * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/allParams } }
211
+ * { {notes} }{ {#parameters } }
212
+ * @param { {paramName} } { {description} }{ {#required} } (required){ {/required} }{ {^required} } (optional{ {#defaultValue} }, default to { {{.} }}{ {/defaultValue} }){ {/required} }{ {/parameters } }
226
213
* @param callback The callback to be executed when the API call finishes
227
214
* @return The request call
228
215
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
229
- { {#isDeprecated} }
230
- * @deprecated
231
- { {/isDeprecated} }
232
216
{ {#externalDocs} }
233
217
* { {description} }
234
218
* @see <a href =" { { url} } " >{ {summary} } Documentation</a >
235
219
{ {/externalDocs} }
236
220
*/
237
- { {#isDeprecated} }
238
- @Deprecated
239
- { {/isDeprecated} }
240
- public okhttp3.Call { {operationId} }Async({ {#allParams} }{ {{dataType} }} { {paramName} }, { {/allParams} }final ApiCallback<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }Void{ {/returnType} }> callback) throws ApiException {
221
+ public okhttp3.Call { {operationId} }Async({ {#parameters} }{ {{dataType} }} { {paramName} }, { {/parameters} }final ApiCallback<{ {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }Void{ {/returnType} }> { {localVariablePrefix} }callback) throws ApiException {
241
222
242
223
ProgressResponseBody.ProgressListener progressListener = null;
243
224
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
@@ -258,11 +239,12 @@ public class {{classname}} {
258
239
};
259
240
}
260
241
261
- okhttp3.Call { {localVariablePrefix} }call = { {operationId} }ValidateBeforeCall({ {#allParams } }{ {paramName} }, { {/allParams } }progressListener, progressRequestListener);
242
+ okhttp3.Call { {localVariablePrefix} }call = { {operationId} }ValidateBeforeCall({ {#parameters } }{ {paramName} }, { {/parameters } }progressListener, progressRequestListener);
262
243
{ {#returnType} }Type { {localVariablePrefix} }localVarReturnType = new TypeToken<{ {{returnType} }}>(){ } .getType();
263
- { {localVariablePrefix} }apiClient.executeAsync({ {localVariablePrefix} }call, { {localVariablePrefix} }localVarReturnType, callback);{ {/returnType} }{ {^returnType} }{ {localVariablePrefix} }apiClient.executeAsync({ {localVariablePrefix} }call, callback);{ {/returnType} }
244
+ { {localVariablePrefix} }apiClient.executeAsync({ {localVariablePrefix} }call, { {localVariablePrefix} }localVarReturnType, { {localVariablePrefix } } callback);{ {/returnType} }{ {^returnType} }{ {localVariablePrefix} }apiClient.executeAsync({ {localVariablePrefix} }call, { {localVariablePrefix } } callback);{ {/returnType} }
264
245
return { {localVariablePrefix} }call;
265
246
}
247
+ { {/contents} }
266
248
{ {/operation} }
267
249
}
268
250
{ {/operations} }
0 commit comments