/**
 * OpenAPI Petstore
 * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package org.openapitools.client;

import java.util.concurrent.ExecutionException;

import io.helidon.common.GenericType;
import io.helidon.common.reactive.Single;
import io.helidon.webclient.WebClientResponse;

/**
 * Generic-typed response.
 *
 * Return type for generated API methods.
 *
 * @param <T> type of the return value from the generated API method
 */
public interface ApiResponse<T> {

  static <T> ApiResponse<T> create(GenericType<T> responseType, Single<WebClientResponse> webClientResponse) {
    return new ApiResponseBase<>(responseType, webClientResponse);
  }

  /**
   * @returns reactive access to the {@link WebClientResponse} describing the response from the server
   */
  Single<WebClientResponse> webClientResponse();

  /**
   * @return reactive access to the value returned in the response from the server
   */
  Single<T> result() throws ExecutionException, InterruptedException;
}
