All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.formapi.PdfApi Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
package io.formapi;

import io.formapi.CollectionFormats.*;

import retrofit2.Call;
import retrofit2.http.*;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;

import io.formapi.AuthenticationError;
import io.formapi.AuthenticationSuccessResponse;
import io.formapi.CombinedSubmission;
import io.formapi.CombinedSubmissionData;
import io.formapi.CreateCombinedSubmissionResponse;
import io.formapi.CreateSubmissionBatchResponse;
import io.formapi.CreateSubmissionData;
import io.formapi.CreateSubmissionDataBatchV1;
import io.formapi.CreateSubmissionDataRequestTokenResponse;
import io.formapi.CreateSubmissionResponse;
import io.formapi.Error;
import io.formapi.InvalidRequest;
import io.formapi.Submission;
import io.formapi.SubmissionBatch;
import io.formapi.SubmissionBatchData;
import io.formapi.SubmissionDataRequest;
import io.formapi.Template;
import io.formapi.UpdateDataRequestResponse;
import io.formapi.UpdateSubmissionDataRequestData;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface PdfApi {
  /**
   * Generates multiple PDFs
   * 
   * @param templateId  (required)
   * @param createSubmissionDataBatchV1  (required)
   * @return Call<List<CreateSubmissionResponse>>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @POST("templates/{template_id}/submissions/batch")
  Call> batchGeneratePdfV1(
    @retrofit2.http.Path("template_id") String templateId, @retrofit2.http.Body List createSubmissionDataBatchV1
  );

  /**
   * Generates multiple PDFs
   * 
   * @param submissionBatchData  (required)
   * @return Call<CreateSubmissionBatchResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @POST("submissions/batches")
  Call batchGeneratePdfs(
    @retrofit2.http.Body SubmissionBatchData submissionBatchData
  );

  /**
   * Merge generated PDFs together
   * 
   * @param combinedSubmissionData  (required)
   * @return Call<CreateCombinedSubmissionResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @POST("combined_submissions")
  Call combineSubmissions(
    @retrofit2.http.Body CombinedSubmissionData combinedSubmissionData
  );

  /**
   * Creates a new data request token for form authentication
   * 
   * @param dataRequestId  (required)
   * @return Call<CreateSubmissionDataRequestTokenResponse>
   */
  @POST("data_requests/{data_request_id}/tokens")
  Call createDataRequestToken(
    @retrofit2.http.Path("data_request_id") String dataRequestId
  );

  /**
   * Expire a combined submission
   * 
   * @param combinedSubmissionId  (required)
   * @return Call<CombinedSubmission>
   */
  @DELETE("combined_submissions/{combined_submission_id}")
  Call expireCombinedSubmission(
    @retrofit2.http.Path("combined_submission_id") String combinedSubmissionId
  );

  /**
   * Expire a PDF submission
   * 
   * @param submissionId  (required)
   * @return Call<Submission>
   */
  @DELETE("submissions/{submission_id}")
  Call expireSubmission(
    @retrofit2.http.Path("submission_id") String submissionId
  );

  /**
   * Generates a new PDF
   * 
   * @param templateId  (required)
   * @param createSubmissionData  (required)
   * @return Call<CreateSubmissionResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @POST("templates/{template_id}/submissions")
  Call generatePDF(
    @retrofit2.http.Path("template_id") String templateId, @retrofit2.http.Body CreateSubmissionData createSubmissionData
  );

  /**
   * Check the status of a combined submission (merged PDFs)
   * 
   * @param combinedSubmissionId  (required)
   * @return Call<CombinedSubmission>
   */
  @GET("combined_submissions/{combined_submission_id}")
  Call getCombinedSubmission(
    @retrofit2.http.Path("combined_submission_id") String combinedSubmissionId
  );

  /**
   * Look up a submission data request
   * 
   * @param dataRequestId  (required)
   * @return Call<SubmissionDataRequest>
   */
  @GET("data_requests/{data_request_id}")
  Call getDataRequest(
    @retrofit2.http.Path("data_request_id") String dataRequestId
  );

  /**
   * Check the status of a PDF
   * 
   * @param submissionId  (required)
   * @return Call<Submission>
   */
  @GET("submissions/{submission_id}")
  Call getSubmission(
    @retrofit2.http.Path("submission_id") String submissionId
  );

  /**
   * Check the status of a submission batch job
   * 
   * @param submissionBatchId  (required)
   * @param includeSubmissions  (optional)
   * @return Call<SubmissionBatch>
   */
  @GET("submissions/batches/{submission_batch_id}")
  Call getSubmissionBatch(
    @retrofit2.http.Path("submission_batch_id") String submissionBatchId, @retrofit2.http.Query("include_submissions") Boolean includeSubmissions
  );

  /**
   * Get a list of all templates
   * 
   * @param page Default: 1 (optional)
   * @param perPage Default: 50 (optional)
   * @return Call<List<Template>>
   */
  @GET("templates")
  Call> getTemplates(
    @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("per_page") Integer perPage
  );

  /**
   * Test Authentication
   * 
   * @return Call<AuthenticationSuccessResponse>
   */
  @GET("authentication")
  Call testAuthentication();
    

  /**
   * Update a submission data request
   * 
   * @param dataRequestId  (required)
   * @param updateSubmissionDataRequestData  (required)
   * @return Call<UpdateDataRequestResponse>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @PUT("data_requests/{data_request_id}")
  Call updateDataRequest(
    @retrofit2.http.Path("data_request_id") String dataRequestId, @retrofit2.http.Body UpdateSubmissionDataRequestData updateSubmissionDataRequestData
  );

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy