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

com.dominodatalab.api.rest.FilesApi Maven / Gradle / Ivy

/*
 * Domino Data Lab API v4
 * This API is going to provide access to all the Domino functions available in the user interface. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key. 
 *
 * The version of the OpenAPI document: 4.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.dominodatalab.api.rest;

import com.dominodatalab.api.invoker.ApiClient;
import com.dominodatalab.api.invoker.ApiException;
import com.dominodatalab.api.invoker.ApiResponse;
import com.dominodatalab.api.invoker.Pair;

import com.dominodatalab.api.model.DominoApiErrorResponse;
import com.dominodatalab.api.model.DominoFilesInterfaceBranchInfo;
import com.dominodatalab.api.model.DominoFilesInterfaceComment;
import com.dominodatalab.api.model.DominoFilesInterfaceCommentThread;
import com.dominodatalab.api.model.DominoFilesInterfaceCommitInfo;
import com.dominodatalab.api.model.DominoFilesInterfaceFileGoal;
import com.dominodatalab.api.model.DominoFilesInterfaceFileMatchesDto;
import com.dominodatalab.api.model.DominoFilesInterfaceFileSearchQuery;
import com.dominodatalab.api.model.DominoFilesInterfaceProjectFile;
import com.dominodatalab.api.model.DominoFilesInterfaceProjectReadmeFile;
import com.dominodatalab.api.model.DominoFilesWebArchiveFileComment;
import com.dominodatalab.api.model.DominoFilesWebCreateFileComment;
import com.dominodatalab.api.model.DominoFilesWebFileOrFolderToMove;
import com.dominodatalab.api.model.DominoFilesWebFileOrFolderToRemove;
import com.dominodatalab.api.model.DominoFilesWebFilesAndFoldersToRemove;
import com.dominodatalab.api.model.DominoFilesWebFullDeleteSpecification;
import com.dominodatalab.api.model.DominoFilesWebLinkFileToGoal;
import com.dominodatalab.api.model.DominoFilesWebUnlinkFileFromGoal;
import com.dominodatalab.api.model.DominoNucleusFileProjectCommitDeprecated;
import com.dominodatalab.api.model.DominoNucleusFileProjectFileDeprecated;
import java.io.File;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;

import java.io.InputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.http.HttpRequest;
import java.nio.channels.Channels;
import java.nio.channels.Pipe;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

import java.util.ArrayList;
import java.util.StringJoiner;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class FilesApi {
  private final HttpClient memberVarHttpClient;
  private final ObjectMapper memberVarObjectMapper;
  private final String memberVarBaseUri;
  private final Consumer memberVarInterceptor;
  private final Duration memberVarReadTimeout;
  private final Consumer> memberVarResponseInterceptor;
  private final Consumer> memberVarAsyncResponseInterceptor;

  public FilesApi() {
    this(new ApiClient());
  }

  public FilesApi(ApiClient apiClient) {
    memberVarHttpClient = apiClient.getHttpClient();
    memberVarObjectMapper = apiClient.getObjectMapper();
    memberVarBaseUri = apiClient.getBaseUri();
    memberVarInterceptor = apiClient.getRequestInterceptor();
    memberVarReadTimeout = apiClient.getReadTimeout();
    memberVarResponseInterceptor = apiClient.getResponseInterceptor();
    memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor();
  }

  protected ApiException getApiException(String operationId, HttpResponse response) throws IOException {
    String body = response.body() == null ? null : new String(response.body().readAllBytes());
    String message = formatExceptionMessage(operationId, response.statusCode(), body);
    return new ApiException(response.statusCode(), message, response.headers(), body);
  }

  private String formatExceptionMessage(String operationId, int statusCode, String body) {
    if (body == null || body.isEmpty()) {
      body = "[no body]";
    }
    return operationId + " call failed with: " + statusCode + " - " + body;
  }

  /**
   * Create a File Comment
   * 
   * @param dominoFilesWebCreateFileComment JSON object with information to comment on the file (required)
   * @return DominoFilesInterfaceCommentThread
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceCommentThread addFileComment(DominoFilesWebCreateFileComment dominoFilesWebCreateFileComment) throws ApiException {
    ApiResponse localVarResponse = addFileCommentWithHttpInfo(dominoFilesWebCreateFileComment);
    return localVarResponse.getData();
  }

  /**
   * Create a File Comment
   * 
   * @param dominoFilesWebCreateFileComment JSON object with information to comment on the file (required)
   * @return ApiResponse<DominoFilesInterfaceCommentThread>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse addFileCommentWithHttpInfo(DominoFilesWebCreateFileComment dominoFilesWebCreateFileComment) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = addFileCommentRequestBuilder(dominoFilesWebCreateFileComment);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("addFileComment", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder addFileCommentRequestBuilder(DominoFilesWebCreateFileComment dominoFilesWebCreateFileComment) throws ApiException {
    // verify the required parameter 'dominoFilesWebCreateFileComment' is set
    if (dominoFilesWebCreateFileComment == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebCreateFileComment' when calling addFileComment");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/comment";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebCreateFileComment);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Archive a File Comment
   * 
   * @param dominoFilesWebArchiveFileComment JSON object with information to comment on the file (required)
   * @return DominoFilesInterfaceComment
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceComment archiveFileComment(DominoFilesWebArchiveFileComment dominoFilesWebArchiveFileComment) throws ApiException {
    ApiResponse localVarResponse = archiveFileCommentWithHttpInfo(dominoFilesWebArchiveFileComment);
    return localVarResponse.getData();
  }

  /**
   * Archive a File Comment
   * 
   * @param dominoFilesWebArchiveFileComment JSON object with information to comment on the file (required)
   * @return ApiResponse<DominoFilesInterfaceComment>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse archiveFileCommentWithHttpInfo(DominoFilesWebArchiveFileComment dominoFilesWebArchiveFileComment) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = archiveFileCommentRequestBuilder(dominoFilesWebArchiveFileComment);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("archiveFileComment", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder archiveFileCommentRequestBuilder(DominoFilesWebArchiveFileComment dominoFilesWebArchiveFileComment) throws ApiException {
    // verify the required parameter 'dominoFilesWebArchiveFileComment' is set
    if (dominoFilesWebArchiveFileComment == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebArchiveFileComment' when calling archiveFileComment");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/comment/archive";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebArchiveFileComment);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Search for files in a project by matching on path with string queries
   * 
   * @param projectId Project in which to look for files (required)
   * @param dominoFilesInterfaceFileSearchQuery JSON object with the search query (required)
   * @param maxResults  (optional)
   * @return DominoFilesInterfaceFileMatchesDto
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceFileMatchesDto fileSearch(String projectId, DominoFilesInterfaceFileSearchQuery dominoFilesInterfaceFileSearchQuery, Integer maxResults) throws ApiException {
    ApiResponse localVarResponse = fileSearchWithHttpInfo(projectId, dominoFilesInterfaceFileSearchQuery, maxResults);
    return localVarResponse.getData();
  }

  /**
   * Search for files in a project by matching on path with string queries
   * 
   * @param projectId Project in which to look for files (required)
   * @param dominoFilesInterfaceFileSearchQuery JSON object with the search query (required)
   * @param maxResults  (optional)
   * @return ApiResponse<DominoFilesInterfaceFileMatchesDto>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse fileSearchWithHttpInfo(String projectId, DominoFilesInterfaceFileSearchQuery dominoFilesInterfaceFileSearchQuery, Integer maxResults) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = fileSearchRequestBuilder(projectId, dominoFilesInterfaceFileSearchQuery, maxResults);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("fileSearch", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder fileSearchRequestBuilder(String projectId, DominoFilesInterfaceFileSearchQuery dominoFilesInterfaceFileSearchQuery, Integer maxResults) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling fileSearch");
    }
    // verify the required parameter 'dominoFilesInterfaceFileSearchQuery' is set
    if (dominoFilesInterfaceFileSearchQuery == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesInterfaceFileSearchQuery' when calling fileSearch");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/search/{projectId}"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()));

    List localVarQueryParams = new ArrayList<>();
    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    localVarQueryParameterBaseName = "maxResults";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("maxResults", maxResults));

    if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
      StringJoiner queryJoiner = new StringJoiner("&");
      localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
      if (localVarQueryStringJoiner.length() != 0) {
        queryJoiner.add(localVarQueryStringJoiner.toString());
      }
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
    } else {
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
    }

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesInterfaceFileSearchQuery);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Full delete a file in a project starting at a commit
   * 
   * @param dominoFilesWebFullDeleteSpecification JSON object with information to delete a file permanently (required)
   * @return Object
   * @throws ApiException if fails to make API call
   */
  public Object fullDelete(DominoFilesWebFullDeleteSpecification dominoFilesWebFullDeleteSpecification) throws ApiException {
    ApiResponse localVarResponse = fullDeleteWithHttpInfo(dominoFilesWebFullDeleteSpecification);
    return localVarResponse.getData();
  }

  /**
   * Full delete a file in a project starting at a commit
   * 
   * @param dominoFilesWebFullDeleteSpecification JSON object with information to delete a file permanently (required)
   * @return ApiResponse<Object>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse fullDeleteWithHttpInfo(DominoFilesWebFullDeleteSpecification dominoFilesWebFullDeleteSpecification) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = fullDeleteRequestBuilder(dominoFilesWebFullDeleteSpecification);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("fullDelete", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder fullDeleteRequestBuilder(DominoFilesWebFullDeleteSpecification dominoFilesWebFullDeleteSpecification) throws ApiException {
    // verify the required parameter 'dominoFilesWebFullDeleteSpecification' is set
    if (dominoFilesWebFullDeleteSpecification == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebFullDeleteSpecification' when calling fullDelete");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/fullDelete";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebFullDeleteSpecification);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Check permanent deletion status of a file in a project starting at a commit
   * 
   * @param filePath path to file (required)
   * @param projectId ID of the project the file is in (required)
   * @param commitId ID of the commit for this file (required)
   * @return Object
   * @throws ApiException if fails to make API call
   */
  public Object fullyDeleted(String filePath, String projectId, String commitId) throws ApiException {
    ApiResponse localVarResponse = fullyDeletedWithHttpInfo(filePath, projectId, commitId);
    return localVarResponse.getData();
  }

  /**
   * Check permanent deletion status of a file in a project starting at a commit
   * 
   * @param filePath path to file (required)
   * @param projectId ID of the project the file is in (required)
   * @param commitId ID of the commit for this file (required)
   * @return ApiResponse<Object>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse fullyDeletedWithHttpInfo(String filePath, String projectId, String commitId) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = fullyDeletedRequestBuilder(filePath, projectId, commitId);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("fullyDeleted", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder fullyDeletedRequestBuilder(String filePath, String projectId, String commitId) throws ApiException {
    // verify the required parameter 'filePath' is set
    if (filePath == null) {
      throw new ApiException(400, "Missing the required parameter 'filePath' when calling fullyDeleted");
    }
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling fullyDeleted");
    }
    // verify the required parameter 'commitId' is set
    if (commitId == null) {
      throw new ApiException(400, "Missing the required parameter 'commitId' when calling fullyDeleted");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/fullyDeleted";

    List localVarQueryParams = new ArrayList<>();
    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    localVarQueryParameterBaseName = "filePath";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("filePath", filePath));
    localVarQueryParameterBaseName = "projectId";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("projectId", projectId));
    localVarQueryParameterBaseName = "commitId";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("commitId", commitId));

    if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
      StringJoiner queryJoiner = new StringJoiner("&");
      localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
      if (localVarQueryStringJoiner.length() != 0) {
        queryJoiner.add(localVarQueryStringJoiner.toString());
      }
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
    } else {
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
    }

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Get all commits for a branch for a Project
   * 
   * @param projectId  (required)
   * @param branchName branch to list commits for (required)
   * @return List<DominoFilesInterfaceCommitInfo>
   * @throws ApiException if fails to make API call
   */
  public List getCommitsForProject(String projectId, String branchName) throws ApiException {
    ApiResponse> localVarResponse = getCommitsForProjectWithHttpInfo(projectId, branchName);
    return localVarResponse.getData();
  }

  /**
   * Get all commits for a branch for a Project
   * 
   * @param projectId  (required)
   * @param branchName branch to list commits for (required)
   * @return ApiResponse<List<DominoFilesInterfaceCommitInfo>>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getCommitsForProjectWithHttpInfo(String projectId, String branchName) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getCommitsForProjectRequestBuilder(projectId, branchName);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getCommitsForProject", localVarResponse);
        }
        return new ApiResponse>(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder getCommitsForProjectRequestBuilder(String projectId, String branchName) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling getCommitsForProject");
    }
    // verify the required parameter 'branchName' is set
    if (branchName == null) {
      throw new ApiException(400, "Missing the required parameter 'branchName' when calling getCommitsForProject");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/{projectId}/commits"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()));

    List localVarQueryParams = new ArrayList<>();
    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    localVarQueryParameterBaseName = "branchName";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("branchName", branchName));

    if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
      StringJoiner queryJoiner = new StringJoiner("&");
      localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
      if (localVarQueryStringJoiner.length() != 0) {
        queryJoiner.add(localVarQueryStringJoiner.toString());
      }
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
    } else {
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
    }

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Get file comments
   * 
   * @param projectId Project Id to which the file belongs (required)
   * @param fileName file name to add the comment to (required)
   * @param commitId commit id of the file (required)
   * @return DominoFilesInterfaceCommentThread
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceCommentThread getFileCommentThread(String projectId, String fileName, String commitId) throws ApiException {
    ApiResponse localVarResponse = getFileCommentThreadWithHttpInfo(projectId, fileName, commitId);
    return localVarResponse.getData();
  }

  /**
   * Get file comments
   * 
   * @param projectId Project Id to which the file belongs (required)
   * @param fileName file name to add the comment to (required)
   * @param commitId commit id of the file (required)
   * @return ApiResponse<DominoFilesInterfaceCommentThread>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getFileCommentThreadWithHttpInfo(String projectId, String fileName, String commitId) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getFileCommentThreadRequestBuilder(projectId, fileName, commitId);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getFileCommentThread", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder getFileCommentThreadRequestBuilder(String projectId, String fileName, String commitId) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling getFileCommentThread");
    }
    // verify the required parameter 'fileName' is set
    if (fileName == null) {
      throw new ApiException(400, "Missing the required parameter 'fileName' when calling getFileCommentThread");
    }
    // verify the required parameter 'commitId' is set
    if (commitId == null) {
      throw new ApiException(400, "Missing the required parameter 'commitId' when calling getFileCommentThread");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/comment";

    List localVarQueryParams = new ArrayList<>();
    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    localVarQueryParameterBaseName = "projectId";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("projectId", projectId));
    localVarQueryParameterBaseName = "fileName";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("fileName", fileName));
    localVarQueryParameterBaseName = "commitId";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("commitId", commitId));

    if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
      StringJoiner queryJoiner = new StringJoiner("&");
      localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
      if (localVarQueryStringJoiner.length() != 0) {
        queryJoiner.add(localVarQueryStringJoiner.toString());
      }
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
    } else {
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
    }

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * retrieves commits of the repository associated with the specified project
   * 
   * @param projectId Id of the project to return commits for (required)
   * @return List<DominoNucleusFileProjectCommitDeprecated>
   * @throws ApiException if fails to make API call
   */
  public List getProjectCommits(String projectId) throws ApiException {
    ApiResponse> localVarResponse = getProjectCommitsWithHttpInfo(projectId);
    return localVarResponse.getData();
  }

  /**
   * retrieves commits of the repository associated with the specified project
   * 
   * @param projectId Id of the project to return commits for (required)
   * @return ApiResponse<List<DominoNucleusFileProjectCommitDeprecated>>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getProjectCommitsWithHttpInfo(String projectId) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getProjectCommitsRequestBuilder(projectId);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getProjectCommits", localVarResponse);
        }
        return new ApiResponse>(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder getProjectCommitsRequestBuilder(String projectId) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling getProjectCommits");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/projects/{projectId}/commits"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()));

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * returns all the files for a specified project
   * 
   * @param projectId Id of the project to return files for (required)
   * @param commitId Id of a commit in the project repository to list files from (required)
   * @param path Path in the project's repository to list files from (if not specified, files in the root will be listed) (required)
   * @return List<DominoNucleusFileProjectFileDeprecated>
   * @throws ApiException if fails to make API call
   */
  public List getProjectFiles(String projectId, String commitId, String path) throws ApiException {
    ApiResponse> localVarResponse = getProjectFilesWithHttpInfo(projectId, commitId, path);
    return localVarResponse.getData();
  }

  /**
   * returns all the files for a specified project
   * 
   * @param projectId Id of the project to return files for (required)
   * @param commitId Id of a commit in the project repository to list files from (required)
   * @param path Path in the project's repository to list files from (if not specified, files in the root will be listed) (required)
   * @return ApiResponse<List<DominoNucleusFileProjectFileDeprecated>>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getProjectFilesWithHttpInfo(String projectId, String commitId, String path) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getProjectFilesRequestBuilder(projectId, commitId, path);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getProjectFiles", localVarResponse);
        }
        return new ApiResponse>(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder getProjectFilesRequestBuilder(String projectId, String commitId, String path) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling getProjectFiles");
    }
    // verify the required parameter 'commitId' is set
    if (commitId == null) {
      throw new ApiException(400, "Missing the required parameter 'commitId' when calling getProjectFiles");
    }
    // verify the required parameter 'path' is set
    if (path == null) {
      throw new ApiException(400, "Missing the required parameter 'path' when calling getProjectFiles");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/projects/{projectId}/commits/{commitId}/files/{path}"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
        .replace("{commitId}", ApiClient.urlEncode(commitId.toString()))
        .replace("{path}", ApiClient.urlEncode(path.toString()));

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * returns all the files for a specified project from the last commit
   * 
   * @param projectId Id of the project to return files for (required)
   * @param path Path in the project's repository to list files from (if not specified, files in the root will be listed) (required)
   * @return List<DominoNucleusFileProjectFileDeprecated>
   * @throws ApiException if fails to make API call
   */
  public List getProjectFilesFromHead(String projectId, String path) throws ApiException {
    ApiResponse> localVarResponse = getProjectFilesFromHeadWithHttpInfo(projectId, path);
    return localVarResponse.getData();
  }

  /**
   * returns all the files for a specified project from the last commit
   * 
   * @param projectId Id of the project to return files for (required)
   * @param path Path in the project's repository to list files from (if not specified, files in the root will be listed) (required)
   * @return ApiResponse<List<DominoNucleusFileProjectFileDeprecated>>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> getProjectFilesFromHeadWithHttpInfo(String projectId, String path) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getProjectFilesFromHeadRequestBuilder(projectId, path);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getProjectFilesFromHead", localVarResponse);
        }
        return new ApiResponse>(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder getProjectFilesFromHeadRequestBuilder(String projectId, String path) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling getProjectFilesFromHead");
    }
    // verify the required parameter 'path' is set
    if (path == null) {
      throw new ApiException(400, "Missing the required parameter 'path' when calling getProjectFilesFromHead");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/projects/{projectId}/commits/head/files/{path}"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
        .replace("{path}", ApiClient.urlEncode(path.toString()));

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * retrieves the last (head) commit in the repository associated with the specified project
   * 
   * @param projectId Id of the project to return head commit for (required)
   * @return DominoNucleusFileProjectCommitDeprecated
   * @throws ApiException if fails to make API call
   */
  public DominoNucleusFileProjectCommitDeprecated getProjectHeadCommit(String projectId) throws ApiException {
    ApiResponse localVarResponse = getProjectHeadCommitWithHttpInfo(projectId);
    return localVarResponse.getData();
  }

  /**
   * retrieves the last (head) commit in the repository associated with the specified project
   * 
   * @param projectId Id of the project to return head commit for (required)
   * @return ApiResponse<DominoNucleusFileProjectCommitDeprecated>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getProjectHeadCommitWithHttpInfo(String projectId) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getProjectHeadCommitRequestBuilder(projectId);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getProjectHeadCommit", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder getProjectHeadCommitRequestBuilder(String projectId) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling getProjectHeadCommit");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/projects/{projectId}/commits/head"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()));

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Get project readme file
   * 
   * @param projectId  (required)
   * @return DominoFilesInterfaceProjectReadmeFile
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceProjectReadmeFile getProjectReadme(String projectId) throws ApiException {
    ApiResponse localVarResponse = getProjectReadmeWithHttpInfo(projectId);
    return localVarResponse.getData();
  }

  /**
   * Get project readme file
   * 
   * @param projectId  (required)
   * @return ApiResponse<DominoFilesInterfaceProjectReadmeFile>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getProjectReadmeWithHttpInfo(String projectId) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getProjectReadmeRequestBuilder(projectId);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getProjectReadme", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder getProjectReadmeRequestBuilder(String projectId) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling getProjectReadme");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/{projectId}/readme"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()));

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Link a file to a goal
   * 
   * @param dominoFilesWebLinkFileToGoal JSON object with information to link file to a goal (required)
   * @return DominoFilesInterfaceFileGoal
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceFileGoal linkFileToGoal(DominoFilesWebLinkFileToGoal dominoFilesWebLinkFileToGoal) throws ApiException {
    ApiResponse localVarResponse = linkFileToGoalWithHttpInfo(dominoFilesWebLinkFileToGoal);
    return localVarResponse.getData();
  }

  /**
   * Link a file to a goal
   * 
   * @param dominoFilesWebLinkFileToGoal JSON object with information to link file to a goal (required)
   * @return ApiResponse<DominoFilesInterfaceFileGoal>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse linkFileToGoalWithHttpInfo(DominoFilesWebLinkFileToGoal dominoFilesWebLinkFileToGoal) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = linkFileToGoalRequestBuilder(dominoFilesWebLinkFileToGoal);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("linkFileToGoal", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder linkFileToGoalRequestBuilder(DominoFilesWebLinkFileToGoal dominoFilesWebLinkFileToGoal) throws ApiException {
    // verify the required parameter 'dominoFilesWebLinkFileToGoal' is set
    if (dominoFilesWebLinkFileToGoal == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebLinkFileToGoal' when calling linkFileToGoal");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/linkToGoal";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebLinkFileToGoal);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * List branches for a project
   * 
   * @param projectId  (required)
   * @param query search query for branch name (required)
   * @return List<DominoFilesInterfaceBranchInfo>
   * @throws ApiException if fails to make API call
   */
  public List listBranchesForProject(String projectId, String query) throws ApiException {
    ApiResponse> localVarResponse = listBranchesForProjectWithHttpInfo(projectId, query);
    return localVarResponse.getData();
  }

  /**
   * List branches for a project
   * 
   * @param projectId  (required)
   * @param query search query for branch name (required)
   * @return ApiResponse<List<DominoFilesInterfaceBranchInfo>>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse> listBranchesForProjectWithHttpInfo(String projectId, String query) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = listBranchesForProjectRequestBuilder(projectId, query);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("listBranchesForProject", localVarResponse);
        }
        return new ApiResponse>(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder listBranchesForProjectRequestBuilder(String projectId, String query) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling listBranchesForProject");
    }
    // verify the required parameter 'query' is set
    if (query == null) {
      throw new ApiException(400, "Missing the required parameter 'query' when calling listBranchesForProject");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/{projectId}/branches"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()));

    List localVarQueryParams = new ArrayList<>();
    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    localVarQueryParameterBaseName = "query";
    localVarQueryParams.addAll(ApiClient.parameterToPairs("query", query));

    if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
      StringJoiner queryJoiner = new StringJoiner("&");
      localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
      if (localVarQueryStringJoiner.length() != 0) {
        queryJoiner.add(localVarQueryStringJoiner.toString());
      }
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
    } else {
      localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
    }

    localVarRequestBuilder.header("Accept", "application/json");

    localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Move a file or a folder from one path to another
   * 
   * @param dominoFilesWebFileOrFolderToMove What to move and what it is (required)
   * @return String
   * @throws ApiException if fails to make API call
   */
  public String moveFileOrFolder(DominoFilesWebFileOrFolderToMove dominoFilesWebFileOrFolderToMove) throws ApiException {
    ApiResponse localVarResponse = moveFileOrFolderWithHttpInfo(dominoFilesWebFileOrFolderToMove);
    return localVarResponse.getData();
  }

  /**
   * Move a file or a folder from one path to another
   * 
   * @param dominoFilesWebFileOrFolderToMove What to move and what it is (required)
   * @return ApiResponse<String>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse moveFileOrFolderWithHttpInfo(DominoFilesWebFileOrFolderToMove dominoFilesWebFileOrFolderToMove) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = moveFileOrFolderRequestBuilder(dominoFilesWebFileOrFolderToMove);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("moveFileOrFolder", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder moveFileOrFolderRequestBuilder(DominoFilesWebFileOrFolderToMove dominoFilesWebFileOrFolderToMove) throws ApiException {
    // verify the required parameter 'dominoFilesWebFileOrFolderToMove' is set
    if (dominoFilesWebFileOrFolderToMove == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebFileOrFolderToMove' when calling moveFileOrFolder");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/moveFileOrFolder";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebFileOrFolderToMove);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Git remove single file or directory
   * 
   * @param dominoFilesWebFileOrFolderToRemove JSON object with information to remove this file or direcotyr (required)
   * @return String
   * @throws ApiException if fails to make API call
   */
  public String removeFile(DominoFilesWebFileOrFolderToRemove dominoFilesWebFileOrFolderToRemove) throws ApiException {
    ApiResponse localVarResponse = removeFileWithHttpInfo(dominoFilesWebFileOrFolderToRemove);
    return localVarResponse.getData();
  }

  /**
   * Git remove single file or directory
   * 
   * @param dominoFilesWebFileOrFolderToRemove JSON object with information to remove this file or direcotyr (required)
   * @return ApiResponse<String>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse removeFileWithHttpInfo(DominoFilesWebFileOrFolderToRemove dominoFilesWebFileOrFolderToRemove) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = removeFileRequestBuilder(dominoFilesWebFileOrFolderToRemove);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("removeFile", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder removeFileRequestBuilder(DominoFilesWebFileOrFolderToRemove dominoFilesWebFileOrFolderToRemove) throws ApiException {
    // verify the required parameter 'dominoFilesWebFileOrFolderToRemove' is set
    if (dominoFilesWebFileOrFolderToRemove == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebFileOrFolderToRemove' when calling removeFile");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/removeFile";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebFileOrFolderToRemove);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Remove many files and/or directories
   * 
   * @param dominoFilesWebFilesAndFoldersToRemove  (required)
   * @return String
   * @throws ApiException if fails to make API call
   */
  public String removeFiles(DominoFilesWebFilesAndFoldersToRemove dominoFilesWebFilesAndFoldersToRemove) throws ApiException {
    ApiResponse localVarResponse = removeFilesWithHttpInfo(dominoFilesWebFilesAndFoldersToRemove);
    return localVarResponse.getData();
  }

  /**
   * Remove many files and/or directories
   * 
   * @param dominoFilesWebFilesAndFoldersToRemove  (required)
   * @return ApiResponse<String>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse removeFilesWithHttpInfo(DominoFilesWebFilesAndFoldersToRemove dominoFilesWebFilesAndFoldersToRemove) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = removeFilesRequestBuilder(dominoFilesWebFilesAndFoldersToRemove);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("removeFiles", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder removeFilesRequestBuilder(DominoFilesWebFilesAndFoldersToRemove dominoFilesWebFilesAndFoldersToRemove) throws ApiException {
    // verify the required parameter 'dominoFilesWebFilesAndFoldersToRemove' is set
    if (dominoFilesWebFilesAndFoldersToRemove == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebFilesAndFoldersToRemove' when calling removeFiles");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/removeFiles";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebFilesAndFoldersToRemove);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * Unlink a file from a goal
   * 
   * @param dominoFilesWebUnlinkFileFromGoal JSON object with information to unlink file from a goal (required)
   * @return DominoFilesInterfaceFileGoal
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceFileGoal unlinkFileFromGoal(DominoFilesWebUnlinkFileFromGoal dominoFilesWebUnlinkFileFromGoal) throws ApiException {
    ApiResponse localVarResponse = unlinkFileFromGoalWithHttpInfo(dominoFilesWebUnlinkFileFromGoal);
    return localVarResponse.getData();
  }

  /**
   * Unlink a file from a goal
   * 
   * @param dominoFilesWebUnlinkFileFromGoal JSON object with information to unlink file from a goal (required)
   * @return ApiResponse<DominoFilesInterfaceFileGoal>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse unlinkFileFromGoalWithHttpInfo(DominoFilesWebUnlinkFileFromGoal dominoFilesWebUnlinkFileFromGoal) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = unlinkFileFromGoalRequestBuilder(dominoFilesWebUnlinkFileFromGoal);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("unlinkFileFromGoal", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder unlinkFileFromGoalRequestBuilder(DominoFilesWebUnlinkFileFromGoal dominoFilesWebUnlinkFileFromGoal) throws ApiException {
    // verify the required parameter 'dominoFilesWebUnlinkFileFromGoal' is set
    if (dominoFilesWebUnlinkFileFromGoal == null) {
      throw new ApiException(400, "Missing the required parameter 'dominoFilesWebUnlinkFileFromGoal' when calling unlinkFileFromGoal");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/files/unlinkFromGoal";

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Content-Type", "application/json");
    localVarRequestBuilder.header("Accept", "application/json");

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(dominoFilesWebUnlinkFileFromGoal);
      localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
    } catch (IOException e) {
      throw new ApiException(e);
    }
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
  /**
   * uploads a file to the head commit of the project's repository
   * 
   * @param projectId Id of the project to upload the file to (required)
   * @param path Path in the project's repository to upload the file to (required)
   * @param upfile The file to upload (optional)
   * @return DominoFilesInterfaceProjectFile
   * @throws ApiException if fails to make API call
   */
  public DominoFilesInterfaceProjectFile uploadFile(String projectId, String path, File upfile) throws ApiException {
    ApiResponse localVarResponse = uploadFileWithHttpInfo(projectId, path, upfile);
    return localVarResponse.getData();
  }

  /**
   * uploads a file to the head commit of the project's repository
   * 
   * @param projectId Id of the project to upload the file to (required)
   * @param path Path in the project's repository to upload the file to (required)
   * @param upfile The file to upload (optional)
   * @return ApiResponse<DominoFilesInterfaceProjectFile>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse uploadFileWithHttpInfo(String projectId, String path, File upfile) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(projectId, path, upfile);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("uploadFile", localVarResponse);
        }
        return new ApiResponse(
          localVarResponse.statusCode(),
          localVarResponse.headers().map(),
          localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
        );
      } finally {
      }
    } catch (IOException e) {
      throw new ApiException(e);
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new ApiException(e);
    }
  }

  private HttpRequest.Builder uploadFileRequestBuilder(String projectId, String path, File upfile) throws ApiException {
    // verify the required parameter 'projectId' is set
    if (projectId == null) {
      throw new ApiException(400, "Missing the required parameter 'projectId' when calling uploadFile");
    }
    // verify the required parameter 'path' is set
    if (path == null) {
      throw new ApiException(400, "Missing the required parameter 'path' when calling uploadFile");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/projects/{projectId}/commits/head/files/{path}"
        .replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
        .replace("{path}", ApiClient.urlEncode(path.toString()));

    localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));

    localVarRequestBuilder.header("Accept", "application/json");

    MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create();
    boolean hasFiles = false;
    multiPartBuilder.addBinaryBody("upfile", upfile);
    hasFiles = true;
    HttpEntity entity = multiPartBuilder.build();
    HttpRequest.BodyPublisher formDataPublisher;
    if (hasFiles) {
        Pipe pipe;
        try {
            pipe = Pipe.open();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        new Thread(() -> {
            try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) {
                entity.writeTo(outputStream);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }).start();
        formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source()));
    } else {
        ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream();
        try {
            entity.writeTo(formOutputStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        formDataPublisher = HttpRequest.BodyPublishers
            .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()));
    }
    localVarRequestBuilder
        .header("Content-Type", entity.getContentType().getValue())
        .method("POST", formDataPublisher);
    if (memberVarReadTimeout != null) {
      localVarRequestBuilder.timeout(memberVarReadTimeout);
    }
    if (memberVarInterceptor != null) {
      memberVarInterceptor.accept(localVarRequestBuilder);
    }
    return localVarRequestBuilder;
  }
}