Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ public class {{classname}} {
GenericUrl genericUrl = new GenericUrl(localVarUrl);

HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}};
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
com.google.api.client.http.HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content);
{{#headerParams}}
if ({{paramName}} != null) {
httpRequest.getHeaders().set("{{baseName}}", {{paramName}});
}
{{/headerParams}}
return httpRequest.execute();
}{{#bodyParam}}

{{#isDeprecated}}
Expand Down Expand Up @@ -159,7 +165,13 @@ public class {{classname}} {
HttpContent content = {{#bodyParam}}{{paramName}} == null ?
apiClient.new JacksonJsonHttpContent(null) :
new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, {{paramName}}){{/bodyParam}};
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
com.google.api.client.http.HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content);
{{#headerParams}}
if ({{paramName}} != null) {
httpRequest.getHeaders().set("{{baseName}}", {{paramName}});
}
{{/headerParams}}
return httpRequest.execute();
}{{/bodyParam}}

{{#isDeprecated}}
Expand Down Expand Up @@ -201,7 +213,21 @@ public class {{classname}} {
GenericUrl genericUrl = new GenericUrl(localVarUrl);

HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}};
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
com.google.api.client.http.HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content);
{{#hasHeaderParams}}
// Note: Header params passed via 'params' map are handled below
for (Map.Entry<String, Object> entry: params.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
// Check if this is a header parameter by name
{{#headerParams}}
if ("{{baseName}}".equals(key) && value != null) {
httpRequest.getHeaders().set(key, value);
}
{{/headerParams}}
}
{{/hasHeaderParams}}
return httpRequest.execute();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ public HttpResponse call123testSpecialTagsForHttpResponse(@javax.annotation.Nonn
GenericUrl genericUrl = new GenericUrl(localVarUrl);

HttpContent content = apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
com.google.api.client.http.HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content);
if (uuidTest != null) {
httpRequest.getHeaders().set("uuid_test", uuidTest);
}
return httpRequest.execute();
}

public HttpResponse call123testSpecialTagsForHttpResponse(@javax.annotation.Nonnull UUID uuidTest, java.io.InputStream body, String mediaType) throws IOException {
Expand All @@ -106,7 +110,11 @@ public HttpResponse call123testSpecialTagsForHttpResponse(@javax.annotation.Nonn
HttpContent content = body == null ?
apiClient.new JacksonJsonHttpContent(null) :
new InputStreamContent(mediaType == null ? Json.MEDIA_TYPE : mediaType, body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
com.google.api.client.http.HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content);
if (uuidTest != null) {
httpRequest.getHeaders().set("uuid_test", uuidTest);
}
return httpRequest.execute();
}

public HttpResponse call123testSpecialTagsForHttpResponse(@javax.annotation.Nonnull UUID uuidTest, @javax.annotation.Nonnull Client body, Map<String, Object> params) throws IOException {
Expand Down Expand Up @@ -141,7 +149,17 @@ public HttpResponse call123testSpecialTagsForHttpResponse(@javax.annotation.Nonn
GenericUrl genericUrl = new GenericUrl(localVarUrl);

HttpContent content = apiClient.new JacksonJsonHttpContent(body);
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute();
com.google.api.client.http.HttpRequest httpRequest = apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content);
// Note: Header params passed via 'params' map are handled below
for (Map.Entry<String, Object> entry: params.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
// Check if this is a header parameter by name
if ("uuid_test".equals(key) && value != null) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artnan

thanks again for the contribution.

instead of looping through all header parameters, what about checking if params contains the key uuid_test for example and update httpRequest accordingly?

httpRequest.getHeaders().set(key, value);
}
}
return httpRequest.execute();
}


Expand Down
Loading
Loading