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

com.docusign.esign.api.NotaryApi 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.*;
import jakarta.ws.rs.core.GenericType;

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

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

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

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

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

  /**
   * Add a notary to the system. Registers the current user as a notary.
   *
   * @param notary (optional)
   * @return Notary
   * @throws ApiException if fails to make API call
   */
  public Notary createNotary(Notary notary) throws ApiException {
    ApiResponse localVarResponse = createNotaryWithHttpInfo(notary);
    return localVarResponse.getData();
  }

  /**
   * Add a notary to the system Registers the current user as a notary.
   *
   * @param notary (optional)
   * @return Notary
   * @throws ApiException if fails to make API call
   */
  public ApiResponse createNotaryWithHttpInfo(Notary notary) throws ApiException {
    Object localVarPostBody = notary;

    // create path and map variables
    String localVarPath = "/v2.1/current_user/notary";

    // 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"};

    GenericType localVarReturnType = new GenericType() {};
    Notary localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "POST",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }

  /**
   * Add a notary jurisdiction to the system. Creates a jurisdiction object.
   *
   * @param notaryJurisdiction (optional)
   * @return NotaryJurisdiction
   * @throws ApiException if fails to make API call
   */
  public NotaryJurisdiction createNotaryJurisdictions(NotaryJurisdiction notaryJurisdiction)
      throws ApiException {
    ApiResponse localVarResponse =
        createNotaryJurisdictionsWithHttpInfo(notaryJurisdiction);
    return localVarResponse.getData();
  }

  /**
   * Add a notary jurisdiction to the system Creates a jurisdiction object.
   *
   * @param notaryJurisdiction (optional)
   * @return NotaryJurisdiction
   * @throws ApiException if fails to make API call
   */
  public ApiResponse createNotaryJurisdictionsWithHttpInfo(
      NotaryJurisdiction notaryJurisdiction) throws ApiException {
    Object localVarPostBody = notaryJurisdiction;

    // create path and map variables
    String localVarPath = "/v2.1/current_user/notary/jurisdictions";

    // 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"};

    GenericType localVarReturnType = new GenericType() {};
    NotaryJurisdiction localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "POST",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }

  /**
   * Delete a notary jurisdiction a specified user.. Deletes the specified jurisdiction.
   *
   * @param jurisdictionId (required)
   * @throws ApiException if fails to make API call
   */
  public void deleteNotaryJurisdiction(String jurisdictionId) throws ApiException {
    deleteNotaryJurisdictionWithHttpInfo(jurisdictionId);
  }

  /**
   * Delete a notary jurisdiction a specified user. Deletes the specified jurisdiction.
   *
   * @param jurisdictionId (required)
   * @throws ApiException if fails to make API call
   */
  public ApiResponse deleteNotaryJurisdictionWithHttpInfo(String jurisdictionId)
      throws ApiException {
    Object localVarPostBody = "{}";

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

    // create path and map variables
    String localVarPath =
        "/v2.1/current_user/notary/jurisdictions/{jurisdictionId}"
            .replaceAll(
                "\\{" + "jurisdictionId" + "\\}",
                apiClient.escapeString(jurisdictionId.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,
        "DELETE",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarPostBody,
        localVarHeaderParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        null);
    return new ApiResponse(apiClient.getStatusCode(), apiClient.getResponseHeaders(), null);
  }
  /// 
  /// Get notary settings for a user Gets settings for a notary user. The current user must be a
  // notary.
  /// 

  /** GetNotaryOptions Class. */
  public class GetNotaryOptions {
    private String includeJurisdictions = null;

    /** setIncludeJurisdictions method. */
    public void setIncludeJurisdictions(String includeJurisdictions) {
      this.includeJurisdictions = includeJurisdictions;
    }

    /**
     * getIncludeJurisdictions method.
     *
     * @return String
     */
    public String getIncludeJurisdictions() {
      return this.includeJurisdictions;
    }
  }

  /**
   * Get notary settings for a user. Gets settings for a notary user. The current user must be a
   * notary.
   *
   * @return NotaryResult
   */
  public NotaryResult getNotary() throws ApiException {
    return getNotary(null);
  }

  /**
   * Get notary settings for a user. Gets settings for a notary user. The current user must be a
   * notary.
   *
   * @param options for modifying the method behavior.
   * @return NotaryResult
   * @throws ApiException if fails to make API call
   */
  public NotaryResult getNotary(NotaryApi.GetNotaryOptions options) throws ApiException {
    ApiResponse localVarResponse = getNotaryWithHttpInfo(options);
    return localVarResponse.getData();
  }

  /**
   * Get notary settings for a user Gets settings for a notary user. The current user must be a
   * notary.
   *
   * @param options for modifying the method behavior.
   * @return NotaryResult
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getNotaryWithHttpInfo(NotaryApi.GetNotaryOptions options)
      throws ApiException {
    Object localVarPostBody = "{}";

    // create path and map variables
    String localVarPath = "/v2.1/current_user/notary";

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

    if (options != null) {
      localVarQueryParams.addAll(
          apiClient.parameterToPair("include_jurisdictions", options.includeJurisdictions));
    }

    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"};

    GenericType localVarReturnType = new GenericType() {};
    NotaryResult localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "GET",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }

  /**
   * Get notary a jurisdiction for a user. Gets a jurisdiction object for the current user. The
   * following restrictions apply: - The current user must be a notary. - The
   * `jurisdictionId` must be a jurisdiction that the notary is registered for.
   *
   * @param jurisdictionId (required)
   * @return NotaryJurisdiction
   * @throws ApiException if fails to make API call
   */
  public NotaryJurisdiction getNotaryJurisdiction(String jurisdictionId) throws ApiException {
    ApiResponse localVarResponse =
        getNotaryJurisdictionWithHttpInfo(jurisdictionId);
    return localVarResponse.getData();
  }

  /**
   * Get notary a jurisdiction for a user Gets a jurisdiction object for the current user. The
   * following restrictions apply: - The current user must be a notary. - The
   * `jurisdictionId` must be a jurisdiction that the notary is registered for.
   *
   * @param jurisdictionId (required)
   * @return NotaryJurisdiction
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getNotaryJurisdictionWithHttpInfo(String jurisdictionId)
      throws ApiException {
    Object localVarPostBody = "{}";

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

    // create path and map variables
    String localVarPath =
        "/v2.1/current_user/notary/jurisdictions/{jurisdictionId}"
            .replaceAll(
                "\\{" + "jurisdictionId" + "\\}",
                apiClient.escapeString(jurisdictionId.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"};

    GenericType localVarReturnType = new GenericType() {};
    NotaryJurisdiction localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "GET",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }

  /**
   * Get notary seal for a jurisdiction.
   *
   * @param jurisdictionId (required)
   * @throws ApiException if fails to make API call
   */
  public void getNotaryJurisdictionSeal(String jurisdictionId) throws ApiException {
    getNotaryJurisdictionSealWithHttpInfo(jurisdictionId);
  }

  /**
   * Get notary seal for a jurisdiction
   *
   * @param jurisdictionId (required)
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getNotaryJurisdictionSealWithHttpInfo(String jurisdictionId)
      throws ApiException {
    Object localVarPostBody = "{}";

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

    // create path and map variables
    String localVarPath =
        "/v2.1/current_user/notary/jurisdictions/{jurisdictionId}/seal"
            .replaceAll(
                "\\{" + "jurisdictionId" + "\\}",
                apiClient.escapeString(jurisdictionId.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);
  }

  /**
   * Get notary jurisdictions for a user. Returns a list of jurisdictions that the notary is
   * registered in. The current user must be a notary.
   *
   * @return NotaryJurisdictionList
   * @throws ApiException if fails to make API call
   */
  public NotaryJurisdictionList getNotaryJurisdictions() throws ApiException {
    ApiResponse localVarResponse = getNotaryJurisdictionsWithHttpInfo();
    return localVarResponse.getData();
  }

  /**
   * Get notary jurisdictions for a user Returns a list of jurisdictions that the notary is
   * registered in. The current user must be a notary.
   *
   * @return NotaryJurisdictionList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getNotaryJurisdictionsWithHttpInfo()
      throws ApiException {
    Object localVarPostBody = "{}";

    // create path and map variables
    String localVarPath = "/v2.1/current_user/notary/jurisdictions";

    // 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"};

    GenericType localVarReturnType =
        new GenericType() {};
    NotaryJurisdictionList localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "GET",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }
  /// 
  /// Get notary jurisdictions for a user
  /// 

  /** ListNotaryJournalsOptions Class. */
  public class ListNotaryJournalsOptions {
    private String count = null;
    private String searchText = null;
    private String startPosition = null;

    /** setCount method. */
    public void setCount(String count) {
      this.count = count;
    }

    /**
     * getCount method.
     *
     * @return String
     */
    public String getCount() {
      return this.count;
    }

    /** setSearchText method. */
    public void setSearchText(String searchText) {
      this.searchText = searchText;
    }

    /**
     * getSearchText method.
     *
     * @return String
     */
    public String getSearchText() {
      return this.searchText;
    }

    /** setStartPosition method. */
    public void setStartPosition(String startPosition) {
      this.startPosition = startPosition;
    }

    /**
     * getStartPosition method.
     *
     * @return String
     */
    public String getStartPosition() {
      return this.startPosition;
    }
  }

  /**
   * Get notary jurisdictions for a user.
   *
   * @return NotaryJournalList
   */
  public NotaryJournalList listNotaryJournals() throws ApiException {
    return listNotaryJournals(null);
  }

  /**
   * Get notary jurisdictions for a user.
   *
   * @param options for modifying the method behavior.
   * @return NotaryJournalList
   * @throws ApiException if fails to make API call
   */
  public NotaryJournalList listNotaryJournals(NotaryApi.ListNotaryJournalsOptions options)
      throws ApiException {
    ApiResponse localVarResponse = listNotaryJournalsWithHttpInfo(options);
    return localVarResponse.getData();
  }

  /**
   * Get notary jurisdictions for a user
   *
   * @param options for modifying the method behavior.
   * @return NotaryJournalList
   * @throws ApiException if fails to make API call
   */
  public ApiResponse listNotaryJournalsWithHttpInfo(
      NotaryApi.ListNotaryJournalsOptions options) throws ApiException {
    Object localVarPostBody = "{}";

    // create path and map variables
    String localVarPath = "/v2.1/current_user/notary/journals";

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

    if (options != null) {
      localVarQueryParams.addAll(apiClient.parameterToPair("count", options.count));
    }
    if (options != null) {
      localVarQueryParams.addAll(apiClient.parameterToPair("search_text", options.searchText));
    }
    if (options != null) {
      localVarQueryParams.addAll(
          apiClient.parameterToPair("start_position", options.startPosition));
    }

    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"};

    GenericType localVarReturnType = new GenericType() {};
    NotaryJournalList localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "GET",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }

  /**
   * Update a notary. Updates notary information for the current user.
   *
   * @param notary (optional)
   * @return Notary
   * @throws ApiException if fails to make API call
   */
  public Notary updateNotary(Notary notary) throws ApiException {
    ApiResponse localVarResponse = updateNotaryWithHttpInfo(notary);
    return localVarResponse.getData();
  }

  /**
   * Update a notary Updates notary information for the current user.
   *
   * @param notary (optional)
   * @return Notary
   * @throws ApiException if fails to make API call
   */
  public ApiResponse updateNotaryWithHttpInfo(Notary notary) throws ApiException {
    Object localVarPostBody = notary;

    // create path and map variables
    String localVarPath = "/v2.1/current_user/notary";

    // 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"};

    GenericType localVarReturnType = new GenericType() {};
    Notary localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "PUT",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }

  /**
   * Update a notary jurisdiction. Updates the jurisdiction information about a notary. The
   * following restrictions apply: - The current user must be a notary. - The
   * `jurisdictionId` path parameter must be a jurisdiction that the notary is registered
   * for. - The `jurisdictionId` path parameter must match the request body's
   * `jurisdiction.jurisdictionId`. The request body must have a full
   * `jurisdiction` object for the jurisdiction property. The best way to do this is to
   * use `getNotaryJurisdiction` to obtain the current values and update the properties
   * you want to change. For example, assume `getNotaryJurisdiction` returns this:
   * ``` { \"jurisdiction\": { \"jurisdictionId\":
   * \"15\", \"name\": \"Iowa\", \"county\": \"\",
   * \"enabled\": \"true\", \"countyInSeal\": \"false\",
   * \"commissionIdInSeal\": \"true\", \"stateNameInSeal\":
   * \"true\", \"notaryPublicInSeal\": \"true\",
   * \"allowSystemCreatedSeal\": \"true\", \"allowUserUploadedSeal\":
   * \"false\" }, \"commissionId\": \"123456\",
   * \"commissionExpiration\": \"2020-08-31T07:00:00.0000000Z\",
   * \"registeredName\": \"Bob Notary\", \"county\":
   * \"Adams\", \"sealType\": \"system_created\" } ```
   * If you want to change the name of the notary from \"Bob Notary\" to \"Robert
   * Notary\", your request body would be: ``` { \"jurisdiction\": {
   * \"jurisdictionId\": \"15\", \"name\": \"Iowa\",
   * \"county\": \"\", \"enabled\": \"true\",
   * \"countyInSeal\": \"false\", \"commissionIdInSeal\":
   * \"true\", \"stateNameInSeal\": \"true\",
   * \"notaryPublicInSeal\": \"true\", \"allowSystemCreatedSeal\":
   * \"true\", \"allowUserUploadedSeal\": \"false\" },
   * \"commissionId\": \"123456\", \"commissionExpiration\":
   * \"2020-08-31T07:00:00.0000000Z\", \"registeredName\": \"Robert
   * Notary\", \"county\": \"Adams\", \"sealType\":
   * \"system_created\" } ```
   *
   * @param jurisdictionId (required)
   * @param notaryJurisdiction (optional)
   * @return NotaryJurisdiction
   * @throws ApiException if fails to make API call
   */
  public NotaryJurisdiction updateNotaryJurisdiction(
      String jurisdictionId, NotaryJurisdiction notaryJurisdiction) throws ApiException {
    ApiResponse localVarResponse =
        updateNotaryJurisdictionWithHttpInfo(jurisdictionId, notaryJurisdiction);
    return localVarResponse.getData();
  }

  /**
   * Update a notary jurisdiction Updates the jurisdiction information about a notary. The following
   * restrictions apply: - The current user must be a notary. - The `jurisdictionId` path
   * parameter must be a jurisdiction that the notary is registered for. - The
   * `jurisdictionId` path parameter must match the request body's
   * `jurisdiction.jurisdictionId`. The request body must have a full
   * `jurisdiction` object for the jurisdiction property. The best way to do this is to
   * use `getNotaryJurisdiction` to obtain the current values and update the properties
   * you want to change. For example, assume `getNotaryJurisdiction` returns this:
   * ``` { \"jurisdiction\": { \"jurisdictionId\":
   * \"15\", \"name\": \"Iowa\", \"county\": \"\",
   * \"enabled\": \"true\", \"countyInSeal\": \"false\",
   * \"commissionIdInSeal\": \"true\", \"stateNameInSeal\":
   * \"true\", \"notaryPublicInSeal\": \"true\",
   * \"allowSystemCreatedSeal\": \"true\", \"allowUserUploadedSeal\":
   * \"false\" }, \"commissionId\": \"123456\",
   * \"commissionExpiration\": \"2020-08-31T07:00:00.0000000Z\",
   * \"registeredName\": \"Bob Notary\", \"county\":
   * \"Adams\", \"sealType\": \"system_created\" } ```
   * If you want to change the name of the notary from \"Bob Notary\" to \"Robert
   * Notary\", your request body would be: ``` { \"jurisdiction\": {
   * \"jurisdictionId\": \"15\", \"name\": \"Iowa\",
   * \"county\": \"\", \"enabled\": \"true\",
   * \"countyInSeal\": \"false\", \"commissionIdInSeal\":
   * \"true\", \"stateNameInSeal\": \"true\",
   * \"notaryPublicInSeal\": \"true\", \"allowSystemCreatedSeal\":
   * \"true\", \"allowUserUploadedSeal\": \"false\" },
   * \"commissionId\": \"123456\", \"commissionExpiration\":
   * \"2020-08-31T07:00:00.0000000Z\", \"registeredName\": \"Robert
   * Notary\", \"county\": \"Adams\", \"sealType\":
   * \"system_created\" } ```
   *
   * @param jurisdictionId (required)
   * @param notaryJurisdiction (optional)
   * @return NotaryJurisdiction
   * @throws ApiException if fails to make API call
   */
  public ApiResponse updateNotaryJurisdictionWithHttpInfo(
      String jurisdictionId, NotaryJurisdiction notaryJurisdiction) throws ApiException {
    Object localVarPostBody = notaryJurisdiction;

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

    // create path and map variables
    String localVarPath =
        "/v2.1/current_user/notary/jurisdictions/{jurisdictionId}"
            .replaceAll(
                "\\{" + "jurisdictionId" + "\\}",
                apiClient.escapeString(jurisdictionId.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"};

    GenericType localVarReturnType = new GenericType() {};
    NotaryJurisdiction localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "PUT",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }
}