content: /*
   * Adyen BinLookup API
   *
   * The version of the OpenAPI document: 54
   *
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  
  package com.adyen.service.binlookup;
  
  import com.adyen.Client;
  import com.adyen.Service;
  import com.adyen.constants.ApiConstants;
  import com.adyen.model.RequestOptions;
  import com.adyen.model.binlookup.CostEstimateRequest;
  import com.adyen.model.binlookup.CostEstimateResponse;
  import com.adyen.model.binlookup.ThreeDSAvailabilityRequest;
  import com.adyen.model.binlookup.ThreeDSAvailabilityResponse;
  import com.adyen.service.exception.ApiException;
  import com.adyen.service.resource.Resource;
  import java.io.IOException;
  
  public class BinLookupApi extends Service {
  
    public static final String API_VERSION = "54";
  
    protected String baseURL;
  
    /**
     * BinLookup constructor in {@link com.adyen.service.binlookup package}.
     *
     * @param client {@link Client } (required)
     */
    public BinLookupApi(Client client) {
      super(client);
      this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/BinLookup/v54");
    }
  
    /**
     * BinLookup constructor in {@link com.adyen.service.binlookup package}. Please use this
     * constructor only if you would like to pass along your own url for routing or testing purposes.
     * The latest API version is defined in this class as a constant.
     *
     * @param client {@link Client } (required)
     * @param baseURL {@link String } (required)
     */
    public BinLookupApi(Client client, String baseURL) {
      super(client);
      this.baseURL = baseURL;
    }
  
    /**
     * Check if 3D Secure is available
     *
     * @param threeDSAvailabilityRequest {@link ThreeDSAvailabilityRequest } (required)
     * @return {@link ThreeDSAvailabilityResponse }
     * @throws ApiException if fails to make API call
     */
    public ThreeDSAvailabilityResponse get3dsAvailability(
        ThreeDSAvailabilityRequest threeDSAvailabilityRequest) throws ApiException, IOException {
      return get3dsAvailability(threeDSAvailabilityRequest, null);
    }
  
    /**
     * Check if 3D Secure is available
     *
     * @param threeDSAvailabilityRequest {@link ThreeDSAvailabilityRequest } (required)
     * @param requestOptions {@link RequestOptions } Object to store additional data such as
     *     idempotency-keys (optional)
     * @return {@link ThreeDSAvailabilityResponse }
     * @throws ApiException if fails to make API call
     */
    public ThreeDSAvailabilityResponse get3dsAvailability(
        ThreeDSAvailabilityRequest threeDSAvailabilityRequest, RequestOptions requestOptions)
        throws ApiException, IOException {
      String requestBody = threeDSAvailabilityRequest.toJson();
      Resource resource = new Resource(this, this.baseURL + "/get3dsAvailability", null);
      String jsonResult =
          resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
      return ThreeDSAvailabilityResponse.fromJson(jsonResult);
    }
  
    /**
     * Get a fees cost estimate
     *
     * @param costEstimateRequest {@link CostEstimateRequest } (required)
     * @return {@link CostEstimateResponse }
     * @throws ApiException if fails to make API call
     */
    public CostEstimateResponse getCostEstimate(CostEstimateRequest costEstimateRequest)
        throws ApiException, IOException {
      return getCostEstimate(costEstimateRequest, null);
    }
  
    /**
     * Get a fees cost estimate
     *
     * @param costEstimateRequest {@link CostEstimateRequest } (required)
     * @param requestOptions {@link RequestOptions } Object to store additional data such as
     *     idempotency-keys (optional)
     * @return {@link CostEstimateResponse }
     * @throws ApiException if fails to make API call
     */
    public CostEstimateResponse getCostEstimate(
        CostEstimateRequest costEstimateRequest, RequestOptions requestOptions)
        throws ApiException, IOException {
      String requestBody = costEstimateRequest.toJson();
      Resource resource = new Resource(this, this.baseURL + "/getCostEstimate", null);
      String jsonResult =
          resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
      return CostEstimateResponse.fromJson(jsonResult);
    }
  }
  