forked from loafle/openapi-generator-original
9
bin/configs/java-native-async.yaml
Normal file
9
bin/configs/java-native-async.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/native-async
|
||||
library: native
|
||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-native
|
||||
hideGenerationTimestamp: "true"
|
||||
asyncNative: "true"
|
||||
@@ -404,6 +404,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
} else if (NATIVE.equals(getLibrary())) {
|
||||
setJava8Mode(true);
|
||||
additionalProperties.put("java8", "true");
|
||||
if (!asyncNative) {
|
||||
supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java"));
|
||||
}
|
||||
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
|
||||
} else if (RESTEASY.equals(getLibrary())) {
|
||||
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
|
||||
|
||||
58
modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache
vendored
Normal file
58
modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{{>licenseInfo}}
|
||||
|
||||
package {{invokerPackage}};
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
{{#caseInsensitiveResponseHeaders}}
|
||||
import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
{{/caseInsensitiveResponseHeaders}}
|
||||
|
||||
/**
|
||||
* API response returned by API call.
|
||||
*
|
||||
* @param <T> The type of data that is deserialized from response body
|
||||
*/
|
||||
public class ApiResponse<T> {
|
||||
final private int statusCode;
|
||||
final private Map<String, List<String>> headers;
|
||||
final private T data;
|
||||
|
||||
/**
|
||||
* @param statusCode The status code of HTTP response
|
||||
* @param headers The headers of HTTP response
|
||||
*/
|
||||
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
|
||||
this(statusCode, headers, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param statusCode The status code of HTTP response
|
||||
* @param headers The headers of HTTP response
|
||||
* @param data The object deserialized from response bod
|
||||
*/
|
||||
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
|
||||
this.statusCode = statusCode;
|
||||
{{#caseInsensitiveResponseHeaders}}
|
||||
Map<String, List<String>> responseHeaders = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
|
||||
for(Entry<String, List<String>> entry : headers.entrySet()){
|
||||
responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue());
|
||||
}
|
||||
{{/caseInsensitiveResponseHeaders}}
|
||||
this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}};
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
public Map<String, List<String>> getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,9 @@ package {{package}};
|
||||
|
||||
import {{invokerPackage}}.ApiClient;
|
||||
import {{invokerPackage}}.ApiException;
|
||||
{{^asyncNative}}
|
||||
import {{invokerPackage}}.ApiResponse;
|
||||
{{/asyncNative}}
|
||||
import {{invokerPackage}}.Pair;
|
||||
|
||||
{{#imports}}
|
||||
@@ -27,8 +30,8 @@ import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
{{/fullJavaUtil}}
|
||||
|
||||
{{#asyncNative}}
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
{{/asyncNative}}
|
||||
|
||||
@@ -77,12 +80,38 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#hasParams}}API{{operationId}}Request {{operationId}}Request{{/hasParams}}) throws ApiException {
|
||||
public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}(API{{operationId}}Request {{operationId}}Request) throws ApiException {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = {{operationId}}Request.{{paramName}}();
|
||||
{{/allParams}}
|
||||
{{#returnType}}return {{/returnType}}{{^returnType}}{{#asyncNative}}return {{/asyncNative}}{{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
}
|
||||
{{^asyncNative}}
|
||||
|
||||
/**
|
||||
* {{summary}}
|
||||
* {{notes}}
|
||||
* @param {{operationId}}Request {@link API{{operationId}}Request}
|
||||
* @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
|
||||
* @throws ApiException if fails to make API call
|
||||
{{#isDeprecated}}
|
||||
* @deprecated
|
||||
{{/isDeprecated}}
|
||||
{{#externalDocs}}
|
||||
* {{description}}
|
||||
* @see <a href="{{url}}">{{summary}} Documentation</a>
|
||||
{{/externalDocs}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo(API{{operationId}}Request {{operationId}}Request) throws ApiException {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = {{operationId}}Request.{{paramName}}();
|
||||
{{/allParams}}
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
}
|
||||
{{/asyncNative}}
|
||||
|
||||
{{/hasParams}}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
@@ -107,17 +136,103 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
{{^asyncNative}}
|
||||
{{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}
|
||||
return localVarResponse.getData();
|
||||
{{/returnType}}
|
||||
{{/asyncNative}}
|
||||
{{#asyncNative}}
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"{{operationId}} call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
{{#returnType}}
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
{{/returnType}}
|
||||
{{^returnType}}
|
||||
return CompletableFuture.completedFuture(null);
|
||||
{{/returnType}}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
{{/asyncNative}}
|
||||
}
|
||||
{{^asyncNative}}
|
||||
|
||||
/**
|
||||
* {{summary}}
|
||||
* {{notes}}
|
||||
{{#allParams}}
|
||||
* @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}}
|
||||
{{/allParams}}
|
||||
* @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>
|
||||
* @throws ApiException if fails to make API call
|
||||
{{#isDeprecated}}
|
||||
* @deprecated
|
||||
{{/isDeprecated}}
|
||||
{{#externalDocs}}
|
||||
* {{description}}
|
||||
* @see <a href="{{url}}">{{summary}} Documentation</a>
|
||||
{{/externalDocs}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"{{operationId}} call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
{{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}){{/returnType}}{{^returnType}}null{{/returnType}}
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
{{/asyncNative}}
|
||||
|
||||
private HttpRequest.Builder {{operationId}}RequestBuilder({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
{{#allParams}}
|
||||
{{#required}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
{{#asyncNative}}
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"));
|
||||
{{/asyncNative}}
|
||||
{{^asyncNative}}
|
||||
throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}");
|
||||
{{/asyncNative}}
|
||||
throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}");
|
||||
}
|
||||
{{/required}}
|
||||
{{/allParams}}
|
||||
@@ -161,87 +276,24 @@ public class {{classname}} {
|
||||
{{/bodyParam}}
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
{{^asyncNative}}
|
||||
{{#bodyParam}}
|
||||
try {
|
||||
{{/asyncNative}}
|
||||
{{#asyncNative}}
|
||||
{{#bodyParam}}
|
||||
try {
|
||||
{{/bodyParam}}
|
||||
{{/asyncNative}}
|
||||
{{#bodyParam}}
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes({{paramName}});
|
||||
localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
{{/bodyParam}}
|
||||
{{^bodyParam}}
|
||||
localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.noBody());
|
||||
{{/bodyParam}}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
{{^asyncNative}}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"{{operationId}} call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
{{#returnType}}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {});
|
||||
{{/returnType}}
|
||||
{{/asyncNative}}
|
||||
{{#asyncNative}}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"{{operationId}} call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
{{#returnType}}
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
{{/returnType}}{{^returnType}}
|
||||
return CompletableFuture.completedFuture(null);
|
||||
{{/returnType}}
|
||||
}
|
||||
});
|
||||
{{/asyncNative}}
|
||||
{{#asyncNative}}
|
||||
{{#bodyParam}}
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
{{/bodyParam}}
|
||||
{{/asyncNative}}
|
||||
{{^asyncNative}}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
{{^bodyParam}}
|
||||
localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.noBody());
|
||||
{{/bodyParam}}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
{{/asyncNative}}
|
||||
{{^asyncNative}}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
{{/asyncNative}}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#hasParams}}
|
||||
|
||||
@@ -7,6 +7,9 @@ All URIs are relative to *{{basePath}}*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||
{{^asyncNative}}
|
||||
[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
|
||||
{{/asyncNative}}
|
||||
{{/operation}}{{/operations}}
|
||||
|
||||
{{#operations}}
|
||||
@@ -70,10 +73,14 @@ public class Example {
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void> result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}{{#hasParams}}
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void> result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#hasParams}}
|
||||
API{{operationId}}Request request = API{{operationId}}Request.newBuilder(){{#allParams}}
|
||||
.{{paramName}}({{paramName}}){{/allParams}}
|
||||
.build();{{/hasParams}}
|
||||
.build();
|
||||
{{/hasParams}}
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void> result = {{/asyncNative}}{{/returnType}}apiInstance.{{operationId}}({{#hasParams}}request{{/hasParams}});{{/vendorExtensions.x-group-parameters}}{{#returnType}}
|
||||
System.out.println(result);{{/returnType}}
|
||||
} catch (ApiException e) {
|
||||
@@ -124,6 +131,128 @@ Name | Type | Description | Notes
|
||||
| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}} <br> {{/headers}}{{^headers.0}} - {{/headers.0}} |
|
||||
{{/responses}}
|
||||
{{/responses.0}}
|
||||
{{^asyncNative}}
|
||||
|
||||
## {{operationId}}WithHttpInfo
|
||||
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
> ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
> ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}})
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
|
||||
{{summary}}{{#notes}}
|
||||
|
||||
{{notes}}{{/notes}}
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import {{{invokerPackage}}}.ApiClient;
|
||||
import {{{invokerPackage}}}.ApiException;
|
||||
import {{{invokerPackage}}}.ApiResponse;
|
||||
import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}}
|
||||
import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}}
|
||||
import {{{invokerPackage}}}.models.*;
|
||||
import {{{package}}}.{{{classname}}};{{#vendorExtensions.x-group-parameters}}
|
||||
import {{{package}}}.{{{classname}}}.*;{{/vendorExtensions.x-group-parameters}}
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("{{{basePath}}}");
|
||||
{{#hasAuthMethods}}
|
||||
{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
|
||||
// Configure HTTP basic authorization: {{{name}}}
|
||||
HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}");
|
||||
{{{name}}}.setUsername("YOUR USERNAME");
|
||||
{{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}}
|
||||
// Configure HTTP bearer authorization: {{{name}}}
|
||||
HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}");
|
||||
{{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
|
||||
// Configure API key authorization: {{{name}}}
|
||||
ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}");
|
||||
{{{name}}}.setApiKey("YOUR API KEY");
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}}
|
||||
// Configure OAuth2 access token for authorization: {{{name}}}
|
||||
OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}");
|
||||
{{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
{{/hasAuthMethods}}
|
||||
|
||||
{{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#hasParams}}
|
||||
API{{operationId}}Request request = API{{operationId}}Request.newBuilder(){{#allParams}}
|
||||
.{{paramName}}({{paramName}}){{/allParams}}
|
||||
.build();
|
||||
{{/hasParams}}
|
||||
ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> response = apiInstance.{{{operationId}}}WithHttpInfo({{#hasParams}}request{{/hasParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
{{#returnType}}
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
{{/returnType}}
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}}
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||
{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}
|
||||
{{/allParams}}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#hasParams}}
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| {{operationId}}Request | [**API{{operationId}}Request**]({{classname}}.md#API{{operationId}}Request)|-|-|{{/hasParams}}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
|
||||
### Return type
|
||||
|
||||
{{#returnType}}ApiResponse<{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}>{{/returnType}}
|
||||
{{^returnType}}ApiResponse<Void>{{/returnType}}
|
||||
|
||||
### Authorization
|
||||
|
||||
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{#responses.0}}
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
{{#responses}}
|
||||
| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}} <br> {{/headers}}{{^headers.0}} - {{/headers.0}} |
|
||||
{{/responses}}
|
||||
{{/responses.0}}
|
||||
{{/asyncNative}}
|
||||
{{#vendorExtensions.x-group-parameters}}{{#hasParams}}
|
||||
|
||||
<a name="API{{operationId}}Request"></a>
|
||||
|
||||
@@ -410,7 +410,7 @@ public class JavaClientCodegenTest {
|
||||
DefaultGenerator generator = new DefaultGenerator();
|
||||
List<File> files = generator.opts(clientOptInput).generate();
|
||||
|
||||
Assert.assertEquals(files.size(), 27);
|
||||
Assert.assertEquals(files.size(), 28);
|
||||
validateJavaSourceFiles(files);
|
||||
|
||||
TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/api/DefaultApi.java"),
|
||||
|
||||
@@ -36,6 +36,7 @@ public class Example {
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
CompletableFuture<Client> result = apiInstance.call123testSpecialTags(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||
|
||||
@@ -49,6 +49,7 @@ public class Example {
|
||||
XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.createXmlItem(xmlItem);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#createXmlItem");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -115,6 +116,7 @@ public class Example {
|
||||
Boolean body = true; // Boolean | Input boolean as post body
|
||||
try {
|
||||
CompletableFuture<Boolean> result = apiInstance.fakeOuterBooleanSerialize(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize");
|
||||
@@ -182,6 +184,7 @@ public class Example {
|
||||
OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body
|
||||
try {
|
||||
CompletableFuture<OuterComposite> result = apiInstance.fakeOuterCompositeSerialize(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize");
|
||||
@@ -249,6 +252,7 @@ public class Example {
|
||||
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body
|
||||
try {
|
||||
CompletableFuture<BigDecimal> result = apiInstance.fakeOuterNumberSerialize(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize");
|
||||
@@ -316,6 +320,7 @@ public class Example {
|
||||
String body = "body_example"; // String | Input string as post body
|
||||
try {
|
||||
CompletableFuture<String> result = apiInstance.fakeOuterStringSerialize(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize");
|
||||
@@ -383,6 +388,7 @@ public class Example {
|
||||
FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testBodyWithFileSchema(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -448,6 +454,7 @@ public class Example {
|
||||
User body = new User(); // User |
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testBodyWithQueryParams(query, body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testBodyWithQueryParams");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -515,6 +522,7 @@ public class Example {
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
CompletableFuture<Client> result = apiInstance.testClientModel(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testClientModel");
|
||||
@@ -601,6 +609,7 @@ public class Example {
|
||||
String paramCallback = "paramCallback_example"; // String | None
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testEndpointParameters");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -688,6 +697,7 @@ public class Example {
|
||||
String enumFormString = "-efg"; // String | Form parameter enum test (string)
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testEnumParameters");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -767,7 +777,6 @@ public class Example {
|
||||
Boolean booleanGroup = true; // Boolean | Boolean in group parameters
|
||||
Long int64Group = 56L; // Long | Integer in group parameters
|
||||
try {
|
||||
|
||||
APItestGroupParametersRequest request = APItestGroupParametersRequest.newBuilder()
|
||||
.requiredStringGroup(requiredStringGroup)
|
||||
.requiredBooleanGroup(requiredBooleanGroup)
|
||||
@@ -855,6 +864,7 @@ public class Example {
|
||||
Map<String, String> param = new HashMap(); // Map<String, String> | request body
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testInlineAdditionalProperties(param);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -920,6 +930,7 @@ public class Example {
|
||||
String param2 = "param2_example"; // String | field2
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testJsonFormData(param, param2);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testJsonFormData");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -991,6 +1002,7 @@ public class Example {
|
||||
List<String> context = Arrays.asList(); // List<String> |
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
|
||||
@@ -43,6 +43,7 @@ public class Example {
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
CompletableFuture<Client> result = apiInstance.testClassname(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Example {
|
||||
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.addPet(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#addPet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -118,6 +119,7 @@ public class Example {
|
||||
String apiKey = "apiKey_example"; // String |
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.deletePet(petId, apiKey);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#deletePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -191,6 +193,7 @@ public class Example {
|
||||
List<String> status = Arrays.asList("available"); // List<String> | Status values that need to be considered for filter
|
||||
try {
|
||||
CompletableFuture<List<Pet>> result = apiInstance.findPetsByStatus(status);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByStatus");
|
||||
@@ -264,6 +267,7 @@ public class Example {
|
||||
Set<String> tags = Arrays.asList(); // Set<String> | Tags to filter by
|
||||
try {
|
||||
CompletableFuture<Set<Pet>> result = apiInstance.findPetsByTags(tags);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByTags");
|
||||
@@ -339,6 +343,7 @@ public class Example {
|
||||
Long petId = 56L; // Long | ID of pet to return
|
||||
try {
|
||||
CompletableFuture<Pet> result = apiInstance.getPetById(petId);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#getPetById");
|
||||
@@ -411,6 +416,7 @@ public class Example {
|
||||
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.updatePet(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -485,6 +491,7 @@ public class Example {
|
||||
String status = "status_example"; // String | Updated status of the pet
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.updatePetWithForm(petId, name, status);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePetWithForm");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -558,6 +565,7 @@ public class Example {
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
CompletableFuture<ModelApiResponse> result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@@ -632,6 +640,7 @@ public class Example {
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
try {
|
||||
CompletableFuture<ModelApiResponse> result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
|
||||
|
||||
@@ -39,6 +39,7 @@ public class Example {
|
||||
String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.deleteOrder(orderId);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#deleteOrder");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -112,6 +113,7 @@ public class Example {
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
try {
|
||||
CompletableFuture<Map<String, Integer>> result = apiInstance.getInventory();
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getInventory");
|
||||
@@ -176,6 +178,7 @@ public class Example {
|
||||
Long orderId = 56L; // Long | ID of pet that needs to be fetched
|
||||
try {
|
||||
CompletableFuture<Order> result = apiInstance.getOrderById(orderId);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getOrderById");
|
||||
@@ -243,6 +246,7 @@ public class Example {
|
||||
Order body = new Order(); // Order | order placed for purchasing the pet
|
||||
try {
|
||||
CompletableFuture<Order> result = apiInstance.placeOrder(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#placeOrder");
|
||||
|
||||
@@ -43,6 +43,7 @@ public class Example {
|
||||
User body = new User(); // User | Created user object
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.createUser(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -107,6 +108,7 @@ public class Example {
|
||||
List<User> body = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.createUsersWithArrayInput(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -171,6 +173,7 @@ public class Example {
|
||||
List<User> body = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.createUsersWithListInput(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithListInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -237,6 +240,7 @@ public class Example {
|
||||
String username = "username_example"; // String | The name that needs to be deleted
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.deleteUser(username);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#deleteUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -302,6 +306,7 @@ public class Example {
|
||||
String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
try {
|
||||
CompletableFuture<User> result = apiInstance.getUserByName(username);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#getUserByName");
|
||||
@@ -370,6 +375,7 @@ public class Example {
|
||||
String password = "password_example"; // String | The password for login in clear text
|
||||
try {
|
||||
CompletableFuture<String> result = apiInstance.loginUser(username, password);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#loginUser");
|
||||
@@ -436,6 +442,7 @@ public class Example {
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.logoutUser();
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#logoutUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -500,6 +507,7 @@ public class Example {
|
||||
User body = new User(); // User | Updated user object
|
||||
try {
|
||||
CompletableFuture<Void> result = apiInstance.updateUser(username, body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#updateUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
|
||||
@@ -66,10 +66,38 @@ public class AnotherFakeApi {
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Client> call123testSpecialTags (Client body) throws ApiException {
|
||||
public CompletableFuture<Client> call123testSpecialTags(Client body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"call123testSpecialTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder call123testSpecialTagsRequestBuilder(Client body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -84,33 +112,15 @@ public class AnotherFakeApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"call123testSpecialTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -66,10 +66,38 @@ public class FakeClassnameTags123Api {
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Client> testClassname (Client body) throws ApiException {
|
||||
public CompletableFuture<Client> testClassname(Client body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"testClassname call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testClassnameRequestBuilder(Client body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling testClassname"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -84,33 +112,15 @@ public class FakeClassnameTags123Api {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"testClassname call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,10 +68,32 @@ public class PetApi {
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> addPet (Pet body) throws ApiException {
|
||||
public CompletableFuture<Void> addPet(Pet body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"addPet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder addPetRequestBuilder(Pet body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling addPet"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling addPet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -86,29 +108,16 @@ public class PetApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"addPet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Deletes a pet
|
||||
@@ -117,10 +126,32 @@ public class PetApi {
|
||||
* @param apiKey (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> deletePet (Long petId, String apiKey) throws ApiException {
|
||||
public CompletableFuture<Void> deletePet(Long petId, String apiKey) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"deletePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder deletePetRequestBuilder(Long petId, String apiKey) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"));
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -135,27 +166,14 @@ public class PetApi {
|
||||
}
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"deletePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Finds Pets by status
|
||||
@@ -164,10 +182,38 @@ public class PetApi {
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<List<Pet>> findPetsByStatus (List<String> status) throws ApiException {
|
||||
public CompletableFuture<List<Pet>> findPetsByStatus(List<String> status) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByStatus call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder findPetsByStatusRequestBuilder(List<String> status) throws ApiException {
|
||||
// verify the required parameter 'status' is set
|
||||
if (status == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"));
|
||||
throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -187,32 +233,14 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByStatus call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
@@ -223,10 +251,38 @@ public class PetApi {
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public CompletableFuture<Set<Pet>> findPetsByTags (Set<String> tags) throws ApiException {
|
||||
public CompletableFuture<Set<Pet>> findPetsByTags(Set<String> tags) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Set<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder findPetsByTagsRequestBuilder(Set<String> tags) throws ApiException {
|
||||
// verify the required parameter 'tags' is set
|
||||
if (tags == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"));
|
||||
throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -246,32 +302,14 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Set<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Find pet by ID
|
||||
@@ -280,28 +318,9 @@ public class PetApi {
|
||||
* @return Pet
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Pet> getPetById (Long petId) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"));
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
public CompletableFuture<Pet> getPetById(Long petId) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -313,14 +332,43 @@ public class PetApi {
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Pet>() {})
|
||||
);
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Pet>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getPetByIdRequestBuilder(Long petId) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Update an existing pet
|
||||
@@ -328,10 +376,32 @@ public class PetApi {
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> updatePet (Pet body) throws ApiException {
|
||||
public CompletableFuture<Void> updatePet(Pet body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"updatePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updatePetRequestBuilder(Pet body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling updatePet"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -346,29 +416,16 @@ public class PetApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"updatePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
@@ -378,10 +435,32 @@ public class PetApi {
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> updatePetWithForm (Long petId, String name, String status) throws ApiException {
|
||||
public CompletableFuture<Void> updatePetWithForm(Long petId, String name, String status) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"updatePetWithForm call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updatePetWithFormRequestBuilder(Long petId, String name, String status) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"));
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -393,27 +472,14 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"updatePetWithForm call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* uploads an image
|
||||
@@ -424,28 +490,9 @@ public class PetApi {
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<ModelApiResponse> uploadFile (Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"));
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
public CompletableFuture<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -457,14 +504,43 @@ public class PetApi {
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* uploads an image (required)
|
||||
@@ -475,32 +551,9 @@ public class PetApi {
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<ModelApiResponse> uploadFileWithRequiredFile (Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"));
|
||||
}
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"));
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
public CompletableFuture<ModelApiResponse> uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -512,13 +565,46 @@ public class PetApi {
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,10 +65,32 @@ public class StoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> deleteOrder (String orderId) throws ApiException {
|
||||
public CompletableFuture<Void> deleteOrder(String orderId) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"deleteOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder deleteOrderRequestBuilder(String orderId) throws ApiException {
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"));
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -80,27 +102,14 @@ public class StoreApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"deleteOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
@@ -108,23 +117,9 @@ public class StoreApi {
|
||||
* @return Map<String, Integer>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Map<String, Integer>> getInventory () throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/inventory";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
public CompletableFuture<Map<String, Integer>> getInventory() throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder();
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -136,14 +131,38 @@ public class StoreApi {
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Map<String, Integer>>() {})
|
||||
);
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Map<String, Integer>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getInventoryRequestBuilder() throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/inventory";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
@@ -152,28 +171,9 @@ public class StoreApi {
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Order> getOrderById (Long orderId) throws ApiException {
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"));
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replace("{order_id}", ApiClient.urlEncode(orderId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
public CompletableFuture<Order> getOrderById(Long orderId) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -185,14 +185,43 @@ public class StoreApi {
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getOrderByIdRequestBuilder(Long orderId) throws ApiException {
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replace("{order_id}", ApiClient.urlEncode(orderId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Place an order for a pet
|
||||
@@ -201,10 +230,38 @@ public class StoreApi {
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Order> placeOrder (Order body) throws ApiException {
|
||||
public CompletableFuture<Order> placeOrder(Order body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"placeOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder placeOrderRequestBuilder(Order body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -219,33 +276,15 @@ public class StoreApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"placeOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,10 +65,32 @@ public class UserApi {
|
||||
* @param body Created user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> createUser (User body) throws ApiException {
|
||||
public CompletableFuture<Void> createUser(User body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"createUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder createUserRequestBuilder(User body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling createUser"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -83,29 +105,16 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"createUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
@@ -113,10 +122,32 @@ public class UserApi {
|
||||
* @param body List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> createUsersWithArrayInput (List<User> body) throws ApiException {
|
||||
public CompletableFuture<Void> createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithArrayInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(List<User> body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -131,29 +162,16 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithArrayInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
@@ -161,10 +179,32 @@ public class UserApi {
|
||||
* @param body List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> createUsersWithListInput (List<User> body) throws ApiException {
|
||||
public CompletableFuture<Void> createUsersWithListInput(List<User> body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithListInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder createUsersWithListInputRequestBuilder(List<User> body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -179,29 +219,16 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithListInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
@@ -209,28 +236,9 @@ public class UserApi {
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> deleteUser (String username) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"));
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/{username}"
|
||||
.replace("{username}", ApiClient.urlEncode(username.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
public CompletableFuture<Void> deleteUser(String username) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -241,22 +249,19 @@ public class UserApi {
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return User
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<User> getUserByName (String username) throws ApiException {
|
||||
|
||||
private HttpRequest.Builder deleteUserRequestBuilder(String username) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"));
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -268,13 +273,25 @@ public class UserApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return User
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<User> getUserByName(String username) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -286,14 +303,43 @@ public class UserApi {
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<User>() {})
|
||||
);
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<User>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getUserByNameRequestBuilder(String username) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/{username}"
|
||||
.replace("{username}", ApiClient.urlEncode(username.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Logs user into the system
|
||||
@@ -303,14 +349,42 @@ public class UserApi {
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<String> loginUser (String username, String password) throws ApiException {
|
||||
public CompletableFuture<String> loginUser(String username, String password) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"loginUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<String>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder loginUserRequestBuilder(String username, String password) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'username' when calling loginUser"));
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");
|
||||
}
|
||||
// verify the required parameter 'password' is set
|
||||
if (password == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'password' when calling loginUser"));
|
||||
throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -331,55 +405,23 @@ public class UserApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"loginUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
return CompletableFuture.completedFuture(
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<String>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
}
|
||||
}
|
||||
});
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> logoutUser () throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/logout";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
public CompletableFuture<Void> logoutUser() throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder();
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@@ -390,10 +432,33 @@ public class UserApi {
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder logoutUserRequestBuilder() throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/logout";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Updated user
|
||||
@@ -402,14 +467,36 @@ public class UserApi {
|
||||
* @param body Updated user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public CompletableFuture<Void> updateUser (String username, User body) throws ApiException {
|
||||
public CompletableFuture<Void> updateUser(String username, User body) throws ApiException {
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, body);
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"updateUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (ApiException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updateUserRequestBuilder(String username, User body) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'username' when calling updateUser"));
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");
|
||||
}
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
return CompletableFuture.failedFuture(new ApiException(400, "Missing the required parameter 'body' when calling updateUser"));
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -425,28 +512,15 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(),
|
||||
"updateUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body())
|
||||
);
|
||||
} else {
|
||||
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ settings.gradle
|
||||
src/main/AndroidManifest.xml
|
||||
src/main/java/org/openapitools/client/ApiClient.java
|
||||
src/main/java/org/openapitools/client/ApiException.java
|
||||
src/main/java/org/openapitools/client/ApiResponse.java
|
||||
src/main/java/org/openapitools/client/Configuration.java
|
||||
src/main/java/org/openapitools/client/Pair.java
|
||||
src/main/java/org/openapitools/client/ServerConfiguration.java
|
||||
|
||||
@@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
[**call123testSpecialTagsWithHttpInfo**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +36,7 @@ public class Example {
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.call123testSpecialTags(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||
@@ -73,3 +75,71 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
## call123testSpecialTagsWithHttpInfo
|
||||
|
||||
> ApiResponse<Client> call123testSpecialTags call123testSpecialTagsWithHttpInfo(body)
|
||||
|
||||
To test special tags
|
||||
|
||||
To test special tags and operation ID starting with number
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.AnotherFakeApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
ApiResponse<Client> response = apiInstance.call123testSpecialTagsWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**Client**](Client.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
[**testClassnameWithHttpInfo**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +43,7 @@ public class Example {
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClassname(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
|
||||
@@ -80,3 +82,78 @@ Name | Type | Description | Notes
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
## testClassnameWithHttpInfo
|
||||
|
||||
> ApiResponse<Client> testClassname testClassnameWithHttpInfo(body)
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.FakeClassnameTags123Api;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure API key authorization: api_key_query
|
||||
ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
|
||||
api_key_query.setApiKey("YOUR API KEY");
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key_query.setApiKeyPrefix("Token");
|
||||
|
||||
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient);
|
||||
Client body = new Client(); // Client | client model
|
||||
try {
|
||||
ApiResponse<Client> response = apiInstance.testClassnameWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**Client**](Client.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key_query](../README.md#api_key_query)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
@@ -5,14 +5,23 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**addPetWithHttpInfo**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**deletePetWithHttpInfo**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByStatusWithHttpInfo**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**findPetsByTagsWithHttpInfo**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**getPetByIdWithHttpInfo**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithHttpInfo**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**updatePetWithFormWithHttpInfo**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
[**uploadFileWithHttpInfo**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
[**uploadFileWithRequiredFileWithHttpInfo**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +55,7 @@ public class Example {
|
||||
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
apiInstance.addPet(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#addPet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -84,6 +94,77 @@ null (empty response body)
|
||||
| **200** | successful operation | - |
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
## addPetWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> addPet addPetWithHttpInfo(body)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.addPetWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#addPet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
|
||||
## deletePet
|
||||
|
||||
@@ -116,6 +197,7 @@ public class Example {
|
||||
String apiKey = "apiKey_example"; // String |
|
||||
try {
|
||||
apiInstance.deletePet(petId, apiKey);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#deletePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -155,6 +237,79 @@ null (empty response body)
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid pet value | - |
|
||||
|
||||
## deletePetWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> deletePet deletePetWithHttpInfo(petId, apiKey)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | Pet id to delete
|
||||
String apiKey = "apiKey_example"; // String |
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.deletePetWithHttpInfo(petId, apiKey);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#deletePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| Pet id to delete |
|
||||
**apiKey** | **String**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid pet value | - |
|
||||
|
||||
|
||||
## findPetsByStatus
|
||||
|
||||
@@ -188,6 +343,7 @@ public class Example {
|
||||
List<String> status = Arrays.asList("available"); // List<String> | Status values that need to be considered for filter
|
||||
try {
|
||||
List<Pet> result = apiInstance.findPetsByStatus(status);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByStatus");
|
||||
@@ -212,6 +368,80 @@ Name | Type | Description | Notes
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid status value | - |
|
||||
|
||||
## findPetsByStatusWithHttpInfo
|
||||
|
||||
> ApiResponse<List<Pet>> findPetsByStatus findPetsByStatusWithHttpInfo(status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
List<String> status = Arrays.asList("available"); // List<String> | Status values that need to be considered for filter
|
||||
try {
|
||||
ApiResponse<List<Pet>> response = apiInstance.findPetsByStatusWithHttpInfo(status);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByStatus");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**List<Pet>**](Pet.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
@@ -260,6 +490,7 @@ public class Example {
|
||||
Set<String> tags = Arrays.asList(); // Set<String> | Tags to filter by
|
||||
try {
|
||||
Set<Pet> result = apiInstance.findPetsByTags(tags);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByTags");
|
||||
@@ -284,6 +515,80 @@ Name | Type | Description | Notes
|
||||
[**Set<Pet>**](Pet.md)
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid tag value | - |
|
||||
|
||||
## findPetsByTagsWithHttpInfo
|
||||
|
||||
> ApiResponse<Set<Pet>> findPetsByTags findPetsByTagsWithHttpInfo(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Set<String> tags = Arrays.asList(); // Set<String> | Tags to filter by
|
||||
try {
|
||||
ApiResponse<Set<Pet>> response = apiInstance.findPetsByTagsWithHttpInfo(tags);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByTags");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**Set<String>**](String.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**Set<Pet>**](Pet.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
@@ -334,6 +639,7 @@ public class Example {
|
||||
Long petId = 56L; // Long | ID of pet to return
|
||||
try {
|
||||
Pet result = apiInstance.getPetById(petId);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#getPetById");
|
||||
@@ -358,6 +664,83 @@ Name | Type | Description | Notes
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
|
||||
## getPetByIdWithHttpInfo
|
||||
|
||||
> ApiResponse<Pet> getPetById getPetByIdWithHttpInfo(petId)
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
|
||||
api_key.setApiKey("YOUR API KEY");
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.setApiKeyPrefix("Token");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to return
|
||||
try {
|
||||
ApiResponse<Pet> response = apiInstance.getPetByIdWithHttpInfo(petId);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#getPetById");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**Pet**](Pet.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
@@ -405,6 +788,7 @@ public class Example {
|
||||
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
apiInstance.updatePet(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -445,6 +829,79 @@ null (empty response body)
|
||||
| **404** | Pet not found | - |
|
||||
| **405** | Validation exception | - |
|
||||
|
||||
## updatePetWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> updatePet updatePetWithHttpInfo(body)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.updatePetWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
| **405** | Validation exception | - |
|
||||
|
||||
|
||||
## updatePetWithForm
|
||||
|
||||
@@ -478,6 +935,7 @@ public class Example {
|
||||
String status = "status_example"; // String | Updated status of the pet
|
||||
try {
|
||||
apiInstance.updatePetWithForm(petId, name, status);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePetWithForm");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -517,6 +975,80 @@ null (empty response body)
|
||||
|-------------|-------------|------------------|
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
## updatePetWithFormWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> updatePetWithForm updatePetWithFormWithHttpInfo(petId, name, status)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet that needs to be updated
|
||||
String name = "name_example"; // String | Updated name of the pet
|
||||
String status = "status_example"; // String | Updated status of the pet
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.updatePetWithFormWithHttpInfo(petId, name, status);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePetWithForm");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
|
||||
## uploadFile
|
||||
|
||||
@@ -550,6 +1082,7 @@ public class Example {
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
@@ -576,6 +1109,81 @@ Name | Type | Description | Notes
|
||||
[**ModelApiResponse**](ModelApiResponse.md)
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
## uploadFileWithHttpInfo
|
||||
|
||||
> ApiResponse<ModelApiResponse> uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, file)
|
||||
|
||||
uploads an image
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ApiResponse<ModelApiResponse> response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**ModelApiResponse**](ModelApiResponse.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
@@ -623,6 +1231,7 @@ public class Example {
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
|
||||
@@ -663,3 +1272,78 @@ Name | Type | Description | Notes
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
## uploadFileWithRequiredFileWithHttpInfo
|
||||
|
||||
> ApiResponse<ModelApiResponse> uploadFileWithRequiredFile uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata)
|
||||
|
||||
uploads an image (required)
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
File requiredFile = new File("/path/to/file"); // File | file to upload
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
try {
|
||||
ApiResponse<ModelApiResponse> response = apiInstance.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**requiredFile** | **File**| file to upload |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**ModelApiResponse**](ModelApiResponse.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
@@ -5,9 +5,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
[**deleteOrderWithHttpInfo**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getInventoryWithHttpInfo**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
[**getOrderByIdWithHttpInfo**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
[**placeOrderWithHttpInfo**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +42,7 @@ public class Example {
|
||||
String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
try {
|
||||
apiInstance.deleteOrder(orderId);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#deleteOrder");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -76,6 +81,74 @@ No authorization required
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
## deleteOrderWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> deleteOrder deleteOrderWithHttpInfo(orderId)
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.deleteOrderWithHttpInfo(orderId);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#deleteOrder");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **String**| ID of the order that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
|
||||
## getInventory
|
||||
|
||||
@@ -110,6 +183,7 @@ public class Example {
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
try {
|
||||
Map<String, Integer> result = apiInstance.getInventory();
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getInventory");
|
||||
@@ -131,6 +205,77 @@ This endpoint does not need any parameter.
|
||||
**Map<String, Integer>**
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
## getInventoryWithHttpInfo
|
||||
|
||||
> ApiResponse<Map<String, Integer>> getInventory getInventoryWithHttpInfo()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
|
||||
api_key.setApiKey("YOUR API KEY");
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.setApiKeyPrefix("Token");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
try {
|
||||
ApiResponse<Map<String, Integer>> response = apiInstance.getInventoryWithHttpInfo();
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getInventory");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<**Map<String, Integer>**>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
@@ -173,6 +318,7 @@ public class Example {
|
||||
Long orderId = 56L; // Long | ID of pet that needs to be fetched
|
||||
try {
|
||||
Order result = apiInstance.getOrderById(orderId);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getOrderById");
|
||||
@@ -197,6 +343,76 @@ Name | Type | Description | Notes
|
||||
[**Order**](Order.md)
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
## getOrderByIdWithHttpInfo
|
||||
|
||||
> ApiResponse<Order> getOrderById getOrderByIdWithHttpInfo(orderId)
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
Long orderId = 56L; // Long | ID of pet that needs to be fetched
|
||||
try {
|
||||
ApiResponse<Order> response = apiInstance.getOrderByIdWithHttpInfo(orderId);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getOrderById");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **Long**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**Order**](Order.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
@@ -239,6 +455,7 @@ public class Example {
|
||||
Order body = new Order(); // Order | order placed for purchasing the pet
|
||||
try {
|
||||
Order result = apiInstance.placeOrder(body);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#placeOrder");
|
||||
@@ -278,3 +495,70 @@ No authorization required
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Order | - |
|
||||
|
||||
## placeOrderWithHttpInfo
|
||||
|
||||
> ApiResponse<Order> placeOrder placeOrderWithHttpInfo(body)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
Order body = new Order(); // Order | order placed for purchasing the pet
|
||||
try {
|
||||
ApiResponse<Order> response = apiInstance.placeOrderWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#placeOrder");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**Order**](Order.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Order | - |
|
||||
|
||||
|
||||
@@ -5,13 +5,21 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
|
||||
[**createUserWithHttpInfo**](UserApi.md#createUser) | **POST** /user | Create user
|
||||
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
[**createUsersWithArrayInputWithHttpInfo**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
[**createUsersWithListInputWithHttpInfo**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
[**deleteUserWithHttpInfo**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**getUserByNameWithHttpInfo**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**loginUserWithHttpInfo**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**logoutUserWithHttpInfo**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
[**updateUserWithHttpInfo**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +50,7 @@ public class Example {
|
||||
User body = new User(); // User | Created user object
|
||||
try {
|
||||
apiInstance.createUser(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -79,6 +88,73 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
## createUserWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> createUser createUserWithHttpInfo(body)
|
||||
|
||||
Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
User body = new User(); // User | Created user object
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.createUserWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## createUsersWithArrayInput
|
||||
|
||||
@@ -105,6 +181,7 @@ public class Example {
|
||||
List<User> body = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithArrayInput(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -142,6 +219,71 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
## createUsersWithArrayInputWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> createUsersWithArrayInput createUsersWithArrayInputWithHttpInfo(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
List<User> body = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.createUsersWithArrayInputWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## createUsersWithListInput
|
||||
|
||||
@@ -168,6 +310,7 @@ public class Example {
|
||||
List<User> body = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithListInput(body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithListInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -205,6 +348,71 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
## createUsersWithListInputWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> createUsersWithListInput createUsersWithListInputWithHttpInfo(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
List<User> body = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.createUsersWithListInputWithHttpInfo(body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithListInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## deleteUser
|
||||
|
||||
@@ -233,6 +441,7 @@ public class Example {
|
||||
String username = "username_example"; // String | The name that needs to be deleted
|
||||
try {
|
||||
apiInstance.deleteUser(username);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#deleteUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -271,6 +480,74 @@ No authorization required
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
## deleteUserWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> deleteUser deleteUserWithHttpInfo(username)
|
||||
|
||||
Delete user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | The name that needs to be deleted
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.deleteUserWithHttpInfo(username);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#deleteUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The name that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
|
||||
## getUserByName
|
||||
|
||||
@@ -297,6 +574,7 @@ public class Example {
|
||||
String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
try {
|
||||
User result = apiInstance.getUserByName(username);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#getUserByName");
|
||||
@@ -321,6 +599,74 @@ Name | Type | Description | Notes
|
||||
[**User**](User.md)
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
## getUserByNameWithHttpInfo
|
||||
|
||||
> ApiResponse<User> getUserByName getUserByNameWithHttpInfo(username)
|
||||
|
||||
Get user by user name
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
try {
|
||||
ApiResponse<User> response = apiInstance.getUserByNameWithHttpInfo(username);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#getUserByName");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<[**User**](User.md)>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
@@ -364,6 +710,7 @@ public class Example {
|
||||
String password = "password_example"; // String | The password for login in clear text
|
||||
try {
|
||||
String result = apiInstance.loginUser(username, password);
|
||||
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#loginUser");
|
||||
@@ -389,6 +736,75 @@ Name | Type | Description | Notes
|
||||
**String**
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||
| **400** | Invalid username/password supplied | - |
|
||||
|
||||
## loginUserWithHttpInfo
|
||||
|
||||
> ApiResponse<String> loginUser loginUserWithHttpInfo(username, password)
|
||||
|
||||
Logs user into the system
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | The user name for login
|
||||
String password = "password_example"; // String | The password for login in clear text
|
||||
try {
|
||||
ApiResponse<String> response = apiInstance.loginUserWithHttpInfo(username, password);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
System.out.println("Response body: " + response.getData().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#loginUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| The user name for login |
|
||||
**password** | **String**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
ApiResponse<**String**>
|
||||
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
@@ -429,6 +845,7 @@ public class Example {
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
try {
|
||||
apiInstance.logoutUser();
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#logoutUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -463,6 +880,67 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
## logoutUserWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> logoutUser logoutUserWithHttpInfo()
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.logoutUserWithHttpInfo();
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#logoutUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## updateUser
|
||||
|
||||
@@ -492,6 +970,7 @@ public class Example {
|
||||
User body = new User(); // User | Updated user object
|
||||
try {
|
||||
apiInstance.updateUser(username, body);
|
||||
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#updateUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
@@ -531,3 +1010,73 @@ No authorization required
|
||||
| **400** | Invalid user supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
## updateUserWithHttpInfo
|
||||
|
||||
> ApiResponse<Void> updateUser updateUserWithHttpInfo(username, body)
|
||||
|
||||
Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | name that need to be deleted
|
||||
User body = new User(); // User | Updated user object
|
||||
try {
|
||||
ApiResponse<Void> response = apiInstance.updateUserWithHttpInfo(username, body);
|
||||
System.out.println("Status code: " + response.getStatusCode());
|
||||
System.out.println("Response headers: " + response.getHeaders().toString());
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#updateUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
ApiResponse<Void>
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid user supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API response returned by API call.
|
||||
*
|
||||
* @param <T> The type of data that is deserialized from response body
|
||||
*/
|
||||
public class ApiResponse<T> {
|
||||
final private int statusCode;
|
||||
final private Map<String, List<String>> headers;
|
||||
final private T data;
|
||||
|
||||
/**
|
||||
* @param statusCode The status code of HTTP response
|
||||
* @param headers The headers of HTTP response
|
||||
*/
|
||||
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
|
||||
this(statusCode, headers, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param statusCode The status code of HTTP response
|
||||
* @param headers The headers of HTTP response
|
||||
* @param data The object deserialized from response bod
|
||||
*/
|
||||
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
|
||||
this.statusCode = statusCode;
|
||||
this.headers = headers;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
public Map<String, List<String>> getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.Client;
|
||||
@@ -35,7 +36,6 @@ import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AnotherFakeApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
@@ -65,10 +65,51 @@ public class AnotherFakeApi {
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client call123testSpecialTags (Client body) throws ApiException {
|
||||
public Client call123testSpecialTags(Client body) throws ApiException {
|
||||
ApiResponse<Client> localVarResponse = call123testSpecialTagsWithHttpInfo(body);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param body client model (required)
|
||||
* @return ApiResponse<Client>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Client> call123testSpecialTagsWithHttpInfo(Client body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"call123testSpecialTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Client>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder call123testSpecialTagsRequestBuilder(Client body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -83,31 +124,15 @@ public class AnotherFakeApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"call123testSpecialTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@ package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.Client;
|
||||
@@ -35,7 +36,6 @@ import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FakeClassnameTags123Api {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
@@ -65,10 +65,51 @@ public class FakeClassnameTags123Api {
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client testClassname (Client body) throws ApiException {
|
||||
public Client testClassname(Client body) throws ApiException {
|
||||
ApiResponse<Client> localVarResponse = testClassnameWithHttpInfo(body);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* @param body client model (required)
|
||||
* @return ApiResponse<Client>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Client> testClassnameWithHttpInfo(Client body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"testClassname call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Client>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testClassnameRequestBuilder(Client body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -83,31 +124,15 @@ public class FakeClassnameTags123Api {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"testClassname call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import java.io.File;
|
||||
@@ -38,7 +39,6 @@ import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class PetApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
@@ -67,10 +67,50 @@ public class PetApi {
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void addPet (Pet body) throws ApiException {
|
||||
public void addPet(Pet body) throws ApiException {
|
||||
addPetWithHttpInfo(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> addPetWithHttpInfo(Pet body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"addPet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder addPetRequestBuilder(Pet body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling addPet");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling addPet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -85,31 +125,16 @@ public class PetApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"addPet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Deletes a pet
|
||||
@@ -118,10 +143,51 @@ public class PetApi {
|
||||
* @param apiKey (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deletePet (Long petId, String apiKey) throws ApiException {
|
||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||
deletePetWithHttpInfo(petId, apiKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deletePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder deletePetRequestBuilder(Long petId, String apiKey) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -136,33 +202,14 @@ public class PetApi {
|
||||
}
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deletePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Finds Pets by status
|
||||
@@ -171,10 +218,51 @@ public class PetApi {
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public List<Pet> findPetsByStatus (List<String> status) throws ApiException {
|
||||
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
||||
ApiResponse<List<Pet>> localVarResponse = findPetsByStatusWithHttpInfo(status);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for filter (required)
|
||||
* @return ApiResponse<List<Pet>>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByStatus call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<List<Pet>>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder findPetsByStatusRequestBuilder(List<String> status) throws ApiException {
|
||||
// verify the required parameter 'status' is set
|
||||
if (status == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
|
||||
throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -194,34 +282,14 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByStatus call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<Pet>>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
@@ -232,10 +300,53 @@ public class PetApi {
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public Set<Pet> findPetsByTags (Set<String> tags) throws ApiException {
|
||||
public Set<Pet> findPetsByTags(Set<String> tags) throws ApiException {
|
||||
ApiResponse<Set<Pet>> localVarResponse = findPetsByTagsWithHttpInfo(tags);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by (required)
|
||||
* @return ApiResponse<Set<Pet>>
|
||||
* @throws ApiException if fails to make API call
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public ApiResponse<Set<Pet>> findPetsByTagsWithHttpInfo(Set<String> tags) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Set<Pet>>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Set<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder findPetsByTagsRequestBuilder(Set<String> tags) throws ApiException {
|
||||
// verify the required parameter 'tags' is set
|
||||
if (tags == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
|
||||
throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -255,34 +366,14 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Set<Pet>>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Find pet by ID
|
||||
@@ -291,10 +382,51 @@ public class PetApi {
|
||||
* @return Pet
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Pet getPetById (Long petId) throws ApiException {
|
||||
public Pet getPetById(Long petId) throws ApiException {
|
||||
ApiResponse<Pet> localVarResponse = getPetByIdWithHttpInfo(petId);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* @param petId ID of pet to return (required)
|
||||
* @return ApiResponse<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getPetById call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Pet>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Pet>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getPetByIdRequestBuilder(Long petId) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById");
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -306,27 +438,52 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePet(Pet body) throws ApiException {
|
||||
updatePetWithHttpInfo(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> updatePetWithHttpInfo(Pet body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(body);
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getPetById call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updatePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Pet>() {});
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
@@ -335,16 +492,11 @@ public class PetApi {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePet (Pet body) throws ApiException {
|
||||
|
||||
private HttpRequest.Builder updatePetRequestBuilder(Pet body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -359,31 +511,16 @@ public class PetApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updatePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
@@ -393,10 +530,52 @@ public class PetApi {
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePetWithForm (Long petId, String name, String status) throws ApiException {
|
||||
public void updatePetWithForm(Long petId, String name, String status) throws ApiException {
|
||||
updatePetWithFormWithHttpInfo(petId, name, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updatePetWithForm call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updatePetWithFormRequestBuilder(Long petId, String name, String status) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm");
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -408,33 +587,14 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updatePetWithForm call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* uploads an image
|
||||
@@ -445,10 +605,53 @@ public class PetApi {
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ModelApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResponse = uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"uploadFile call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<ModelApiResponse>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -460,34 +663,14 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"uploadFile call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* uploads an image (required)
|
||||
@@ -498,14 +681,57 @@ public class PetApi {
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ModelApiResponse uploadFileWithRequiredFile (Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResponse = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param requiredFile file to upload (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"uploadFileWithRequiredFile call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<ModelApiResponse>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
|
||||
throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -517,33 +743,13 @@ public class PetApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"uploadFileWithRequiredFile call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.Order;
|
||||
@@ -35,7 +36,6 @@ import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class StoreApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
@@ -64,10 +64,50 @@ public class StoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteOrder (String orderId) throws ApiException {
|
||||
public void deleteOrder(String orderId) throws ApiException {
|
||||
deleteOrderWithHttpInfo(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deleteOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder deleteOrderRequestBuilder(String orderId) throws ApiException {
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -79,26 +119,52 @@ public class StoreApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* @return Map<String, Integer>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Map<String, Integer> getInventory() throws ApiException {
|
||||
ApiResponse<Map<String, Integer>> localVarResponse = getInventoryWithHttpInfo();
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* @return ApiResponse<Map<String, Integer>>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder();
|
||||
try {
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deleteOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getInventory call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Map<String, Integer>>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Map<String, Integer>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
@@ -107,13 +173,8 @@ public class StoreApi {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* @return Map<String, Integer>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Map<String, Integer> getInventory () throws ApiException {
|
||||
|
||||
private HttpRequest.Builder getInventoryRequestBuilder() throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
@@ -123,34 +184,14 @@ public class StoreApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getInventory call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Map<String, Integer>>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
@@ -159,10 +200,51 @@ public class StoreApi {
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Order getOrderById (Long orderId) throws ApiException {
|
||||
public Order getOrderById(Long orderId) throws ApiException {
|
||||
ApiResponse<Order> localVarResponse = getOrderByIdWithHttpInfo(orderId);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return ApiResponse<Order>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Order> getOrderByIdWithHttpInfo(Long orderId) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getOrderById call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Order>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getOrderByIdRequestBuilder(Long orderId) throws ApiException {
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -174,34 +256,14 @@ public class StoreApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getOrderById call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Place an order for a pet
|
||||
@@ -210,10 +272,51 @@ public class StoreApi {
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Order placeOrder (Order body) throws ApiException {
|
||||
public Order placeOrder(Order body) throws ApiException {
|
||||
ApiResponse<Order> localVarResponse = placeOrderWithHttpInfo(body);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet (required)
|
||||
* @return ApiResponse<Order>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Order> placeOrderWithHttpInfo(Order body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"placeOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Order>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder placeOrderRequestBuilder(Order body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -228,31 +331,15 @@ public class StoreApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"placeOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.User;
|
||||
@@ -35,7 +36,6 @@ import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class UserApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
@@ -64,10 +64,50 @@ public class UserApi {
|
||||
* @param body Created user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUser (User body) throws ApiException {
|
||||
public void createUser(User body) throws ApiException {
|
||||
createUserWithHttpInfo(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> createUserWithHttpInfo(User body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder createUserRequestBuilder(User body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -82,24 +122,54 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithArrayInput(List<User> body) throws ApiException {
|
||||
createUsersWithArrayInputWithHttpInfo(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> createUsersWithArrayInputWithHttpInfo(List<User> body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithArrayInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
@@ -108,16 +178,11 @@ public class UserApi {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithArrayInput (List<User> body) throws ApiException {
|
||||
|
||||
private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(List<User> body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -132,24 +197,54 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithListInput(List<User> body) throws ApiException {
|
||||
createUsersWithListInputWithHttpInfo(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> createUsersWithListInputWithHttpInfo(List<User> body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithArrayInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithListInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
@@ -158,16 +253,11 @@ public class UserApi {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithListInput (List<User> body) throws ApiException {
|
||||
|
||||
private HttpRequest.Builder createUsersWithListInputRequestBuilder(List<User> body) throws ApiException {
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -182,24 +272,54 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteUser(String username) throws ApiException {
|
||||
deleteUserWithHttpInfo(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> deleteUserWithHttpInfo(String username) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithListInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deleteUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
@@ -208,16 +328,11 @@ public class UserApi {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteUser (String username) throws ApiException {
|
||||
|
||||
private HttpRequest.Builder deleteUserRequestBuilder(String username) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -229,33 +344,14 @@ public class UserApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deleteUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Get user by user name
|
||||
@@ -264,10 +360,51 @@ public class UserApi {
|
||||
* @return User
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public User getUserByName (String username) throws ApiException {
|
||||
public User getUserByName(String username) throws ApiException {
|
||||
ApiResponse<User> localVarResponse = getUserByNameWithHttpInfo(username);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return ApiResponse<User>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getUserByName call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<User>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<User>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getUserByNameRequestBuilder(String username) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -279,34 +416,14 @@ public class UserApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getUserByName call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<User>() {});
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Logs user into the system
|
||||
@@ -316,14 +433,56 @@ public class UserApi {
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String loginUser (String username, String password) throws ApiException {
|
||||
public String loginUser(String username, String password) throws ApiException {
|
||||
ApiResponse<String> localVarResponse = loginUserWithHttpInfo(username, password);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login (required)
|
||||
* @param password The password for login in clear text (required)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<String> loginUserWithHttpInfo(String username, String password) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"loginUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<String>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<String>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder loginUserRequestBuilder(String username, String password) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");
|
||||
}
|
||||
// verify the required parameter 'password' is set
|
||||
if (password == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");
|
||||
throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -344,27 +503,50 @@ public class UserApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void logoutUser() throws ApiException {
|
||||
logoutUserWithHttpInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> logoutUserWithHttpInfo() throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder();
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"loginUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"logoutUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<String>() {});
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
@@ -373,12 +555,8 @@ public class UserApi {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void logoutUser () throws ApiException {
|
||||
|
||||
private HttpRequest.Builder logoutUserRequestBuilder() throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
@@ -388,33 +566,14 @@ public class UserApi {
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"logoutUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Updated user
|
||||
@@ -423,14 +582,55 @@ public class UserApi {
|
||||
* @param body Updated user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updateUser (String username, User body) throws ApiException {
|
||||
public void updateUser(String username, User body) throws ApiException {
|
||||
updateUserWithHttpInfo(username, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> updateUserWithHttpInfo(String username, User body) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, body);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updateUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updateUserRequestBuilder(String username, User body) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");
|
||||
}
|
||||
// verify the required parameter 'body' is set
|
||||
if (body == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");
|
||||
throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
@@ -446,30 +646,15 @@ public class UserApi {
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
|
||||
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updateUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user