Skip to content
Open
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,19 @@ 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);
// 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}}
}
return httpRequest.execute();
}


Expand Down