[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.SerializationFeature;
{{#joda}}
import com.fasterxml.jackson.datatype.joda.JodaModule;
import com.fasterxml.jackson.datatype.joda.JodaModule;
{{/joda}}
{{#java8}}
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
{{/java8}}
{{#threetenbp}}
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
{{/threetenbp}}
{{#threetenbp}}
import org.threeten.bp.*;
import org.threeten.bp.*;
{{/threetenbp}}
import com.google.api.client.googleapis.util.Utils;
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.OutputStream;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
{{>generatedAnnotation}}
public class ApiClient {
private final String basePath;

View File

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

View File

@ -268,7 +268,7 @@ FakeApi apiInstance = new FakeApi();
BigDecimal number = new BigDecimal(); // BigDecimal | None
Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = _byte_example; // byte[] | None
byte[] _byte = B; // byte[] | None
Integer integer = 56; // Integer | None
Integer int32 = 56; // Integer | 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_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
else
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.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import org.threeten.bp.*;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import org.threeten.bp.*;
import com.google.api.client.googleapis.util.Utils;
import com.google.api.client.http.AbstractHttpContent;
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.OutputStream;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class ApiClient {
private final String basePath;

View File

@ -68,37 +68,30 @@ public class AnotherFakeApi {
}
public HttpResponse testSpecialTagsForHttpResponse(Client body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse testSpecialTagsForHttpResponse(Client body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testSpecialTags");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -111,11 +104,10 @@ public class AnotherFakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}

View File

@ -58,7 +58,6 @@ public class FakeApi {
/**
* Test serialization of outer boolean types
* <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.
* @return Boolean
* @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 {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse fakeOuterBooleanSerializeForHttpResponse(Boolean body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -103,11 +99,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -128,7 +123,6 @@ public class FakeApi {
/**
* Test serialization of object with outer number type
* <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.
* @return OuterComposite
* @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 {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse fakeOuterCompositeSerializeForHttpResponse(OuterComposite body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -173,11 +164,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -198,7 +188,6 @@ public class FakeApi {
/**
* Test serialization of outer number types
* <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.
* @return BigDecimal
* @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 {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse fakeOuterNumberSerializeForHttpResponse(BigDecimal body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -243,11 +229,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -268,7 +253,6 @@ public class FakeApi {
/**
* Test serialization of outer string types
* <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.
* @return String
* @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 {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse fakeOuterStringSerializeForHttpResponse(String body, Map<String, Object> params) throws IOException {
Object postBody = body;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -313,11 +294,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -352,37 +332,30 @@ public class FakeApi {
}
public HttpResponse testClientModelForHttpResponse(Client body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse testClientModelForHttpResponse(Client body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClientModel");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -395,11 +368,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -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 {
Object postBody = null;
// verify the required parameter 'number' is set
if (number == null) {
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) {
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) {
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) {
throw new IllegalArgumentException("Missing the required parameter '_byte' when calling testEndpointParameters");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
String url = uriBuilder.build().toString();
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();
}
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
if (number == null) {
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) {
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) {
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) {
throw new IllegalArgumentException("Missing the required parameter '_byte' when calling testEndpointParameters");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -519,11 +472,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -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 {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (enumQueryStringArray != null) {
uriBuilder = uriBuilder.queryParam("enum_query_string_array", enumQueryStringArray);
}if (enumQueryString != null) {
} if (enumQueryString != null) {
uriBuilder = uriBuilder.queryParam("enum_query_string", enumQueryString);
}if (enumQueryInteger != null) {
} if (enumQueryInteger != null) {
uriBuilder = uriBuilder.queryParam("enum_query_integer", enumQueryInteger);
}
String url = uriBuilder.build().toString();
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();
}
public HttpResponse testEnumParametersForHttpResponse(Map<String, Object> params) throws IOException {
Object postBody = null;
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -600,11 +549,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -633,37 +581,30 @@ public class FakeApi {
}
public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param) throws IOException {
Object postBody = param;
// verify the required parameter 'param' is set
if (param == null) {
throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse testInlineAdditionalPropertiesForHttpResponse(Object param, Map<String, Object> params) throws IOException {
Object postBody = param;
// verify the required parameter 'param' is set
if (param == null) {
throw new IllegalArgumentException("Missing the required parameter 'param' when calling testInlineAdditionalProperties");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -676,11 +617,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}
@ -711,47 +651,36 @@ public class FakeApi {
}
public HttpResponse testJsonFormDataForHttpResponse(String param, String param2) throws IOException {
Object postBody = null;
// verify the required parameter 'param' is set
if (param == null) {
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) {
throw new IllegalArgumentException("Missing the required parameter 'param2' when calling testJsonFormData");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/jsonFormData");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse testJsonFormDataForHttpResponse(String param, String param2, Map<String, Object> params) throws IOException {
Object postBody = null;
// verify the required parameter 'param' is set
if (param == null) {
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) {
throw new IllegalArgumentException("Missing the required parameter 'param2' when calling testJsonFormData");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/jsonFormData");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -764,11 +693,10 @@ public class FakeApi {
}
}
String url = uriBuilder.build().toString();
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();
}

View File

@ -66,37 +66,30 @@ public class FakeClassnameTags123Api {
}
public HttpResponse testClassnameForHttpResponse(Client body) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test");
String url = uriBuilder.build().toString();
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();
}
public HttpResponse testClassnameForHttpResponse(Client body, Map<String, Object> params) throws IOException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new IllegalArgumentException("Missing the required parameter 'body' when calling testClassname");
}
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test");
if (params == null) {
params = new HashMap<String, Object>();
}
// Copy the params argument if present, to allow passing in immutable maps
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();
Object value = entry.getValue();
@ -109,11 +102,10 @@ public class FakeClassnameTags123Api {
}
}
String url = uriBuilder.build().toString();
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();
}

View File

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

View File

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

View File

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