[Java][WebClient] add ResponseEntity return for webclient (#9327)

* feat: add ResponseEntity return for webclient

fix: #5599

* refactor: merge functions

simplification to avoir duplicated code
This commit is contained in:
Guillaume TOURBIER 2021-06-18 10:03:38 +02:00 committed by GitHub
parent c7038d1b57
commit 95a11a7f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 788 additions and 89 deletions

1
.gitattributes vendored
View File

@ -1 +1,2 @@
**/*.mustache linguist-vendored=true
* text=auto eol=lf

View File

@ -31,6 +31,7 @@ import org.springframework.http.client.reactive.ClientHttpRequest;
import org.springframework.web.client.RestClientException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.BodyInserter;
import org.springframework.web.reactive.function.BodyInserters;
@ -604,31 +605,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* @param returnType The return type into which to deserialize the response
* @return The response body in chosen type
*/
public <T> Mono<T> invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
public <T> ResponseSpec invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
return requestBuilder.retrieve().bodyToMono(returnType);
}
/**
* Invoke API by sending HTTP request with the given options.
*
* @param <T> the return type to use
* @param path The sub-path of the HTTP URL
* @param method The request method
* @param pathParams The path parameters
* @param queryParams The query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param formParams The form parameters
* @param accept The request's Accept header
* @param contentType The request's Content-Type header
* @param authNames The authentications to apply
* @param returnType The return type into which to deserialize the response
* @return The response body in chosen type
*/
public <T> Flux<T> invokeFluxAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
return requestBuilder.retrieve().bodyToFlux(returnType);
return requestBuilder.retrieve();
}
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames) {

View File

@ -18,12 +18,14 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@ -62,7 +64,7 @@ public class {{classname}} {
* @see <a href="{{url}}">{{summary}} Documentation</a>
{{/externalDocs}}
*/
public {{#returnType}}{{#isArray}}Flux<{{{returnBaseType}}}>{{/isArray}}{{^isArray}}Mono<{{{returnType}}}>{{/isArray}} {{/returnType}}{{^returnType}}Mono<Void> {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException {
private ResponseSpec {{operationId}}RequestCreation({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException {
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
{{#allParams}}
{{#required}}
@ -125,7 +127,29 @@ public class {{classname}} {
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
{{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};{{/returnType}}
return apiClient.{{#isArray}}invokeFluxAPI{{/isArray}}{{^isArray}}invokeAPI{{/isArray}}("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* {{summary}}
* {{notes}}
{{#responses}} * <p><b>{{code}}</b>{{#message}} - {{message}}{{/message}}
{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}
{{/allParams}}{{#returnType}} * @return {{returnType}}
{{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API
{{#externalDocs}}
* {{description}}
* @see <a href="{{url}}">{{summary}} Documentation</a>
{{/externalDocs}}
*/
public {{#returnType}}{{#isArray}}Flux<{{{returnBaseType}}}>{{/isArray}}{{^isArray}}Mono<{{{returnType}}}>{{/isArray}} {{/returnType}}{{^returnType}}Mono<Void> {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException {
{{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};{{/returnType}}
return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}bodyToFlux{{/isArray}}{{^isArray}}bodyToMono{{/isArray}}(localVarReturnType);
}
public {{#returnType}}{{#isArray}}Mono<ResponseEntity<List<{{{returnBaseType}}}>>>{{/isArray}}{{^isArray}}Mono<ResponseEntity<{{{returnType}}}>>{{/isArray}} {{/returnType}}{{^returnType}}Mono<ResponseEntity<Void>> {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException {
{{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};{{/returnType}}
return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}toEntityList{{/isArray}}{{^isArray}}toEntity{{/isArray}}(localVarReturnType);
}
{{/operation}}
}

View File

@ -29,6 +29,7 @@ import org.springframework.http.client.reactive.ClientHttpRequest;
import org.springframework.web.client.RestClientException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.BodyInserter;
import org.springframework.web.reactive.function.BodyInserters;
@ -589,31 +590,9 @@ public class ApiClient extends JavaTimeFormatter {
* @param returnType The return type into which to deserialize the response
* @return The response body in chosen type
*/
public <T> Mono<T> invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
public <T> ResponseSpec invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
return requestBuilder.retrieve().bodyToMono(returnType);
}
/**
* Invoke API by sending HTTP request with the given options.
*
* @param <T> the return type to use
* @param path The sub-path of the HTTP URL
* @param method The request method
* @param pathParams The path parameters
* @param queryParams The query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param formParams The form parameters
* @param accept The request's Accept header
* @param contentType The request's Content-Type header
* @param authNames The authentications to apply
* @param returnType The return type into which to deserialize the response
* @return The response body in chosen type
*/
public <T> Flux<T> invokeFluxAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
return requestBuilder.retrieve().bodyToFlux(returnType);
return requestBuilder.retrieve();
}
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames) {

View File

@ -15,12 +15,14 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@ -53,7 +55,7 @@ public class AnotherFakeApi {
* @return Client
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> call123testSpecialTags(Client body) throws WebClientResponseException {
private ResponseSpec call123testSpecialTagsRequestCreation(Client body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -81,4 +83,22 @@ public class AnotherFakeApi {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* To test special tags
* To test special tags and operation ID starting with number
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> call123testSpecialTags(Client body) throws WebClientResponseException {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return call123testSpecialTagsRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Client>> call123testSpecialTagsWithHttpInfo(Client body) throws WebClientResponseException {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return call123testSpecialTagsRequestCreation(body).toEntity(localVarReturnType);
}
}

View File

@ -23,12 +23,14 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@ -60,7 +62,7 @@ public class FakeApi {
* @param xmlItem XmlItem Body
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createXmlItem(XmlItem xmlItem) throws WebClientResponseException {
private ResponseSpec createXmlItemRequestCreation(XmlItem xmlItem) throws WebClientResponseException {
Object postBody = xmlItem;
// verify the required parameter 'xmlItem' is set
if (xmlItem == null) {
@ -86,6 +88,23 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* creates an XmlItem
* this route creates an XmlItem
* <p><b>200</b> - successful operation
* @param xmlItem XmlItem Body
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createXmlItem(XmlItem xmlItem) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createXmlItemRequestCreation(xmlItem).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> createXmlItemWithHttpInfo(XmlItem xmlItem) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createXmlItemRequestCreation(xmlItem).toEntity(localVarReturnType);
}
/**
*
* Test serialization of outer boolean types
@ -94,7 +113,7 @@ public class FakeApi {
* @return Boolean
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Boolean> fakeOuterBooleanSerialize(Boolean body) throws WebClientResponseException {
private ResponseSpec fakeOuterBooleanSerializeRequestCreation(Boolean body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -116,6 +135,24 @@ public class FakeApi {
ParameterizedTypeReference<Boolean> localVarReturnType = new ParameterizedTypeReference<Boolean>() {};
return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Test serialization of outer boolean types
* <p><b>200</b> - Output boolean
* @param body Input boolean as post body
* @return Boolean
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Boolean> fakeOuterBooleanSerialize(Boolean body) throws WebClientResponseException {
ParameterizedTypeReference<Boolean> localVarReturnType = new ParameterizedTypeReference<Boolean>() {};
return fakeOuterBooleanSerializeRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Boolean>> fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws WebClientResponseException {
ParameterizedTypeReference<Boolean> localVarReturnType = new ParameterizedTypeReference<Boolean>() {};
return fakeOuterBooleanSerializeRequestCreation(body).toEntity(localVarReturnType);
}
/**
*
* Test serialization of object with outer number type
@ -124,7 +161,7 @@ public class FakeApi {
* @return OuterComposite
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<OuterComposite> fakeOuterCompositeSerialize(OuterComposite body) throws WebClientResponseException {
private ResponseSpec fakeOuterCompositeSerializeRequestCreation(OuterComposite body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -146,6 +183,24 @@ public class FakeApi {
ParameterizedTypeReference<OuterComposite> localVarReturnType = new ParameterizedTypeReference<OuterComposite>() {};
return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Test serialization of object with outer number type
* <p><b>200</b> - Output composite
* @param body Input composite as post body
* @return OuterComposite
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<OuterComposite> fakeOuterCompositeSerialize(OuterComposite body) throws WebClientResponseException {
ParameterizedTypeReference<OuterComposite> localVarReturnType = new ParameterizedTypeReference<OuterComposite>() {};
return fakeOuterCompositeSerializeRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<OuterComposite>> fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws WebClientResponseException {
ParameterizedTypeReference<OuterComposite> localVarReturnType = new ParameterizedTypeReference<OuterComposite>() {};
return fakeOuterCompositeSerializeRequestCreation(body).toEntity(localVarReturnType);
}
/**
*
* Test serialization of outer number types
@ -154,7 +209,7 @@ public class FakeApi {
* @return BigDecimal
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<BigDecimal> fakeOuterNumberSerialize(BigDecimal body) throws WebClientResponseException {
private ResponseSpec fakeOuterNumberSerializeRequestCreation(BigDecimal body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -176,6 +231,24 @@ public class FakeApi {
ParameterizedTypeReference<BigDecimal> localVarReturnType = new ParameterizedTypeReference<BigDecimal>() {};
return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Test serialization of outer number types
* <p><b>200</b> - Output number
* @param body Input number as post body
* @return BigDecimal
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<BigDecimal> fakeOuterNumberSerialize(BigDecimal body) throws WebClientResponseException {
ParameterizedTypeReference<BigDecimal> localVarReturnType = new ParameterizedTypeReference<BigDecimal>() {};
return fakeOuterNumberSerializeRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<BigDecimal>> fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws WebClientResponseException {
ParameterizedTypeReference<BigDecimal> localVarReturnType = new ParameterizedTypeReference<BigDecimal>() {};
return fakeOuterNumberSerializeRequestCreation(body).toEntity(localVarReturnType);
}
/**
*
* Test serialization of outer string types
@ -184,7 +257,7 @@ public class FakeApi {
* @return String
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<String> fakeOuterStringSerialize(String body) throws WebClientResponseException {
private ResponseSpec fakeOuterStringSerializeRequestCreation(String body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -206,6 +279,24 @@ public class FakeApi {
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Test serialization of outer string types
* <p><b>200</b> - Output string
* @param body Input string as post body
* @return String
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<String> fakeOuterStringSerialize(String body) throws WebClientResponseException {
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
return fakeOuterStringSerializeRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<String>> fakeOuterStringSerializeWithHttpInfo(String body) throws WebClientResponseException {
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
return fakeOuterStringSerializeRequestCreation(body).toEntity(localVarReturnType);
}
/**
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
@ -213,7 +304,7 @@ public class FakeApi {
* @param body The body parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testBodyWithFileSchema(FileSchemaTestClass body) throws WebClientResponseException {
private ResponseSpec testBodyWithFileSchemaRequestCreation(FileSchemaTestClass body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -239,6 +330,23 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
* <p><b>200</b> - Success
* @param body The body parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testBodyWithFileSchema(FileSchemaTestClass body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testBodyWithFileSchemaRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testBodyWithFileSchemaRequestCreation(body).toEntity(localVarReturnType);
}
/**
*
*
@ -247,7 +355,7 @@ public class FakeApi {
* @param body The body parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testBodyWithQueryParams(String query, User body) throws WebClientResponseException {
private ResponseSpec testBodyWithQueryParamsRequestCreation(String query, User body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'query' is set
if (query == null) {
@ -279,6 +387,24 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
*
* <p><b>200</b> - Success
* @param query The query parameter
* @param body The body parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testBodyWithQueryParams(String query, User body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testBodyWithQueryParamsRequestCreation(query, body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testBodyWithQueryParamsWithHttpInfo(String query, User body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testBodyWithQueryParamsRequestCreation(query, body).toEntity(localVarReturnType);
}
/**
* To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
@ -287,7 +413,7 @@ public class FakeApi {
* @return Client
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> testClientModel(Client body) throws WebClientResponseException {
private ResponseSpec testClientModelRequestCreation(Client body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -315,6 +441,24 @@ public class FakeApi {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return apiClient.invokeAPI("/fake", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> testClientModel(Client body) throws WebClientResponseException {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return testClientModelRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Client>> testClientModelWithHttpInfo(Client body) throws WebClientResponseException {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return testClientModelRequestCreation(body).toEntity(localVarReturnType);
}
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@ -336,7 +480,7 @@ public class FakeApi {
* @param paramCallback None
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws WebClientResponseException {
private ResponseSpec testEndpointParametersRequestCreation(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'number' is set
if (number == null) {
@ -403,6 +547,37 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* <p><b>400</b> - Invalid username supplied
* <p><b>404</b> - User not found
* @param number None
* @param _double None
* @param patternWithoutDelimiter None
* @param _byte None
* @param integer None
* @param int32 None
* @param int64 None
* @param _float None
* @param string None
* @param binary None
* @param date None
* @param dateTime None
* @param password None
* @param paramCallback None
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).toEntity(localVarReturnType);
}
/**
* To test enum parameters
* To test enum parameters
@ -418,7 +593,7 @@ public class FakeApi {
* @param enumFormString Form parameter enum test (string)
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws WebClientResponseException {
private ResponseSpec testEnumParametersRequestCreation(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -454,6 +629,31 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* To test enum parameters
* To test enum parameters
* <p><b>400</b> - Invalid request
* <p><b>404</b> - Not found
* @param enumHeaderStringArray Header parameter enum test (string array)
* @param enumHeaderString Header parameter enum test (string)
* @param enumQueryStringArray Query parameter enum test (string array)
* @param enumQueryString Query parameter enum test (string)
* @param enumQueryInteger Query parameter enum test (double)
* @param enumQueryDouble Query parameter enum test (double)
* @param enumFormStringArray Form parameter enum test (string array)
* @param enumFormString Form parameter enum test (string)
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testEnumParametersWithHttpInfo(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString).toEntity(localVarReturnType);
}
/**
* Fake endpoint to test group parameters (optional)
* Fake endpoint to test group parameters (optional)
@ -466,7 +666,7 @@ public class FakeApi {
* @param int64Group Integer in group parameters
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException {
private ResponseSpec testGroupParametersRequestCreation(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'requiredStringGroup' is set
if (requiredStringGroup == null) {
@ -507,6 +707,28 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Fake endpoint to test group parameters (optional)
* Fake endpoint to test group parameters (optional)
* <p><b>400</b> - Someting wrong
* @param requiredStringGroup Required String in group parameters
* @param requiredBooleanGroup Required Boolean in group parameters
* @param requiredInt64Group Required Integer in group parameters
* @param stringGroup String in group parameters
* @param booleanGroup Boolean in group parameters
* @param int64Group Integer in group parameters
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).toEntity(localVarReturnType);
}
/**
* test inline additionalProperties
*
@ -514,7 +736,7 @@ public class FakeApi {
* @param param request body
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testInlineAdditionalProperties(Map<String, String> param) throws WebClientResponseException {
private ResponseSpec testInlineAdditionalPropertiesRequestCreation(Map<String, String> param) throws WebClientResponseException {
Object postBody = param;
// verify the required parameter 'param' is set
if (param == null) {
@ -540,6 +762,23 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* test inline additionalProperties
*
* <p><b>200</b> - successful operation
* @param param request body
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testInlineAdditionalProperties(Map<String, String> param) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testInlineAdditionalPropertiesRequestCreation(param).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testInlineAdditionalPropertiesWithHttpInfo(Map<String, String> param) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testInlineAdditionalPropertiesRequestCreation(param).toEntity(localVarReturnType);
}
/**
* test json serialization of form data
*
@ -548,7 +787,7 @@ public class FakeApi {
* @param param2 field2
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testJsonFormData(String param, String param2) throws WebClientResponseException {
private ResponseSpec testJsonFormDataRequestCreation(String param, String param2) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'param' is set
if (param == null) {
@ -583,6 +822,24 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* test json serialization of form data
*
* <p><b>200</b> - successful operation
* @param param field1
* @param param2 field2
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testJsonFormData(String param, String param2) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testJsonFormDataRequestCreation(param, param2).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testJsonFormDataWithHttpInfo(String param, String param2) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testJsonFormDataRequestCreation(param, param2).toEntity(localVarReturnType);
}
/**
*
* To test the collection format in query parameters
@ -594,7 +851,7 @@ public class FakeApi {
* @param context The context parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws WebClientResponseException {
private ResponseSpec testQueryParameterCollectionFormatRequestCreation(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'pipe' is set
if (pipe == null) {
@ -640,4 +897,25 @@ public class FakeApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/fake/test-query-paramters", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* To test the collection format in query parameters
* <p><b>200</b> - Success
* @param pipe The pipe parameter
* @param ioutil The ioutil parameter
* @param http The http parameter
* @param url The url parameter
* @param context The context parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> testQueryParameterCollectionFormatWithHttpInfo(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context).toEntity(localVarReturnType);
}
}

View File

@ -15,12 +15,14 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@ -53,7 +55,7 @@ public class FakeClassnameTags123Api {
* @return Client
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> testClassname(Client body) throws WebClientResponseException {
private ResponseSpec testClassnameRequestCreation(Client body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -81,4 +83,22 @@ public class FakeClassnameTags123Api {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* To test class name in snake case
* To test class name in snake case
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> testClassname(Client body) throws WebClientResponseException {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return testClassnameRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Client>> testClassnameWithHttpInfo(Client body) throws WebClientResponseException {
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
return testClassnameRequestCreation(body).toEntity(localVarReturnType);
}
}

View File

@ -18,12 +18,14 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@ -56,7 +58,7 @@ public class PetApi {
* @param body Pet object that needs to be added to the store
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> addPet(Pet body) throws WebClientResponseException {
private ResponseSpec addPetRequestCreation(Pet body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -82,6 +84,24 @@ public class PetApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/pet", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Add a new pet to the store
*
* <p><b>200</b> - successful operation
* <p><b>405</b> - Invalid input
* @param body Pet object that needs to be added to the store
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> addPet(Pet body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return addPetRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> addPetWithHttpInfo(Pet body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return addPetRequestCreation(body).toEntity(localVarReturnType);
}
/**
* Deletes a pet
*
@ -91,7 +111,7 @@ public class PetApi {
* @param apiKey The apiKey parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deletePet(Long petId, String apiKey) throws WebClientResponseException {
private ResponseSpec deletePetRequestCreation(Long petId, String apiKey) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -119,6 +139,25 @@ public class PetApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Deletes a pet
*
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid pet value
* @param petId Pet id to delete
* @param apiKey The apiKey parameter
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deletePet(Long petId, String apiKey) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return deletePetRequestCreation(petId, apiKey).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> deletePetWithHttpInfo(Long petId, String apiKey) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return deletePetRequestCreation(petId, apiKey).toEntity(localVarReturnType);
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
@ -128,7 +167,7 @@ public class PetApi {
* @return List&lt;Pet&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux<Pet> findPetsByStatus(List<String> status) throws WebClientResponseException {
private ResponseSpec findPetsByStatusRequestCreation(List<String> status) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'status' is set
if (status == null) {
@ -154,7 +193,26 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return apiClient.invokeFluxAPI("/pet/findByStatus", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid status value
* @param status Status values that need to be considered for filter
* @return List&lt;Pet&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux<Pet> findPetsByStatus(List<String> status) throws WebClientResponseException {
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return findPetsByStatusRequestCreation(status).bodyToFlux(localVarReturnType);
}
public Mono<ResponseEntity<List<Pet>>> findPetsByStatusWithHttpInfo(List<String> status) throws WebClientResponseException {
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return findPetsByStatusRequestCreation(status).toEntityList(localVarReturnType);
}
/**
* Finds Pets by tags
@ -165,7 +223,7 @@ public class PetApi {
* @return Set&lt;Pet&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux<Pet> findPetsByTags(Set<String> tags) throws WebClientResponseException {
private ResponseSpec findPetsByTagsRequestCreation(Set<String> tags) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'tags' is set
if (tags == null) {
@ -191,7 +249,26 @@ public class PetApi {
String[] localVarAuthNames = new String[] { "petstore_auth" };
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return apiClient.invokeFluxAPI("/pet/findByTags", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid tag value
* @param tags Tags to filter by
* @return Set&lt;Pet&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux<Pet> findPetsByTags(Set<String> tags) throws WebClientResponseException {
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return findPetsByTagsRequestCreation(tags).bodyToFlux(localVarReturnType);
}
public Mono<ResponseEntity<List<Pet>>> findPetsByTagsWithHttpInfo(Set<String> tags) throws WebClientResponseException {
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return findPetsByTagsRequestCreation(tags).toEntityList(localVarReturnType);
}
/**
* Find pet by ID
@ -203,7 +280,7 @@ public class PetApi {
* @return Pet
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Pet> getPetById(Long petId) throws WebClientResponseException {
private ResponseSpec getPetByIdRequestCreation(Long petId) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -231,6 +308,26 @@ public class PetApi {
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Find pet by ID
* Returns a single pet
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid ID supplied
* <p><b>404</b> - Pet not found
* @param petId ID of pet to return
* @return Pet
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Pet> getPetById(Long petId) throws WebClientResponseException {
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return getPetByIdRequestCreation(petId).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Pet>> getPetByIdWithHttpInfo(Long petId) throws WebClientResponseException {
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
return getPetByIdRequestCreation(petId).toEntity(localVarReturnType);
}
/**
* Update an existing pet
*
@ -241,7 +338,7 @@ public class PetApi {
* @param body Pet object that needs to be added to the store
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updatePet(Pet body) throws WebClientResponseException {
private ResponseSpec updatePetRequestCreation(Pet body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -267,6 +364,26 @@ public class PetApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/pet", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Update an existing pet
*
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid ID supplied
* <p><b>404</b> - Pet not found
* <p><b>405</b> - Validation exception
* @param body Pet object that needs to be added to the store
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updatePet(Pet body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return updatePetRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> updatePetWithHttpInfo(Pet body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return updatePetRequestCreation(body).toEntity(localVarReturnType);
}
/**
* Updates a pet in the store with form data
*
@ -276,7 +393,7 @@ public class PetApi {
* @param status Updated status of the pet
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updatePetWithForm(Long petId, String name, String status) throws WebClientResponseException {
private ResponseSpec updatePetWithFormRequestCreation(Long petId, String name, String status) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -309,6 +426,25 @@ public class PetApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Updates a pet in the store with form data
*
* <p><b>405</b> - Invalid input
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updatePetWithForm(Long petId, String name, String status) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return updatePetWithFormRequestCreation(petId, name, status).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return updatePetWithFormRequestCreation(petId, name, status).toEntity(localVarReturnType);
}
/**
* uploads an image
*
@ -319,7 +455,7 @@ public class PetApi {
* @return ModelApiResponse
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File file) throws WebClientResponseException {
private ResponseSpec uploadFileRequestCreation(Long petId, String additionalMetadata, File file) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -354,6 +490,26 @@ public class PetApi {
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* uploads an image
*
* <p><b>200</b> - successful operation
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @return ModelApiResponse
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File file) throws WebClientResponseException {
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
return uploadFileRequestCreation(petId, additionalMetadata, file).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<ModelApiResponse>> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws WebClientResponseException {
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
return uploadFileRequestCreation(petId, additionalMetadata, file).toEntity(localVarReturnType);
}
/**
* uploads an image (required)
*
@ -364,7 +520,7 @@ public class PetApi {
* @return ModelApiResponse
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ModelApiResponse> uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
private ResponseSpec uploadFileWithRequiredFileRequestCreation(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
@ -403,4 +559,24 @@ public class PetApi {
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* uploads an image (required)
*
* <p><b>200</b> - successful operation
* @param petId ID of pet to update
* @param requiredFile file to upload
* @param additionalMetadata Additional data to pass to server
* @return ModelApiResponse
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ModelApiResponse> uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<ModelApiResponse>> uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).toEntity(localVarReturnType);
}
}

View File

@ -15,12 +15,14 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@ -53,7 +55,7 @@ public class StoreApi {
* @param orderId ID of the order that needs to be deleted
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deleteOrder(String orderId) throws WebClientResponseException {
private ResponseSpec deleteOrderRequestCreation(String orderId) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
@ -79,6 +81,24 @@ public class StoreApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* <p><b>400</b> - Invalid ID supplied
* <p><b>404</b> - Order not found
* @param orderId ID of the order that needs to be deleted
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deleteOrder(String orderId) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return deleteOrderRequestCreation(orderId).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> deleteOrderWithHttpInfo(String orderId) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return deleteOrderRequestCreation(orderId).toEntity(localVarReturnType);
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
@ -86,7 +106,7 @@ public class StoreApi {
* @return Map&lt;String, Integer&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Map<String, Integer>> getInventory() throws WebClientResponseException {
private ResponseSpec getInventoryRequestCreation() throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -108,6 +128,23 @@ public class StoreApi {
ParameterizedTypeReference<Map<String, Integer>> localVarReturnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* <p><b>200</b> - successful operation
* @return Map&lt;String, Integer&gt;
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Map<String, Integer>> getInventory() throws WebClientResponseException {
ParameterizedTypeReference<Map<String, Integer>> localVarReturnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
return getInventoryRequestCreation().bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Map<String, Integer>>> getInventoryWithHttpInfo() throws WebClientResponseException {
ParameterizedTypeReference<Map<String, Integer>> localVarReturnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
return getInventoryRequestCreation().toEntity(localVarReturnType);
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
@ -118,7 +155,7 @@ public class StoreApi {
* @return Order
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Order> getOrderById(Long orderId) throws WebClientResponseException {
private ResponseSpec getOrderByIdRequestCreation(Long orderId) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
@ -146,6 +183,26 @@ public class StoreApi {
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid ID supplied
* <p><b>404</b> - Order not found
* @param orderId ID of pet that needs to be fetched
* @return Order
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Order> getOrderById(Long orderId) throws WebClientResponseException {
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
return getOrderByIdRequestCreation(orderId).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Order>> getOrderByIdWithHttpInfo(Long orderId) throws WebClientResponseException {
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
return getOrderByIdRequestCreation(orderId).toEntity(localVarReturnType);
}
/**
* Place an order for a pet
*
@ -155,7 +212,7 @@ public class StoreApi {
* @return Order
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Order> placeOrder(Order body) throws WebClientResponseException {
private ResponseSpec placeOrderRequestCreation(Order body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -181,4 +238,23 @@ public class StoreApi {
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
return apiClient.invokeAPI("/store/order", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Place an order for a pet
*
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid Order
* @param body order placed for purchasing the pet
* @return Order
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Order> placeOrder(Order body) throws WebClientResponseException {
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
return placeOrderRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Order>> placeOrderWithHttpInfo(Order body) throws WebClientResponseException {
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
return placeOrderRequestCreation(body).toEntity(localVarReturnType);
}
}

View File

@ -15,12 +15,14 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
@ -52,7 +54,7 @@ public class UserApi {
* @param body Created user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUser(User body) throws WebClientResponseException {
private ResponseSpec createUserRequestCreation(User body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -76,6 +78,23 @@ public class UserApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/user", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Create user
* This can only be done by the logged in user.
* <p><b>0</b> - successful operation
* @param body Created user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUser(User body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createUserRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> createUserWithHttpInfo(User body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createUserRequestCreation(body).toEntity(localVarReturnType);
}
/**
* Creates list of users with given input array
*
@ -83,7 +102,7 @@ public class UserApi {
* @param body List of user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUsersWithArrayInput(List<User> body) throws WebClientResponseException {
private ResponseSpec createUsersWithArrayInputRequestCreation(List<User> body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -107,6 +126,7 @@ public class UserApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Creates list of users with given input array
*
@ -114,7 +134,23 @@ public class UserApi {
* @param body List of user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUsersWithListInput(List<User> body) throws WebClientResponseException {
public Mono<Void> createUsersWithArrayInput(List<User> body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createUsersWithArrayInputRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> createUsersWithArrayInputWithHttpInfo(List<User> body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createUsersWithArrayInputRequestCreation(body).toEntity(localVarReturnType);
}
/**
* Creates list of users with given input array
*
* <p><b>0</b> - successful operation
* @param body List of user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec createUsersWithListInputRequestCreation(List<User> body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
@ -138,6 +174,23 @@ public class UserApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Creates list of users with given input array
*
* <p><b>0</b> - successful operation
* @param body List of user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUsersWithListInput(List<User> body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createUsersWithListInputRequestCreation(body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> createUsersWithListInputWithHttpInfo(List<User> body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return createUsersWithListInputRequestCreation(body).toEntity(localVarReturnType);
}
/**
* Delete user
* This can only be done by the logged in user.
@ -146,7 +199,7 @@ public class UserApi {
* @param username The name that needs to be deleted
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deleteUser(String username) throws WebClientResponseException {
private ResponseSpec deleteUserRequestCreation(String username) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -172,6 +225,24 @@ public class UserApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Delete user
* This can only be done by the logged in user.
* <p><b>400</b> - Invalid username supplied
* <p><b>404</b> - User not found
* @param username The name that needs to be deleted
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deleteUser(String username) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return deleteUserRequestCreation(username).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> deleteUserWithHttpInfo(String username) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return deleteUserRequestCreation(username).toEntity(localVarReturnType);
}
/**
* Get user by user name
*
@ -182,7 +253,7 @@ public class UserApi {
* @return User
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<User> getUserByName(String username) throws WebClientResponseException {
private ResponseSpec getUserByNameRequestCreation(String username) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -210,6 +281,26 @@ public class UserApi {
ParameterizedTypeReference<User> localVarReturnType = new ParameterizedTypeReference<User>() {};
return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Get user by user name
*
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid username supplied
* <p><b>404</b> - User not found
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<User> getUserByName(String username) throws WebClientResponseException {
ParameterizedTypeReference<User> localVarReturnType = new ParameterizedTypeReference<User>() {};
return getUserByNameRequestCreation(username).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<User>> getUserByNameWithHttpInfo(String username) throws WebClientResponseException {
ParameterizedTypeReference<User> localVarReturnType = new ParameterizedTypeReference<User>() {};
return getUserByNameRequestCreation(username).toEntity(localVarReturnType);
}
/**
* Logs user into the system
*
@ -220,7 +311,7 @@ public class UserApi {
* @return String
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<String> loginUser(String username, String password) throws WebClientResponseException {
private ResponseSpec loginUserRequestCreation(String username, String password) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
@ -253,13 +344,33 @@ public class UserApi {
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
return apiClient.invokeAPI("/user/login", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Logs user into the system
*
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid username/password supplied
* @param username The user name for login
* @param password The password for login in clear text
* @return String
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<String> loginUser(String username, String password) throws WebClientResponseException {
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
return loginUserRequestCreation(username, password).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<String>> loginUserWithHttpInfo(String username, String password) throws WebClientResponseException {
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
return loginUserRequestCreation(username, password).toEntity(localVarReturnType);
}
/**
* Logs out current logged in user session
*
* <p><b>0</b> - successful operation
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> logoutUser() throws WebClientResponseException {
private ResponseSpec logoutUserRequestCreation() throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -279,6 +390,22 @@ public class UserApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/user/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Logs out current logged in user session
*
* <p><b>0</b> - successful operation
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> logoutUser() throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return logoutUserRequestCreation().bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> logoutUserWithHttpInfo() throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return logoutUserRequestCreation().toEntity(localVarReturnType);
}
/**
* Updated user
* This can only be done by the logged in user.
@ -288,7 +415,7 @@ public class UserApi {
* @param body Updated user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updateUser(String username, User body) throws WebClientResponseException {
private ResponseSpec updateUserRequestCreation(String username, User body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'username' is set
if (username == null) {
@ -318,4 +445,23 @@ public class UserApi {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Updated user
* This can only be done by the logged in user.
* <p><b>400</b> - Invalid user supplied
* <p><b>404</b> - User not found
* @param username name that need to be deleted
* @param body Updated user object
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updateUser(String username, User body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return updateUserRequestCreation(username, body).bodyToMono(localVarReturnType);
}
public Mono<ResponseEntity<Void>> updateUserWithHttpInfo(String username, User body) throws WebClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
return updateUserRequestCreation(username, body).toEntity(localVarReturnType);
}
}