[Java][google-api-client] Fix minor bugs in google api client (#6951)

* Fix minor bugs in google-api-client templates

* Update samples
This commit is contained in:
Charles Capps
2017-11-13 20:02:59 -08:00
committed by William Cheng
parent d719daab22
commit 47f1865e69
11 changed files with 198 additions and 464 deletions

View File

@@ -5,16 +5,16 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
{{#joda}} {{#joda}}
import com.fasterxml.jackson.datatype.joda.JodaModule; import com.fasterxml.jackson.datatype.joda.JodaModule;
{{/joda}} {{/joda}}
{{#java8}} {{#java8}}
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
{{/java8}} {{/java8}}
{{#threetenbp}} {{#threetenbp}}
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
{{/threetenbp}} {{/threetenbp}}
{{#threetenbp}} {{#threetenbp}}
import org.threeten.bp.*; import org.threeten.bp.*;
{{/threetenbp}} {{/threetenbp}}
import com.google.api.client.googleapis.util.Utils; import com.google.api.client.googleapis.util.Utils;
import com.google.api.client.http.AbstractHttpContent; import com.google.api.client.http.AbstractHttpContent;
@@ -26,9 +26,6 @@ import com.google.api.client.json.Json;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
{{>generatedAnnotation}} {{>generatedAnnotation}}
public class ApiClient { public class ApiClient {
private final String basePath; private final String basePath;

View File

@@ -72,45 +72,40 @@ public class {{classname}} {
{{/externalDocs}} {{/externalDocs}}
**/ **/
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException { public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
{{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}params);{{#returnType}} {{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}params);{{#returnType}}
TypeReference typeRef = new TypeReference<{{{returnType}}}>() {}; TypeReference typeRef = new TypeReference<{{{returnType}}}>() {};
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}} return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}}
} }
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws IOException { public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws IOException {
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) { if ({{paramName}} == null) {
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}"); throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
} }{{/required}}{{/allParams}}
{{/required}}{{/allParams}}
{{#hasPathParams}} {{#hasPathParams}}
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();{{#pathParams}} final Map<String, Object> uriVariables = new HashMap<String, Object>();{{#pathParams}}
uriVariables.put("{{baseName}}", {{{paramName}}});{{/pathParams}} uriVariables.put("{{baseName}}", {{{paramName}}});{{/pathParams}}
{{/hasPathParams}} {{/hasPathParams}}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "{{{path}}}");{{#hasQueryParams}} UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "{{{path}}}");{{#hasQueryParams}}
{{#queryParams}}if ({{paramName}} != null) { {{#queryParams}}
if ({{paramName}} != null) {
uriBuilder = uriBuilder.queryParam("{{baseName}}", {{paramName}}); uriBuilder = uriBuilder.queryParam("{{baseName}}", {{paramName}});
}{{#hasMore}}{{/hasMore}}{{/queryParams}}{{/hasQueryParams}} }{{/queryParams}}{{/hasQueryParams}}
String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}}
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = {{#bodyParam}}{{paramName}} == null ? null : apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
} }
public HttpResponse {{operationId}}ForHttpResponse({{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException { public HttpResponse {{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
Object {{localVariablePrefix}}postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) { if ({{paramName}} == null) {
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}"); throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
} }{{/required}}{{/allParams}}
{{/required}}{{/allParams}}
{{#hasPathParams}} {{#hasPathParams}}
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();{{#pathParams}} final Map<String, Object> uriVariables = new HashMap<String, Object>();{{#pathParams}}
@@ -118,14 +113,12 @@ public class {{classname}} {
{{/hasPathParams}} {{/hasPathParams}}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "{{{path}}}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "{{{path}}}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);{{#queryParams}}{{#required}}
}{{#queryParams}}{{#required}}
// Add the required query param '{{paramName}}' to the map of query params // Add the required query param '{{paramName}}' to the map of query params
params.put("{{paramName}}", {{paramName}});{{/required}}{{/queryParams}} allParams.put("{{paramName}}", {{paramName}});{{/required}}{{/queryParams}}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -138,11 +131,10 @@ public class {{classname}} {
} }
} }
String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}}
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = {{#bodyParam}}{{paramName}} == null ? null : apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
} }

View File

@@ -268,7 +268,7 @@ FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = _byte_example; // byte[] | None byte[] _byte = B; // byte[] | None
Integer integer = 56; // Integer | None Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | None Integer int32 = 56; // Integer | None
Long int64 = 789L; // Long | None Long int64 = 789L; // Long | None

View File

@@ -36,7 +36,7 @@ git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git

View File

@@ -4,8 +4,8 @@ import io.swagger.client.api.*;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import org.threeten.bp.*; import org.threeten.bp.*;
import com.google.api.client.googleapis.util.Utils; import com.google.api.client.googleapis.util.Utils;
import com.google.api.client.http.AbstractHttpContent; import com.google.api.client.http.AbstractHttpContent;
import com.google.api.client.http.HttpRequestFactory; import com.google.api.client.http.HttpRequestFactory;
@@ -16,9 +16,6 @@ import com.google.api.client.json.Json;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class ApiClient { public class ApiClient {
private final String basePath; private final String basePath;

View File

@@ -68,37 +68,30 @@ public class AnotherFakeApi {
} }
public HttpResponse testSpecialTagsForHttpResponse(Client body) throws IOException { public HttpResponse testSpecialTagsForHttpResponse(Client body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
} }
public HttpResponse testSpecialTagsForHttpResponse(Client body, Map<String, Object> params) throws IOException { public HttpResponse testSpecialTagsForHttpResponse(Client body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -111,11 +104,10 @@ public class AnotherFakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
} }

View File

@@ -58,7 +58,6 @@ public class FakeApi {
/** /**
* Test serialization of outer boolean types * Test serialization of outer boolean types
* <p><b>200</b> - Output boolean * <p><b>200</b> - Output boolean
* @param body Input boolean as post body
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
* @return Boolean * @return Boolean
* @throws IOException if an error occurs while attempting to invoke the API * @throws IOException if an error occurs while attempting to invoke the API
@@ -70,27 +69,24 @@ public class FakeApi {
} }
public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean body) throws IOException { public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean body) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean body, Map<String, Object> params) throws IOException { public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -103,11 +99,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -128,7 +123,6 @@ public class FakeApi {
/** /**
* Test serialization of object with outer number type * Test serialization of object with outer number type
* <p><b>200</b> - Output composite * <p><b>200</b> - Output composite
* @param body Input composite as post body
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
* @return OuterComposite * @return OuterComposite
* @throws IOException if an error occurs while attempting to invoke the API * @throws IOException if an error occurs while attempting to invoke the API
@@ -140,27 +134,24 @@ public class FakeApi {
} }
public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite body) throws IOException { public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite body) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite body, Map<String, Object> params) throws IOException { public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -173,11 +164,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -198,7 +188,6 @@ public class FakeApi {
/** /**
* Test serialization of outer number types * Test serialization of outer number types
* <p><b>200</b> - Output number * <p><b>200</b> - Output number
* @param body Input number as post body
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
* @return BigDecimal * @return BigDecimal
* @throws IOException if an error occurs while attempting to invoke the API * @throws IOException if an error occurs while attempting to invoke the API
@@ -210,27 +199,24 @@ public class FakeApi {
} }
public HttpResponse fakeOuterNumberSerializeForHttpResponse(BigDecimal body) throws IOException { public HttpResponse fakeOuterNumberSerializeForHttpResponse(BigDecimal body) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse fakeOuterNumberSerializeForHttpResponse(BigDecimal body, Map<String, Object> params) throws IOException { public HttpResponse fakeOuterNumberSerializeForHttpResponse(BigDecimal body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -243,11 +229,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -268,7 +253,6 @@ public class FakeApi {
/** /**
* Test serialization of outer string types * Test serialization of outer string types
* <p><b>200</b> - Output string * <p><b>200</b> - Output string
* @param body Input string as post body
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
* @return String * @return String
* @throws IOException if an error occurs while attempting to invoke the API * @throws IOException if an error occurs while attempting to invoke the API
@@ -280,27 +264,24 @@ public class FakeApi {
} }
public HttpResponse fakeOuterStringSerializeForHttpResponse(String body) throws IOException { public HttpResponse fakeOuterStringSerializeForHttpResponse(String body) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse fakeOuterStringSerializeForHttpResponse(String body, Map<String, Object> params) throws IOException { public HttpResponse fakeOuterStringSerializeForHttpResponse(String body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -313,11 +294,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -352,37 +332,30 @@ public class FakeApi {
} }
public HttpResponse testClientModelForHttpResponse(Client body) throws IOException { public HttpResponse testClientModelForHttpResponse(Client body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
} }
public HttpResponse testClientModelForHttpResponse(Client body, Map<String, Object> params) throws IOException { public HttpResponse testClientModelForHttpResponse(Client body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -395,11 +368,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
} }
@@ -446,67 +418,48 @@ public class FakeApi {
} }
public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws IOException { public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws IOException {
Object postBody = null;
// verify the required parameter 'number' is set // verify the required parameter 'number' is set
if (number == null) { if (number == null) {
throw new IllegalArgumentException("Missing the required parameter 'number' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter 'number' when calling testEndpointParameters");
} }// verify the required parameter '_double' is set
// verify the required parameter '_double' is set
if (_double == null) { if (_double == null) {
throw new IllegalArgumentException("Missing the required parameter '_double' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter '_double' when calling testEndpointParameters");
} }// verify the required parameter 'patternWithoutDelimiter' is set
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter == null) { if (patternWithoutDelimiter == null) {
throw new IllegalArgumentException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
} }// verify the required parameter '_byte' is set
// verify the required parameter '_byte' is set
if (_byte == null) { if (_byte == null) {
throw new IllegalArgumentException("Missing the required parameter '_byte' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter '_byte' when calling testEndpointParameters");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Map<String, Object> params) throws IOException { public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'number' is set // verify the required parameter 'number' is set
if (number == null) { if (number == null) {
throw new IllegalArgumentException("Missing the required parameter 'number' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter 'number' when calling testEndpointParameters");
} }// verify the required parameter '_double' is set
// verify the required parameter '_double' is set
if (_double == null) { if (_double == null) {
throw new IllegalArgumentException("Missing the required parameter '_double' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter '_double' when calling testEndpointParameters");
} }// verify the required parameter 'patternWithoutDelimiter' is set
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter == null) { if (patternWithoutDelimiter == null) {
throw new IllegalArgumentException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
} }// verify the required parameter '_byte' is set
// verify the required parameter '_byte' is set
if (_byte == null) { if (_byte == null) {
throw new IllegalArgumentException("Missing the required parameter '_byte' when calling testEndpointParameters"); throw new IllegalArgumentException("Missing the required parameter '_byte' when calling testEndpointParameters");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -519,11 +472,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -560,34 +512,31 @@ public class FakeApi {
} }
public HttpResponse testEnumParametersForHttpResponse(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws IOException { public HttpResponse testEnumParametersForHttpResponse(List<String> enumFormStringArray, String enumFormString, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws IOException {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (enumQueryStringArray != null) { if (enumQueryStringArray != null) {
uriBuilder = uriBuilder.queryParam("enum_query_string_array", enumQueryStringArray); uriBuilder = uriBuilder.queryParam("enum_query_string_array", enumQueryStringArray);
}if (enumQueryString != null) { } if (enumQueryString != null) {
uriBuilder = uriBuilder.queryParam("enum_query_string", enumQueryString); uriBuilder = uriBuilder.queryParam("enum_query_string", enumQueryString);
}if (enumQueryInteger != null) { } if (enumQueryInteger != null) {
uriBuilder = uriBuilder.queryParam("enum_query_integer", enumQueryInteger); uriBuilder = uriBuilder.queryParam("enum_query_integer", enumQueryInteger);
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse testEnumParametersForHttpResponse(Map<String, Object> params) throws IOException { public HttpResponse testEnumParametersForHttpResponse(Map<String, Object> params) throws IOException {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -600,11 +549,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -633,37 +581,30 @@ public class FakeApi {
} }
public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param) throws IOException { public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param) throws IOException {
Object postBody = param;
// verify the required parameter 'param' is set // verify the required parameter 'param' is set
if (param == null) { if (param == null) {
throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = param == null ? null : apiClient.new JacksonJsonHttpContent(param);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param, Map<String, Object> params) throws IOException { public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param, Map<String, Object> params) throws IOException {
Object postBody = param;
// verify the required parameter 'param' is set // verify the required parameter 'param' is set
if (param == null) { if (param == null) {
throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -676,11 +617,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = param == null ? null : apiClient.new JacksonJsonHttpContent(param);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -711,47 +651,36 @@ public class FakeApi {
} }
public HttpResponse testJsonFormDataForHttpResponse(String param, String param2) throws IOException { public HttpResponse testJsonFormDataForHttpResponse(String param, String param2) throws IOException {
Object postBody = null;
// verify the required parameter 'param' is set // verify the required parameter 'param' is set
if (param == null) { if (param == null) {
throw new IllegalArgumentException("Missing the required parameter 'param' when calling testJsonFormData"); throw new IllegalArgumentException("Missing the required parameter 'param' when calling testJsonFormData");
} }// verify the required parameter 'param2' is set
// verify the required parameter 'param2' is set
if (param2 == null) { if (param2 == null) {
throw new IllegalArgumentException("Missing the required parameter 'param2' when calling testJsonFormData"); throw new IllegalArgumentException("Missing the required parameter 'param2' when calling testJsonFormData");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/jsonFormData"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/jsonFormData");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse testJsonFormDataForHttpResponse(String param, String param2, Map<String, Object> params) throws IOException { public HttpResponse testJsonFormDataForHttpResponse(String param, String param2, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'param' is set // verify the required parameter 'param' is set
if (param == null) { if (param == null) {
throw new IllegalArgumentException("Missing the required parameter 'param' when calling testJsonFormData"); throw new IllegalArgumentException("Missing the required parameter 'param' when calling testJsonFormData");
} }// verify the required parameter 'param2' is set
// verify the required parameter 'param2' is set
if (param2 == null) { if (param2 == null) {
throw new IllegalArgumentException("Missing the required parameter 'param2' when calling testJsonFormData"); throw new IllegalArgumentException("Missing the required parameter 'param2' when calling testJsonFormData");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/jsonFormData"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/jsonFormData");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -764,11 +693,10 @@ public class FakeApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }

View File

@@ -66,37 +66,30 @@ public class FakeClassnameTags123Api {
} }
public HttpResponse testClassnameForHttpResponse(Client body) throws IOException { public HttpResponse testClassnameForHttpResponse(Client body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
} }
public HttpResponse testClassnameForHttpResponse(Client body, Map<String, Object> params) throws IOException { public HttpResponse testClassnameForHttpResponse(Client body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -109,11 +102,10 @@ public class FakeClassnameTags123Api {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
} }

View File

@@ -64,37 +64,30 @@ public class PetApi {
} }
public HttpResponse addPetForHttpResponse(Pet body) throws IOException { public HttpResponse addPetForHttpResponse(Pet body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling addPet"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling addPet");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse addPetForHttpResponse(Pet body, Map<String, Object> params) throws IOException { public HttpResponse addPetForHttpResponse(Pet body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling addPet"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling addPet");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -107,11 +100,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -141,13 +133,10 @@ public class PetApi {
} }
public HttpResponse deletePetForHttpResponse(Long petId, String apiKey) throws IOException { public HttpResponse deletePetForHttpResponse(Long petId, String apiKey) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling deletePet"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling deletePet");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
@@ -156,28 +145,24 @@ public class PetApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute();
} }
public HttpResponse deletePetForHttpResponse(Long petId, Map<String, Object> params) throws IOException { public HttpResponse deletePetForHttpResponse(Long petId, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling deletePet"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling deletePet");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -190,11 +175,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute();
} }
@@ -231,13 +215,10 @@ public class PetApi {
} }
public HttpResponse findPetsByStatusForHttpResponse(List<String> status) throws IOException { public HttpResponse findPetsByStatusForHttpResponse(List<String> status) throws IOException {
Object postBody = null;
// verify the required parameter 'status' is set // verify the required parameter 'status' is set
if (status == null) { if (status == null) {
throw new IllegalArgumentException("Missing the required parameter 'status' when calling findPetsByStatus"); throw new IllegalArgumentException("Missing the required parameter 'status' when calling findPetsByStatus");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByStatus"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByStatus");
if (status != null) { if (status != null) {
uriBuilder = uriBuilder.queryParam("status", status); uriBuilder = uriBuilder.queryParam("status", status);
@@ -246,28 +227,23 @@ public class PetApi {
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse findPetsByStatusForHttpResponse(List<String> status, Map<String, Object> params) throws IOException { public HttpResponse findPetsByStatusForHttpResponse(List<String> status, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'status' is set // verify the required parameter 'status' is set
if (status == null) { if (status == null) {
throw new IllegalArgumentException("Missing the required parameter 'status' when calling findPetsByStatus"); throw new IllegalArgumentException("Missing the required parameter 'status' when calling findPetsByStatus");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByStatus"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByStatus");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
// Add the required query param 'status' to the map of query params // Add the required query param 'status' to the map of query params
params.put("status", status); allParams.put("status", status);
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -280,11 +256,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -321,13 +296,10 @@ public class PetApi {
} }
public HttpResponse findPetsByTagsForHttpResponse(List<String> tags) throws IOException { public HttpResponse findPetsByTagsForHttpResponse(List<String> tags) throws IOException {
Object postBody = null;
// verify the required parameter 'tags' is set // verify the required parameter 'tags' is set
if (tags == null) { if (tags == null) {
throw new IllegalArgumentException("Missing the required parameter 'tags' when calling findPetsByTags"); throw new IllegalArgumentException("Missing the required parameter 'tags' when calling findPetsByTags");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByTags"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByTags");
if (tags != null) { if (tags != null) {
uriBuilder = uriBuilder.queryParam("tags", tags); uriBuilder = uriBuilder.queryParam("tags", tags);
@@ -336,28 +308,23 @@ public class PetApi {
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse findPetsByTagsForHttpResponse(List<String> tags, Map<String, Object> params) throws IOException { public HttpResponse findPetsByTagsForHttpResponse(List<String> tags, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'tags' is set // verify the required parameter 'tags' is set
if (tags == null) { if (tags == null) {
throw new IllegalArgumentException("Missing the required parameter 'tags' when calling findPetsByTags"); throw new IllegalArgumentException("Missing the required parameter 'tags' when calling findPetsByTags");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByTags"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/findByTags");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
// Add the required query param 'tags' to the map of query params // Add the required query param 'tags' to the map of query params
params.put("tags", tags); allParams.put("tags", tags);
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -370,11 +337,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -413,13 +379,10 @@ public class PetApi {
} }
public HttpResponse getPetByIdForHttpResponse(Long petId) throws IOException { public HttpResponse getPetByIdForHttpResponse(Long petId) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling getPetById"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling getPetById");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
@@ -428,28 +391,24 @@ public class PetApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse getPetByIdForHttpResponse(Long petId, Map<String, Object> params) throws IOException { public HttpResponse getPetByIdForHttpResponse(Long petId, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling getPetById"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling getPetById");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -462,11 +421,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -499,37 +457,30 @@ public class PetApi {
} }
public HttpResponse updatePetForHttpResponse(Pet body) throws IOException { public HttpResponse updatePetForHttpResponse(Pet body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePet"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePet");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
} }
public HttpResponse updatePetForHttpResponse(Pet body, Map<String, Object> params) throws IOException { public HttpResponse updatePetForHttpResponse(Pet body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePet"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling updatePet");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -542,11 +493,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
} }
@@ -577,13 +527,10 @@ public class PetApi {
} }
public HttpResponse updatePetWithFormForHttpResponse(Long petId, String name, String status) throws IOException { public HttpResponse updatePetWithFormForHttpResponse(Long petId, String name, String status) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling updatePetWithForm"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling updatePetWithForm");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
@@ -592,28 +539,24 @@ public class PetApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse updatePetWithFormForHttpResponse(Long petId, Map<String, Object> params) throws IOException { public HttpResponse updatePetWithFormForHttpResponse(Long petId, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling updatePetWithForm"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling updatePetWithForm");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -626,11 +569,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -667,13 +609,10 @@ public class PetApi {
} }
public HttpResponse uploadFileForHttpResponse(Long petId, String additionalMetadata, File file) throws IOException { public HttpResponse uploadFileForHttpResponse(Long petId, String additionalMetadata, File file) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling uploadFile"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling uploadFile");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
@@ -682,28 +621,24 @@ public class PetApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse uploadFileForHttpResponse(Long petId, Map<String, Object> params) throws IOException { public HttpResponse uploadFileForHttpResponse(Long petId, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'petId' is set // verify the required parameter 'petId' is set
if (petId == null) { if (petId == null) {
throw new IllegalArgumentException("Missing the required parameter 'petId' when calling uploadFile"); throw new IllegalArgumentException("Missing the required parameter 'petId' when calling uploadFile");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId); uriVariables.put("petId", petId);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}/uploadImage"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}/uploadImage");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -716,11 +651,10 @@ public class PetApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }

View File

@@ -64,13 +64,10 @@ public class StoreApi {
} }
public HttpResponse deleteOrderForHttpResponse(String orderId) throws IOException { public HttpResponse deleteOrderForHttpResponse(String orderId) throws IOException {
Object postBody = null;
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
if (orderId == null) { if (orderId == null) {
throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling deleteOrder"); throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling deleteOrder");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId); uriVariables.put("order_id", orderId);
@@ -79,28 +76,24 @@ public class StoreApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute();
} }
public HttpResponse deleteOrderForHttpResponse(String orderId, Map<String, Object> params) throws IOException { public HttpResponse deleteOrderForHttpResponse(String orderId, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
if (orderId == null) { if (orderId == null) {
throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling deleteOrder"); throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling deleteOrder");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId); uriVariables.put("order_id", orderId);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -113,11 +106,10 @@ public class StoreApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute();
} }
@@ -150,27 +142,24 @@ public class StoreApi {
} }
public HttpResponse getInventoryForHttpResponse() throws IOException { public HttpResponse getInventoryForHttpResponse() throws IOException {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/inventory"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/inventory");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse getInventoryForHttpResponse(Map<String, Object> params) throws IOException { public HttpResponse getInventoryForHttpResponse(Map<String, Object> params) throws IOException {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/inventory"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/inventory");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -183,11 +172,10 @@ public class StoreApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -226,13 +214,10 @@ public class StoreApi {
} }
public HttpResponse getOrderByIdForHttpResponse(Long orderId) throws IOException { public HttpResponse getOrderByIdForHttpResponse(Long orderId) throws IOException {
Object postBody = null;
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
if (orderId == null) { if (orderId == null) {
throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling getOrderById"); throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling getOrderById");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId); uriVariables.put("order_id", orderId);
@@ -241,28 +226,24 @@ public class StoreApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse getOrderByIdForHttpResponse(Long orderId, Map<String, Object> params) throws IOException { public HttpResponse getOrderByIdForHttpResponse(Long orderId, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'orderId' is set // verify the required parameter 'orderId' is set
if (orderId == null) { if (orderId == null) {
throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling getOrderById"); throw new IllegalArgumentException("Missing the required parameter 'orderId' when calling getOrderById");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId); uriVariables.put("order_id", orderId);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -275,11 +256,10 @@ public class StoreApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -316,37 +296,30 @@ public class StoreApi {
} }
public HttpResponse placeOrderForHttpResponse(Order body) throws IOException { public HttpResponse placeOrderForHttpResponse(Order body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling placeOrder"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling placeOrder");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse placeOrderForHttpResponse(Order body, Map<String, Object> params) throws IOException { public HttpResponse placeOrderForHttpResponse(Order body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling placeOrder"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling placeOrder");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -359,11 +332,10 @@ public class StoreApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }

View File

@@ -62,37 +62,30 @@ public class UserApi {
} }
public HttpResponse createUserForHttpResponse(User body) throws IOException { public HttpResponse createUserForHttpResponse(User body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUser"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUser");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse createUserForHttpResponse(User body, Map<String, Object> params) throws IOException { public HttpResponse createUserForHttpResponse(User body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUser"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUser");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -105,11 +98,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -138,37 +130,30 @@ public class UserApi {
} }
public HttpResponse createUsersWithArrayInputForHttpResponse(List<User> body) throws IOException { public HttpResponse createUsersWithArrayInputForHttpResponse(List<User> body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithArrayInput"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithArrayInput");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse createUsersWithArrayInputForHttpResponse(List<User> body, Map<String, Object> params) throws IOException { public HttpResponse createUsersWithArrayInputForHttpResponse(List<User> body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithArrayInput"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithArrayInput");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -181,11 +166,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -214,37 +198,30 @@ public class UserApi {
} }
public HttpResponse createUsersWithListInputForHttpResponse(List<User> body) throws IOException { public HttpResponse createUsersWithListInputForHttpResponse(List<User> body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithListInput"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithListInput");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
public HttpResponse createUsersWithListInputForHttpResponse(List<User> body, Map<String, Object> params) throws IOException { public HttpResponse createUsersWithListInputForHttpResponse(List<User> body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set // verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithListInput"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling createUsersWithListInput");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -257,11 +234,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute();
} }
@@ -292,13 +268,10 @@ public class UserApi {
} }
public HttpResponse deleteUserForHttpResponse(String username) throws IOException { public HttpResponse deleteUserForHttpResponse(String username) throws IOException {
Object postBody = null;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling deleteUser"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling deleteUser");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username); uriVariables.put("username", username);
@@ -307,28 +280,24 @@ public class UserApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute();
} }
public HttpResponse deleteUserForHttpResponse(String username, Map<String, Object> params) throws IOException { public HttpResponse deleteUserForHttpResponse(String username, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling deleteUser"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling deleteUser");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username); uriVariables.put("username", username);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -341,11 +310,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute();
} }
@@ -384,13 +352,10 @@ public class UserApi {
} }
public HttpResponse getUserByNameForHttpResponse(String username) throws IOException { public HttpResponse getUserByNameForHttpResponse(String username) throws IOException {
Object postBody = null;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling getUserByName"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling getUserByName");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username); uriVariables.put("username", username);
@@ -399,28 +364,24 @@ public class UserApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse getUserByNameForHttpResponse(String username, Map<String, Object> params) throws IOException { public HttpResponse getUserByNameForHttpResponse(String username, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling getUserByName"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling getUserByName");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username); uriVariables.put("username", username);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -433,11 +394,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -476,58 +436,45 @@ public class UserApi {
} }
public HttpResponse loginUserForHttpResponse(String username, String password) throws IOException { public HttpResponse loginUserForHttpResponse(String username, String password) throws IOException {
Object postBody = null;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling loginUser"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling loginUser");
} }// verify the required parameter 'password' is set
// verify the required parameter 'password' is set
if (password == null) { if (password == null) {
throw new IllegalArgumentException("Missing the required parameter 'password' when calling loginUser"); throw new IllegalArgumentException("Missing the required parameter 'password' when calling loginUser");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/login"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/login");
if (username != null) { if (username != null) {
uriBuilder = uriBuilder.queryParam("username", username); uriBuilder = uriBuilder.queryParam("username", username);
}if (password != null) { } if (password != null) {
uriBuilder = uriBuilder.queryParam("password", password); uriBuilder = uriBuilder.queryParam("password", password);
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse loginUserForHttpResponse(String username, String password, Map<String, Object> params) throws IOException { public HttpResponse loginUserForHttpResponse(String username, String password, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling loginUser"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling loginUser");
} }// verify the required parameter 'password' is set
// verify the required parameter 'password' is set
if (password == null) { if (password == null) {
throw new IllegalArgumentException("Missing the required parameter 'password' when calling loginUser"); throw new IllegalArgumentException("Missing the required parameter 'password' when calling loginUser");
} }
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/login"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/login");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
// Add the required query param 'username' to the map of query params // Add the required query param 'username' to the map of query params
params.put("username", username); allParams.put("username", username);
// Add the required query param 'password' to the map of query params // Add the required query param 'password' to the map of query params
params.put("password", password); allParams.put("password", password);
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -540,11 +487,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -571,27 +517,24 @@ public class UserApi {
} }
public HttpResponse logoutUserForHttpResponse() throws IOException { public HttpResponse logoutUserForHttpResponse() throws IOException {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/logout"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/logout");
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
public HttpResponse logoutUserForHttpResponse(Map<String, Object> params) throws IOException { public HttpResponse logoutUserForHttpResponse(Map<String, Object> params) throws IOException {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/logout"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/logout");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -604,11 +547,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.build().toString(); String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = null;
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();
} }
@@ -641,18 +583,13 @@ public class UserApi {
} }
public HttpResponse updateUserForHttpResponse(String username, User body) throws IOException { public HttpResponse updateUserForHttpResponse(String username, User body) throws IOException {
Object postBody = body;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling updateUser"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling updateUser");
} }// verify the required parameter 'body' is set
// verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateUser"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateUser");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username); uriVariables.put("username", username);
@@ -661,33 +598,27 @@ public class UserApi {
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
} }
public HttpResponse updateUserForHttpResponse(String username, User body, Map<String, Object> params) throws IOException { public HttpResponse updateUserForHttpResponse(String username, User body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) { if (username == null) {
throw new IllegalArgumentException("Missing the required parameter 'username' when calling updateUser"); throw new IllegalArgumentException("Missing the required parameter 'username' when calling updateUser");
} }// verify the required parameter 'body' is set
// verify the required parameter 'body' is set
if (body == null) { if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateUser"); throw new IllegalArgumentException("Missing the required parameter 'body' when calling updateUser");
} }
// create a map of path variables // create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>(); final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username); uriVariables.put("username", username);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}");
if (params == null) { // Copy the params argument if present, to allow passing in immutable maps
params = new HashMap<String, Object>(); Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<String, Object>(params);
}
for (Map.Entry<String, Object> entry: params.entrySet()) { for (Map.Entry<String, Object> entry: allParams.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
Object value = entry.getValue(); Object value = entry.getValue();
@@ -700,11 +631,10 @@ public class UserApi {
} }
} }
String url = uriBuilder.buildFromMap(uriVariables).toString(); String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url); GenericUrl genericUrl = new GenericUrl(url);
HttpContent content = postBody == null ? null : apiClient.new JacksonJsonHttpContent(postBody); HttpContent content = body == null ? null : apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();
} }