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

com.docusign.admin.api.AccountsApi Maven / Gradle / Ivy

Go to download

The DocuSign Admin API enables you to automate user management with your existing systems while ensuring governance and compliance.

There is a newer version: 2.0.0-RC1
Show newest version
package com.docusign.admin.api;

import com.docusign.admin.client.ApiClient;
import com.docusign.admin.client.ApiException;
import com.docusign.admin.client.ApiResponse;
import com.docusign.admin.client.Configuration;
import com.docusign.admin.client.Pair;
import com.docusign.admin.model.*;
import jakarta.ws.rs.core.GenericType;

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

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

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

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

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

  /// 
  /// Returns the list of groups in an account. Required scopes: group_read
  /// 

  /** GetGroupsOptions Class. */
  public class GetGroupsOptions {
    private Integer start = null;
    private Integer take = null;
    private Integer end = null;

    /** setStart method. */
    public void setStart(Integer start) {
      this.start = start;
    }

    /**
     * getStart method.
     *
     * @return Integer
     */
    public Integer getStart() {
      return this.start;
    }

    /** setTake method. */
    public void setTake(Integer take) {
      this.take = take;
    }

    /**
     * getTake method.
     *
     * @return Integer
     */
    public Integer getTake() {
      return this.take;
    }

    /** setEnd method. */
    public void setEnd(Integer end) {
      this.end = end;
    }

    /**
     * getEnd method.
     *
     * @return Integer
     */
    public Integer getEnd() {
      return this.end;
    }
  }

  /**
   * Returns the list of groups in an account.. Required scopes: group_read
   *
   * @param organizationId The organization ID Guid (required)
   * @param accountId The account ID Guid (required)
   * @return MemberGroupsResponse
   */
  public MemberGroupsResponse getGroups(java.util.UUID organizationId, java.util.UUID accountId)
      throws ApiException {
    return getGroups(organizationId, accountId, null);
  }

  /**
   * Returns the list of groups in an account.. Required scopes: group_read
   *
   * @param organizationId The organization ID Guid (required)
   * @param accountId The account ID Guid (required)
   * @param options for modifying the method behavior.
   * @return MemberGroupsResponse
   * @throws ApiException if fails to make API call
   */
  public MemberGroupsResponse getGroups(
      java.util.UUID organizationId, java.util.UUID accountId, AccountsApi.GetGroupsOptions options)
      throws ApiException {
    ApiResponse localVarResponse =
        getGroupsWithHttpInfo(organizationId, accountId, options);
    return localVarResponse.getData();
  }

  /**
   * Returns the list of groups in an account. Required scopes: group_read
   *
   * @param organizationId The organization ID Guid (required)
   * @param accountId The account ID Guid (required)
   * @param options for modifying the method behavior.
   * @return MemberGroupsResponse
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getGroupsWithHttpInfo(
      java.util.UUID organizationId, java.util.UUID accountId, AccountsApi.GetGroupsOptions options)
      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 getGroups");
    }

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

    // create path and map variables
    String localVarPath =
        "/v2/organizations/{organizationId}/accounts/{accountId}/groups"
            .replaceAll(
                "\\{" + "organizationId" + "\\}", apiClient.escapeString(organizationId.toString()))
            .replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.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();

    if (options != null) {
      localVarQueryParams.addAll(apiClient.parameterToPair("start", options.start));
    }
    if (options != null) {
      localVarQueryParams.addAll(apiClient.parameterToPair("take", options.take));
    }
    if (options != null) {
      localVarQueryParams.addAll(apiClient.parameterToPair("end", options.end));
    }

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

    final String[] localVarContentTypes = {"application/json"};
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

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

    GenericType localVarReturnType =
        new GenericType() {};
    MemberGroupsResponse localVarResponse =
        apiClient.invokeAPI(
            localVarPath,
            "GET",
            localVarQueryParams,
            localVarCollectionQueryParams,
            localVarPostBody,
            localVarHeaderParams,
            localVarFormParams,
            localVarAccept,
            localVarContentType,
            localVarAuthNames,
            localVarReturnType);
    return new ApiResponse(
        apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
  }
  /// 
  /// Returns the list of organizations of which the authenticated user is a member. Required
  // scopes: organization_read
  /// 

  /** GetOrganizationsOptions Class. */
  public class GetOrganizationsOptions {
    private String mode = null;

    /** setMode method. */
    public void setMode(String mode) {
      this.mode = mode;
    }

    /**
     * getMode method.
     *
     * @return String
     */
    public String getMode() {
      return this.mode;
    }
  }

  /**
   * Returns the list of organizations of which the authenticated user is a member.. Required
   * scopes: organization_read
   *
   * @return OrganizationsResponse
   */
  public OrganizationsResponse getOrganizations() throws ApiException {
    return getOrganizations(null);
  }

  /**
   * Returns the list of organizations of which the authenticated user is a member.. Required
   * scopes: organization_read
   *
   * @param options for modifying the method behavior.
   * @return OrganizationsResponse
   * @throws ApiException if fails to make API call
   */
  public OrganizationsResponse getOrganizations(AccountsApi.GetOrganizationsOptions options)
      throws ApiException {
    ApiResponse localVarResponse = getOrganizationsWithHttpInfo(options);
    return localVarResponse.getData();
  }

  /**
   * Returns the list of organizations of which the authenticated user is a member. Required scopes:
   * organization_read
   *
   * @param options for modifying the method behavior.
   * @return OrganizationsResponse
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getOrganizationsWithHttpInfo(
      AccountsApi.GetOrganizationsOptions options) throws ApiException {
    Object localVarPostBody = "{}";

    // create path and map variables
    String localVarPath = "/v2/organizations";

    // 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("mode", options.mode));
    }

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

    final String[] localVarContentTypes = {"application/json"};
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

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

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

  /**
   * Returns the list of permission profiles in an account.. Required scopes: permission_read
   *
   * @param organizationId The organization ID Guid (required)
   * @param accountId The account ID Guid (required)
   * @return PermissionsResponse
   * @throws ApiException if fails to make API call
   */
  public PermissionsResponse getPermissions(java.util.UUID organizationId, java.util.UUID accountId)
      throws ApiException {
    ApiResponse localVarResponse =
        getPermissionsWithHttpInfo(organizationId, accountId);
    return localVarResponse.getData();
  }

  /**
   * Returns the list of permission profiles in an account. Required scopes: permission_read
   *
   * @param organizationId The organization ID Guid (required)
   * @param accountId The account ID Guid (required)
   * @return PermissionsResponse
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getPermissionsWithHttpInfo(
      java.util.UUID organizationId, java.util.UUID accountId) 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 getPermissions");
    }

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

    // create path and map variables
    String localVarPath =
        "/v2/organizations/{organizationId}/accounts/{accountId}/permissions"
            .replaceAll(
                "\\{" + "organizationId" + "\\}", apiClient.escapeString(organizationId.toString()))
            .replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.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 = {"application/json"};
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

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

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

  /**
   * Redacts membership data for users with memberships in an account.. Required scopes:
   * user_data_redact
   *
   * @param accountId The account ID Guid (required)
   * @param requestModel The request body describing the membership to be redacted (required)
   * @return IndividualUserDataRedactionResponse
   * @throws ApiException if fails to make API call
   */
  public IndividualUserDataRedactionResponse redactIndividualMembershipData(
      java.util.UUID accountId, IndividualMembershipDataRedactionRequest requestModel)
      throws ApiException {
    ApiResponse localVarResponse =
        redactIndividualMembershipDataWithHttpInfo(accountId, requestModel);
    return localVarResponse.getData();
  }

  /**
   * Redacts membership data for users with memberships in an account. Required scopes:
   * user_data_redact
   *
   * @param accountId The account ID Guid (required)
   * @param requestModel The request body describing the membership to be redacted (required)
   * @return IndividualUserDataRedactionResponse
   * @throws ApiException if fails to make API call
   */
  public ApiResponse
      redactIndividualMembershipDataWithHttpInfo(
          java.util.UUID accountId, IndividualMembershipDataRedactionRequest requestModel)
          throws ApiException {
    Object localVarPostBody = requestModel;

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

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

    // create path and map variables
    String localVarPath =
        "/v2/data_redaction/accounts/{accountId}/user"
            .replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.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 = {"application/json"};
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy