content: /*
   * Open Banking API
   *
   * The version of the OpenAPI document: 1
   *
   *
   * 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.openbanking;
  
  import com.adyen.Client;
  import com.adyen.Service;
  import com.adyen.constants.ApiConstants;
  import com.adyen.model.RequestOptions;
  import com.adyen.model.openbanking.AccountVerificationReportResponse;
  import com.adyen.model.openbanking.AccountVerificationRoutesRequest;
  import com.adyen.model.openbanking.AccountVerificationRoutesResponse;
  import com.adyen.service.exception.ApiException;
  import com.adyen.service.resource.Resource;
  import java.io.IOException;
  import java.util.HashMap;
  import java.util.Map;
  
  public class AccountVerificationApi extends Service {
  
    public static final String API_VERSION = "1";
  
    protected String baseURL;
  
    /**
     * Account Verification constructor in {@link com.adyen.service.openbanking package}.
     *
     * @param client {@link Client } (required)
     */
    public AccountVerificationApi(Client client) {
      super(client);
      this.baseURL = createBaseURL("https://obgateway-test.adyen.com/obgateway/v1");
    }
  
    /**
     * Account Verification constructor in {@link com.adyen.service.openbanking 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 AccountVerificationApi(Client client, String baseURL) {
      super(client);
      this.baseURL = baseURL;
    }
  
    /**
     * Create routes for account verification
     *
     * @param accountVerificationRoutesRequest {@link AccountVerificationRoutesRequest } (required)
     * @param accountVerificationRoutesRequest {@link AccountVerificationRoutesRequest } (required)
     * @return {@link AccountVerificationRoutesResponse }
     * @throws ApiException if fails to make API call
     */
    public AccountVerificationRoutesResponse createAccountVerificationRoutes(
        AccountVerificationRoutesRequest accountVerificationRoutesRequest)
        throws ApiException, IOException {
      return createAccountVerificationRoutes(accountVerificationRoutesRequest, null);
    }
  
    /**
     * Create routes for account verification
     *
     * @param accountVerificationRoutesRequest {@link AccountVerificationRoutesRequest } (required)
     * @param requestOptions {@link RequestOptions } Object to store additional data such as
     *     idempotency-keys (optional)
     * @return {@link AccountVerificationRoutesResponse }
     * @throws ApiException if fails to make API call
     */
    public AccountVerificationRoutesResponse createAccountVerificationRoutes(
        AccountVerificationRoutesRequest accountVerificationRoutesRequest,
        RequestOptions requestOptions)
        throws ApiException, IOException {
      String requestBody = accountVerificationRoutesRequest.toJson();
      Resource resource = new Resource(this, this.baseURL + "/accountVerification/routes", null);
      String jsonResult =
          resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
      return AccountVerificationRoutesResponse.fromJson(jsonResult);
    }
  
    /**
     * Get account verification report
     *
     * @param code {@link String } The unique code you receive after a successful open banking flow
     *     that is included as a query parameter in the &#x60;redirectUrl&#x60; callback. (required)
     * @return {@link AccountVerificationReportResponse }
     * @throws ApiException if fails to make API call
     */
    public AccountVerificationReportResponse getAccountVerificationReport(String code)
        throws ApiException, IOException {
      return getAccountVerificationReport(code, null);
    }
  
    /**
     * Get account verification report
     *
     * @param code {@link String } The unique code you receive after a successful open banking flow
     *     that is included as a query parameter in the &#x60;redirectUrl&#x60; callback. (required)
     * @param requestOptions {@link RequestOptions } Object to store additional data such as
     *     idempotency-keys (optional)
     * @return {@link AccountVerificationReportResponse }
     * @throws ApiException if fails to make API call
     */
    public AccountVerificationReportResponse getAccountVerificationReport(
        String code, RequestOptions requestOptions) throws ApiException, IOException {
      // Add path params
      Map<String, String> pathParams = new HashMap<>();
      if (code == null) {
        throw new IllegalArgumentException("Please provide the code path parameter");
      }
      pathParams.put("code", code);
  
      String requestBody = null;
      Resource resource =
          new Resource(this, this.baseURL + "/accountVerification/reports/{code}", null);
      String jsonResult =
          resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
      return AccountVerificationReportResponse.fromJson(jsonResult);
    }
  }
  