@@ -4,11 +4,13 @@ import {{invokerPackage}}.ApiClient;
4
4
5
5
{ {#imports} }import { {import} };
6
6
{ {/imports} }
7
+ { {^fullJavaUtil} }
7
8
8
- { {^fullJavaUtil } } import java.util.HashMap;
9
+ import java.util.HashMap;
9
10
import java.util.List;
10
11
import java.util.Locale;
11
- import java.util.Map;{ {/fullJavaUtil} }
12
+ import java.util.Map;
13
+ { {/fullJavaUtil} }
12
14
13
15
import org.springframework.beans.factory.annotation.Autowired;
14
16
import org.springframework.util.LinkedMultiValueMap;
@@ -62,49 +64,68 @@ public class {{classname}} {
62
64
*/
63
65
public { {#returnType} }{ {#isListContainer} }Flux<{ {{returnBaseType} }}>{ {/isListContainer} }{ {^isListContainer} }Mono<{ {{returnType} }}>{ {/isListContainer} } { {/returnType} }{ {^returnType} }Mono<Void > { {/returnType} }{ {operationId} }({ {#allParams} }{ {{dataType} }} { {paramName} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} }) throws RestClientException {
64
66
Object postBody = {{#bodyParam} }{ {paramName} }{ {/bodyParam} }{ {^bodyParam} }null{ {/bodyParam} };
65
- { {#allParams} }{ {#required} }
67
+ { {#allParams} }
68
+ { {#required} }
66
69
// verify the required parameter '{ {paramName} }' is set
67
70
if ({ {paramName} } == null) {
68
71
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, " Missing the required parameter '{{paramName}}' when calling {{operationId}}" );
69
72
}
70
- { {/required} }{ {/allParams} }
73
+ { {/required} }
74
+ { {/allParams} }
71
75
// create path and map variables
72
- final Map<String , Object > pathParams = new HashMap<String , Object >();{ {#hasPathParams } } { {#pathParams } }
73
- pathParams.put(" { {baseName } }", { {#collectionFormat } }apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), { {/collectionFormat } } { {{paramName } }} { {#collectionFormat } }) { {/collectionFormat } }); { {/pathParams } } { {/ hasPathParams} }
76
+ final Map<String , Object > pathParams = new HashMap<String , Object >();
77
+ { {# hasPathParams} }
74
78
79
+ { {#pathParams} }
80
+ pathParams.put("{ {baseName} }", { {#collectionFormat} }apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), { {/collectionFormat} }{ {{paramName} }}{ {#collectionFormat} }){ {/collectionFormat} });
81
+ { {/pathParams} }
82
+ { {/hasPathParams} }
75
83
76
84
final MultiValueMap<String , String > queryParams = new LinkedMultiValueMap<String , String >();
77
85
final HttpHeaders headerParams = new HttpHeaders();
78
86
final MultiValueMap<String , String > cookieParams = new LinkedMultiValueMap<String , String >();
79
- final MultiValueMap<String , Object > formParams = new LinkedMultiValueMap<String , Object >();{ {#hasQueryParams} }
87
+ final MultiValueMap<String , Object > formParams = new LinkedMultiValueMap<String , Object >();
88
+ { {#hasQueryParams} }
80
89
81
- { {#queryParams} }queryParams.putAll(apiClient.parameterToMultiValueMap({ {#collectionFormat} }ApiClient.CollectionFormat.valueOf("{ {{collectionFormat} }}".toUpperCase(Locale.ROOT)){ {/collectionFormat} }{ {^collectionFormat} }null{ {/collectionFormat} }, "{ {baseName} }", { {paramName} }));{ {#hasMore} }
82
- { {/hasMore} }{ {/queryParams} }{ {/hasQueryParams} }{ {#hasHeaderParams} }
90
+ { {#queryParams} }
91
+ queryParams.putAll(apiClient.parameterToMultiValueMap({ {#collectionFormat} }ApiClient.CollectionFormat.valueOf("{ {{collectionFormat} }}".toUpperCase(Locale.ROOT)){ {/collectionFormat} }{ {^collectionFormat} }null{ {/collectionFormat} }, "{ {baseName} }", { {paramName} }));
92
+ { {/queryParams} }
93
+ { {/hasQueryParams} }
94
+ { {#hasHeaderParams} }
83
95
84
- { {#headerParams} }if ({ {paramName} } != null)
96
+ { {#headerParams} }
97
+ if ({ {paramName} } != null)
85
98
headerParams.add("{ {baseName} }", apiClient.parameterToString({ {paramName} }));{ {#hasMore} }
86
- { {/hasMore} }{ {/headerParams} }{ {/hasHeaderParams} }{ {#hasCookieParams} }
87
-
88
- { {#cookieParams} }cookieParams.putAll(apiClient.parameterToMultiValueMap({ {#collectionFormat} }ApiClient.CollectionFormat.valueOf("{ {{collectionFormat} }}".toUpperCase(Locale.ROOT)){ {/collectionFormat} }{ {^collectionFormat} }null{ {/collectionFormat} }, "{ {baseName} }", { {paramName} }));{ {#hasMore} }
89
- { {/hasMore} }{ {/cookieParams} }{ {/hasCookieParams} }{ {#hasFormParams} }
90
-
91
- { {#formParams} }if ({ {paramName} } != null)
92
- formParams.add{ {#collectionFormat} }All{ {/collectionFormat} }("{ {baseName} }", { {#isFile} }new FileSystemResource({ {paramName} }){ {/isFile} }{ {^isFile} }{ {paramName} }{ {/isFile} });{ {#hasMore} }
93
- { {/hasMore} }{ {/formParams} }{ {/hasFormParams} }
94
-
95
- final String[] accepts = { {{#hasProduces} }
99
+ { {/hasMore} }
100
+ { {/headerParams} }
101
+ { {/hasHeaderParams} }
102
+ { {#hasCookieParams} }
103
+
104
+ { {#cookieParams} }
105
+ cookieParams.putAll(apiClient.parameterToMultiValueMap({ {#collectionFormat} }ApiClient.CollectionFormat.valueOf("{ {{collectionFormat} }}".toUpperCase(Locale.ROOT)){ {/collectionFormat} }{ {^collectionFormat} }null{ {/collectionFormat} }, "{ {baseName} }", { {paramName} }));
106
+ { {/cookieParams} }
107
+ { {/hasCookieParams} }
108
+ { {#hasFormParams} }
109
+
110
+ { {#formParams} }
111
+ if ({ {paramName} } != null)
112
+ formParams.add{ {#collectionFormat} }All{ {/collectionFormat} }("{ {baseName} }", { {#isFile} }new FileSystemResource({ {paramName} }){ {/isFile} }{ {^isFile} }{ {paramName} }{ {/isFile} });
113
+ { {/formParams} }
114
+ { {/hasFormParams} }
115
+
116
+ final String[] localVarAccepts = { {{#hasProduces} }
96
117
{ {#produces} }"{ {{mediaType} }}"{ {#hasMore} }, { {/hasMore} }{ {/produces} }
97
118
{ {/hasProduces} }};
98
- final List<MediaType > accept = apiClient.selectHeaderAccept(accepts );
99
- final String[] contentTypes = { {{#hasConsumes} }
119
+ final List<MediaType > localVarAccept = apiClient.selectHeaderAccept(localVarAccepts );
120
+ final String[] localVarContentTypes = { {{#hasConsumes} }
100
121
{ {#consumes} }"{ {{mediaType} }}"{ {#hasMore} }, { {/hasMore} }{ {/consumes} }
101
122
{ {/hasConsumes} }};
102
- final MediaType contentType = apiClient.selectHeaderContentType(contentTypes );
123
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes );
103
124
104
- String[] authNames = new String[] { {{#authMethods} }"{ {name} }"{ {#hasMore} }, { {/hasMore} }{ {/authMethods} } };
125
+ String[] localVarAuthNames = new String[] { {{#authMethods} }"{ {name} }"{ {#hasMore} }, { {/hasMore} }{ {/authMethods} } };
105
126
106
- { {#returnType} }ParameterizedTypeReference<{ {#isListContainer} }{ {{returnBaseType} }}{ {/isListContainer} }{ {^isListContainer} }{ {{returnType} }}{ {/isListContainer} }> returnType = new ParameterizedTypeReference<{ {#isListContainer} }{ {{returnBaseType} }}{ {/isListContainer} }{ {^isListContainer} }{ {{returnType} }}{ {/isListContainer} }>() { } ;{ {/returnType} }{ {^returnType} }ParameterizedTypeReference<Void > returnType = new ParameterizedTypeReference<Void >() { } ;{ {/returnType} }
107
- return apiClient.{ {#isListContainer} }invokeFluxAPI{ {/isListContainer} }{ {^isListContainer} }invokeAPI{ {/isListContainer} }("{ {{path} }}", HttpMethod.{ {httpMethod} }, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType );
127
+ { {#returnType} }ParameterizedTypeReference<{ {#isListContainer} }{ {{returnBaseType} }}{ {/isListContainer} }{ {^isListContainer} }{ {{returnType} }}{ {/isListContainer} }> localVarReturnType = new ParameterizedTypeReference<{ {#isListContainer} }{ {{returnBaseType} }}{ {/isListContainer} }{ {^isListContainer} }{ {{returnType} }}{ {/isListContainer} }>() { } ;{ {/returnType} }{ {^returnType} }ParameterizedTypeReference<Void > localVarReturnType = new ParameterizedTypeReference<Void >() { } ;{ {/returnType} }
128
+ return apiClient.{ {#isListContainer} }invokeFluxAPI{ {/isListContainer} }{ {^isListContainer} }invokeAPI{ {/isListContainer} }("{ {{path} }}", HttpMethod.{ {httpMethod} }, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType );
108
129
}
109
130
{ {/operation} }
110
131
}
0 commit comments