java-helidon.client.libraries.se.ApiResponse.mustache Maven / Gradle / Ivy
{{>licenseInfo}}
package {{invokerPackage}};
{{#x-helidon-v3}}import java.util.concurrent.ExecutionException;
{{/x-helidon-v3}}
import io.helidon.common.GenericType;
{{#x-helidon-v3}}import io.helidon.common.reactive.Single;
import io.helidon.webclient.WebClientResponse;
{{/x-helidon-v3}}{{!
}}{{^x-helidon-v3}}import io.helidon.webclient.api.HttpClientResponse;
{{/x-helidon-v3}}
{{#appName}}
/**
* Generic-typed response.
*
* Return type for generated API methods.
*
* @param type of the return value from the generated API method
*/
{{/appName}}
public interface ApiResponse {
static ApiResponse create(GenericType responseType, {{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientResponse{{/x-helidon-v3}} webClientResponse) {
return new ApiResponseBase<>(responseType, webClientResponse);
}
/**
* @returns reactive access to the {@link {{#x-helidon-v3}}Web{{/x-helidon-v3}}{{^x-helidon-v3}}Http{{/x-helidon-v3}}ClientResponse} describing the response from the server
*/
{{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientResponse{{/x-helidon-v3}} webClientResponse();
/**
* @return {{#x-helidon-v3}}reactive {{/x-helidon-v3}}access to the value returned in the response from the server
*/
{{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}T{{/x-helidon-v3}} result(){{#x-helidon-v3}} throws ExecutionException, InterruptedException{{/x-helidon-v3}};
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy