content: /*
   * CredentialIssuanceService
   * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
   *
   * The version of the OpenAPI document: 1.0.0
   * Contact: info@affinidi.com
   *
   * 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.affinidi.tdk.credential.issuance.client.apis;
  
  import com.fasterxml.jackson.core.type.TypeReference;
  
  import com.affinidi.tdk.credential.issuance.client.ApiException;
  import com.affinidi.tdk.credential.issuance.client.ApiClient;
  import com.affinidi.tdk.credential.issuance.client.BaseApi;
  import com.affinidi.tdk.credential.issuance.client.Configuration;
  import com.affinidi.tdk.credential.issuance.client.Pair;
  
  import com.affinidi.tdk.credential.issuance.client.models.BatchCredentialInput;
  import com.affinidi.tdk.credential.issuance.client.models.BatchCredentialResponse;
  import com.affinidi.tdk.credential.issuance.client.models.ClaimedCredentialListResponse;
  import com.affinidi.tdk.credential.issuance.client.models.ClaimedCredentialResponse;
  import com.affinidi.tdk.credential.issuance.client.models.CreateCredentialInput;
  import com.affinidi.tdk.credential.issuance.client.models.CredentialResponse;
  import com.affinidi.tdk.credential.issuance.client.models.GenerateCredentials400Response;
  import com.affinidi.tdk.credential.issuance.client.models.InvalidJwtTokenError;
  import com.affinidi.tdk.credential.issuance.client.models.InvalidParameterError;
  import com.affinidi.tdk.credential.issuance.client.models.NotFoundError;
  
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.StringJoiner;
  
  @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.13.0")
  public class CredentialsApi extends BaseApi {
  
    public CredentialsApi() {
      super(Configuration.getDefaultApiClient());
    }
  
    public CredentialsApi(ApiClient apiClient) {
      super(apiClient);
    }
  
    /**
     * Allows wallets to claim multiple credentials at once.
     * Allows wallets to claim multiple credentials at once. For authentication, it uses a token from the authorization server
     * @param projectId Affinidi project id (required)
     * @param batchCredentialInput Request body for batch credential (required)
     * @return BatchCredentialResponse
     * @throws ApiException if fails to make API call
     */
    public BatchCredentialResponse batchCredential(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull BatchCredentialInput batchCredentialInput) throws ApiException {
      return this.batchCredential(projectId, batchCredentialInput, Collections.emptyMap());
    }
  
  
    /**
     * Allows wallets to claim multiple credentials at once.
     * Allows wallets to claim multiple credentials at once. For authentication, it uses a token from the authorization server
     * @param projectId Affinidi project id (required)
     * @param batchCredentialInput Request body for batch credential (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return BatchCredentialResponse
     * @throws ApiException if fails to make API call
     */
    public BatchCredentialResponse batchCredential(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull BatchCredentialInput batchCredentialInput, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = batchCredentialInput;
      
      // verify the required parameter 'projectId' is set
      if (projectId == null) {
        throw new ApiException(400, "Missing the required parameter 'projectId' when calling batchCredential");
      }
      
      // verify the required parameter 'batchCredentialInput' is set
      if (batchCredentialInput == null) {
        throw new ApiException(400, "Missing the required parameter 'batchCredentialInput' when calling batchCredential");
      }
      
      // create path and map variables
      String localVarPath = "/v1/{projectId}/batch_credential"
        .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(apiClient.parameterToString(projectId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "bearerAuth" };
  
      TypeReference<BatchCredentialResponse> localVarReturnType = new TypeReference<BatchCredentialResponse>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * 
     * Issue credential for end user upon presentation a valid access token. Since we don&#39;t immediate issue credential It&#39;s expected to return &#x60;transaction_id&#x60; and use this &#x60;transaction_id&#x60; to get the deferred credentials
     * @param projectId Affinidi project id (required)
     * @param createCredentialInput Request body to issue credentials (required)
     * @return CredentialResponse
     * @throws ApiException if fails to make API call
     */
    public CredentialResponse generateCredentials(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull CreateCredentialInput createCredentialInput) throws ApiException {
      return this.generateCredentials(projectId, createCredentialInput, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Issue credential for end user upon presentation a valid access token. Since we don&#39;t immediate issue credential It&#39;s expected to return &#x60;transaction_id&#x60; and use this &#x60;transaction_id&#x60; to get the deferred credentials
     * @param projectId Affinidi project id (required)
     * @param createCredentialInput Request body to issue credentials (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return CredentialResponse
     * @throws ApiException if fails to make API call
     */
    public CredentialResponse generateCredentials(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull CreateCredentialInput createCredentialInput, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = createCredentialInput;
      
      // verify the required parameter 'projectId' is set
      if (projectId == null) {
        throw new ApiException(400, "Missing the required parameter 'projectId' when calling generateCredentials");
      }
      
      // verify the required parameter 'createCredentialInput' is set
      if (createCredentialInput == null) {
        throw new ApiException(400, "Missing the required parameter 'createCredentialInput' when calling generateCredentials");
      }
      
      // create path and map variables
      String localVarPath = "/v1/{projectId}/credential"
        .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(apiClient.parameterToString(projectId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        "application/json"
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "bearerAuth" };
  
      TypeReference<CredentialResponse> localVarReturnType = new TypeReference<CredentialResponse>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "POST",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * Get claimed credential in the specified range
     * Get claimed credential in the specified range
     * @param projectId project id (required)
     * @param configurationId configuration id (required)
     * @param rangeStartTime  (required)
     * @param rangeEndTime  (optional)
     * @param exclusiveStartKey exclusiveStartKey for retrieving the next batch of data. (optional)
     * @param limit  (optional, default to 20)
     * @return ClaimedCredentialListResponse
     * @throws ApiException if fails to make API call
     */
    public ClaimedCredentialListResponse getClaimedCredentials(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String configurationId, @javax.annotation.Nonnull String rangeStartTime, @javax.annotation.Nullable String rangeEndTime, @javax.annotation.Nullable String exclusiveStartKey, @javax.annotation.Nullable Integer limit) throws ApiException {
      return this.getClaimedCredentials(projectId, configurationId, rangeStartTime, rangeEndTime, exclusiveStartKey, limit, Collections.emptyMap());
    }
  
  
    /**
     * Get claimed credential in the specified range
     * Get claimed credential in the specified range
     * @param projectId project id (required)
     * @param configurationId configuration id (required)
     * @param rangeStartTime  (required)
     * @param rangeEndTime  (optional)
     * @param exclusiveStartKey exclusiveStartKey for retrieving the next batch of data. (optional)
     * @param limit  (optional, default to 20)
     * @param additionalHeaders additionalHeaders for this call
     * @return ClaimedCredentialListResponse
     * @throws ApiException if fails to make API call
     */
    public ClaimedCredentialListResponse getClaimedCredentials(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String configurationId, @javax.annotation.Nonnull String rangeStartTime, @javax.annotation.Nullable String rangeEndTime, @javax.annotation.Nullable String exclusiveStartKey, @javax.annotation.Nullable Integer limit, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // verify the required parameter 'projectId' is set
      if (projectId == null) {
        throw new ApiException(400, "Missing the required parameter 'projectId' when calling getClaimedCredentials");
      }
      
      // verify the required parameter 'configurationId' is set
      if (configurationId == null) {
        throw new ApiException(400, "Missing the required parameter 'configurationId' when calling getClaimedCredentials");
      }
      
      // verify the required parameter 'rangeStartTime' is set
      if (rangeStartTime == null) {
        throw new ApiException(400, "Missing the required parameter 'rangeStartTime' when calling getClaimedCredentials");
      }
      
      // create path and map variables
      String localVarPath = "/v1/{projectId}/configurations/{configurationId}/credentials"
        .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(apiClient.parameterToString(projectId)))
        .replaceAll("\\{" + "configurationId" + "\\}", apiClient.escapeString(apiClient.parameterToString(configurationId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      localVarQueryParams.addAll(apiClient.parameterToPair("rangeStartTime", rangeStartTime));
      localVarQueryParams.addAll(apiClient.parameterToPair("rangeEndTime", rangeEndTime));
      localVarQueryParams.addAll(apiClient.parameterToPair("exclusiveStartKey", exclusiveStartKey));
      localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ProjectTokenAuth" };
  
      TypeReference<ClaimedCredentialListResponse> localVarReturnType = new TypeReference<ClaimedCredentialListResponse>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "GET",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    /**
     * Get claimed VC linked to the issuanceId
     * Get claimed VC linked to the issuanceId
     * @param projectId project id (required)
     * @param configurationId configuration id (required)
     * @param issuanceId issuance id (required)
     * @return ClaimedCredentialResponse
     * @throws ApiException if fails to make API call
     */
    public ClaimedCredentialResponse getIssuanceIdClaimedCredential(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String configurationId, @javax.annotation.Nonnull String issuanceId) throws ApiException {
      return this.getIssuanceIdClaimedCredential(projectId, configurationId, issuanceId, Collections.emptyMap());
    }
  
  
    /**
     * Get claimed VC linked to the issuanceId
     * Get claimed VC linked to the issuanceId
     * @param projectId project id (required)
     * @param configurationId configuration id (required)
     * @param issuanceId issuance id (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return ClaimedCredentialResponse
     * @throws ApiException if fails to make API call
     */
    public ClaimedCredentialResponse getIssuanceIdClaimedCredential(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String configurationId, @javax.annotation.Nonnull String issuanceId, Map<String, String> additionalHeaders) throws ApiException {
      Object localVarPostBody = null;
      
      // verify the required parameter 'projectId' is set
      if (projectId == null) {
        throw new ApiException(400, "Missing the required parameter 'projectId' when calling getIssuanceIdClaimedCredential");
      }
      
      // verify the required parameter 'configurationId' is set
      if (configurationId == null) {
        throw new ApiException(400, "Missing the required parameter 'configurationId' when calling getIssuanceIdClaimedCredential");
      }
      
      // verify the required parameter 'issuanceId' is set
      if (issuanceId == null) {
        throw new ApiException(400, "Missing the required parameter 'issuanceId' when calling getIssuanceIdClaimedCredential");
      }
      
      // create path and map variables
      String localVarPath = "/v1/{projectId}/configurations/{configurationId}/issuances/{issuanceId}/credentials"
        .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(apiClient.parameterToString(projectId)))
        .replaceAll("\\{" + "configurationId" + "\\}", apiClient.escapeString(apiClient.parameterToString(configurationId)))
        .replaceAll("\\{" + "issuanceId" + "\\}", apiClient.escapeString(apiClient.parameterToString(issuanceId)));
  
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      String localVarQueryParameterBaseName;
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      
      localVarHeaderParams.putAll(additionalHeaders);
  
      
      
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ProjectTokenAuth" };
  
      TypeReference<ClaimedCredentialResponse> localVarReturnType = new TypeReference<ClaimedCredentialResponse>() {};
      return apiClient.invokeAPI(
          localVarPath,
          "GET",
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          localVarPostBody,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          localVarReturnType
      );
    }
  
    @Override
    public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
      String localVarPath = url.replace(apiClient.getBaseURL(), "");
      StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
      List<Pair> localVarQueryParams = new ArrayList<Pair>();
      List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
      Map<String, String> localVarHeaderParams = new HashMap<String, String>();
      Map<String, String> localVarCookieParams = new HashMap<String, String>();
      Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  
      localVarHeaderParams.putAll(additionalHeaders);
  
      final String[] localVarAccepts = {
        "application/json"
      };
      final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
      final String[] localVarContentTypes = {
        
      };
      final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
      String[] localVarAuthNames = new String[] { "ProjectTokenAuth" };
  
      return apiClient.invokeAPI(
        localVarPath,
          method,
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          request,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          returnType
      );
    }
  }
  