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.CredentialOfferResponse;
  import com.affinidi.tdk.credential.issuance.client.models.GetCredentialOffer400Response;
  
  
  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 OfferApi extends BaseApi {
  
    public OfferApi() {
      super(Configuration.getDefaultApiClient());
    }
  
    public OfferApi(ApiClient apiClient) {
      super(apiClient);
    }
  
    /**
     * 
     * Endpoint used to return Credential Offer details, used with &#x60;credential_offer_uri&#x60; response
     * @param projectId Affinidi project id (required)
     * @param issuanceId issuanceId from credential_offer_uri (required)
     * @return CredentialOfferResponse
     * @throws ApiException if fails to make API call
     */
    public CredentialOfferResponse getCredentialOffer(@javax.annotation.Nonnull String projectId, @javax.annotation.Nonnull String issuanceId) throws ApiException {
      return this.getCredentialOffer(projectId, issuanceId, Collections.emptyMap());
    }
  
  
    /**
     * 
     * Endpoint used to return Credential Offer details, used with &#x60;credential_offer_uri&#x60; response
     * @param projectId Affinidi project id (required)
     * @param issuanceId issuanceId from credential_offer_uri (required)
     * @param additionalHeaders additionalHeaders for this call
     * @return CredentialOfferResponse
     * @throws ApiException if fails to make API call
     */
    public CredentialOfferResponse getCredentialOffer(@javax.annotation.Nonnull String projectId, @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 getCredentialOffer");
      }
      
      // verify the required parameter 'issuanceId' is set
      if (issuanceId == null) {
        throw new ApiException(400, "Missing the required parameter 'issuanceId' when calling getCredentialOffer");
      }
      
      // create path and map variables
      String localVarPath = "/v1/{projectId}/offers/{issuanceId}"
        .replaceAll("\\{" + "projectId" + "\\}", apiClient.escapeString(apiClient.parameterToString(projectId)))
        .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[] {  };
  
      TypeReference<CredentialOfferResponse> localVarReturnType = new TypeReference<CredentialOfferResponse>() {};
      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[] {  };
  
      return apiClient.invokeAPI(
        localVarPath,
          method,
          localVarQueryParams,
          localVarCollectionQueryParams,
          localVarQueryStringJoiner.toString(),
          request,
          localVarHeaderParams,
          localVarCookieParams,
          localVarFormParams,
          localVarAccept,
          localVarContentType,
          localVarAuthNames,
          returnType
      );
    }
  }
  