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

com.docusign.esign.api.OrganizationsApi Maven / Gradle / Ivy

Go to download

The official DocuSign eSignature JAVA client is based on version 2 of the DocuSign REST API and provides libraries for JAVA application integration. It is recommended that you use this version of the library for new development.

There is a newer version: 6.0.0
Show newest version
package com.docusign.esign.api;

import com.docusign.esign.client.ApiClient;
import com.docusign.esign.client.ApiException;
import com.docusign.esign.client.ApiResponse;
import com.docusign.esign.client.Configuration;
import com.docusign.esign.client.Pair;
import com.docusign.esign.model.*;

/** OrganizationsApi class. */
public class OrganizationsApi {
  private ApiClient apiClient;

  /** OrganizationsApi. */
  public OrganizationsApi() {
    this(Configuration.getDefaultApiClient());
  }

  /** OrganizationsApi. */
  public OrganizationsApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * getApiClient Method.
   *
   * @return ApiClient
   */
  public ApiClient getApiClient() {
    return apiClient;
  }

  /** setApiClient Method. */
  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Retrieves org level report by correlation id and site..
   *
   * @param organizationId (required)
   * @param reportCorrelationId (required)
   * @throws ApiException if fails to make API call
   */
  public void getReportV2(String organizationId, String reportCorrelationId) throws ApiException {
    getReportV2WithHttpInfo(organizationId, reportCorrelationId);
  }

  /**
   * Retrieves org level report by correlation id and site.
   *
   * @param organizationId (required)
   * @param reportCorrelationId (required)
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getReportV2WithHttpInfo(
      String organizationId, String reportCorrelationId) throws ApiException {
    Object localVarPostBody = "{}";

    // verify the required parameter 'organizationId' is set
    if (organizationId == null) {
      throw new ApiException(
          400, "Missing the required parameter 'organizationId' when calling getReportV2");
    }

    // verify the required parameter 'reportCorrelationId' is set
    if (reportCorrelationId == null) {
      throw new ApiException(
          400, "Missing the required parameter 'reportCorrelationId' when calling getReportV2");
    }

    // create path and map variables
    String localVarPath =
        "/v2.1/organization_reporting/{organizationId}/reportsv2/{reportCorrelationId}"
            .replaceAll(
                "\\{" + "organizationId" + "\\}", apiClient.escapeString(organizationId.toString()))
            .replaceAll(
                "\\{" + "reportCorrelationId" + "\\}",
                apiClient.escapeString(reportCorrelationId.toString()));

    // query params
    java.util.List localVarQueryParams = new java.util.ArrayList();
    java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
    java.util.Map localVarHeaderParams = new java.util.HashMap();
    java.util.Map localVarFormParams = new java.util.HashMap();

    final String[] localVarAccepts = {"application/json"};
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {};

    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {"docusignAccessCode"};

    apiClient.invokeAPI(
        localVarPath,
        "GET",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarPostBody,
        localVarHeaderParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        null);
    return new ApiResponse(apiClient.getStatusCode(), apiClient.getResponseHeaders(), null);
  }
}