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

io.formapi.PdfApi Maven / Gradle / Ivy

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 java.io.File;
import io.formapi.InvalidRequest;
import io.formapi.PendingTemplate;
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
  );

  /**
   * Upload a new PDF template
   * 
   * @param templateDocument  (required)
   * @param templateName  (required)
   * @return Call<PendingTemplate>
   */
  @retrofit2.http.Multipart
  @POST("templates")
  Call createTemplate(
    @retrofit2.http.Part("template[document]") MultipartBody.Part templateDocument, @retrofit2.http.Part("template[name]") String templateName
  );

  /**
   * 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
  );

  /**
   * Check the status of an uploaded template
   * 
   * @param templateId  (required)
   * @return Call<Template>
   */
  @GET("templates/{template_id}")
  Call