com.dominodatalab.pub.rest.ProjectsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-java-client Show documentation
Show all versions of domino-java-client Show documentation
Domino Data Lab API Client to connect to Domino web services using Java HTTP Client.
/*
* Domino Public API
* Domino Public API Endpoints
*
* The version of the OpenAPI document: 0.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.pub.rest;
import com.dominodatalab.pub.invoker.ApiClient;
import com.dominodatalab.pub.invoker.ApiException;
import com.dominodatalab.pub.invoker.ApiResponse;
import com.dominodatalab.pub.invoker.Pair;
import com.dominodatalab.pub.model.CopyProjectSpecV1;
import com.dominodatalab.pub.model.DeleteEnvelopeV1;
import com.dominodatalab.pub.model.FailureEnvelopeV1;
import com.dominodatalab.pub.model.GetAIGatewayAuditData400Response;
import com.dominodatalab.pub.model.NewProjectGitRepositoryV1;
import com.dominodatalab.pub.model.NewProjectGoalV1;
import com.dominodatalab.pub.model.NewProjectV1;
import com.dominodatalab.pub.model.PaginatedGitRepositoriesEnvelopeV1;
import com.dominodatalab.pub.model.PaginatedProjectsEnvelopeV1;
import com.dominodatalab.pub.model.ProjectCollaboratorEnvelopeV1;
import com.dominodatalab.pub.model.ProjectCollaboratorV1;
import com.dominodatalab.pub.model.ProjectCopyResultEnvelopeV1;
import com.dominodatalab.pub.model.ProjectEnvelopeV1;
import com.dominodatalab.pub.model.ProjectGitRepositoryEnvelopeV1;
import com.dominodatalab.pub.model.ProjectGoalEnvelopeV1;
import com.dominodatalab.pub.model.ProjectGoalForUpdateV1;
import com.dominodatalab.pub.model.ProjectGoalsEnvelopeV1;
import com.dominodatalab.pub.model.ProjectResultsSettingsEnvelopeV1;
import com.dominodatalab.pub.model.ProjectResultsSettingsV1;
import com.dominodatalab.pub.model.ProjectStatusEnvelopeV1;
import com.dominodatalab.pub.model.ProjectStatusV1;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
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 = "2024-10-04T16:37:28.765500600-04:00[America/New_York]", comments = "Generator version: 7.8.0")
public class ProjectsApi {
protected final HttpClient memberVarHttpClient;
protected final ObjectMapper memberVarObjectMapper;
protected final String memberVarBaseUri;
protected final Consumer memberVarInterceptor;
protected final Duration memberVarReadTimeout;
protected final Consumer> memberVarResponseInterceptor;
protected final Consumer> memberVarAsyncResponseInterceptor;
public ProjectsApi() {
this(new ApiClient());
}
public ProjectsApi(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);
}
protected String formatExceptionMessage(String operationId, int statusCode, String body) {
if (body == null || body.isEmpty()) {
body = "[no body]";
}
return operationId + " call failed with: " + statusCode + " - " + body;
}
/**
* Add a collaborator to this project
* Add a collaborator to this project. Required permissions: `ManageCollaborators`
* @param projectId Project ID (required)
* @param projectCollaboratorV1 Collaborator ID (required)
* @return ProjectCollaboratorEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectCollaboratorEnvelopeV1 addCollaboratorToProject(String projectId, ProjectCollaboratorV1 projectCollaboratorV1) throws ApiException {
ApiResponse localVarResponse = addCollaboratorToProjectWithHttpInfo(projectId, projectCollaboratorV1);
return localVarResponse.getData();
}
/**
* Add a collaborator to this project
* Add a collaborator to this project. Required permissions: `ManageCollaborators`
* @param projectId Project ID (required)
* @param projectCollaboratorV1 Collaborator ID (required)
* @return ApiResponse<ProjectCollaboratorEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse addCollaboratorToProjectWithHttpInfo(String projectId, ProjectCollaboratorV1 projectCollaboratorV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = addCollaboratorToProjectRequestBuilder(projectId, projectCollaboratorV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("addCollaboratorToProject", 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);
}
}
protected HttpRequest.Builder addCollaboratorToProjectRequestBuilder(String projectId, ProjectCollaboratorV1 projectCollaboratorV1) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling addCollaboratorToProject");
}
// verify the required parameter 'projectCollaboratorV1' is set
if (projectCollaboratorV1 == null) {
throw new ApiException(400, "Missing the required parameter 'projectCollaboratorV1' when calling addCollaboratorToProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/collaborators"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(projectCollaboratorV1);
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;
}
/**
* Add a goal to this project
* Add a goal to this project. Required permissions: `Edit`
* @param projectId Project ID (required)
* @param newProjectGoalV1 Goal to add (required)
* @return ProjectGoalEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectGoalEnvelopeV1 addGoalToProject(String projectId, NewProjectGoalV1 newProjectGoalV1) throws ApiException {
ApiResponse localVarResponse = addGoalToProjectWithHttpInfo(projectId, newProjectGoalV1);
return localVarResponse.getData();
}
/**
* Add a goal to this project
* Add a goal to this project. Required permissions: `Edit`
* @param projectId Project ID (required)
* @param newProjectGoalV1 Goal to add (required)
* @return ApiResponse<ProjectGoalEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse addGoalToProjectWithHttpInfo(String projectId, NewProjectGoalV1 newProjectGoalV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = addGoalToProjectRequestBuilder(projectId, newProjectGoalV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("addGoalToProject", 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);
}
}
protected HttpRequest.Builder addGoalToProjectRequestBuilder(String projectId, NewProjectGoalV1 newProjectGoalV1) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling addGoalToProject");
}
// verify the required parameter 'newProjectGoalV1' is set
if (newProjectGoalV1 == null) {
throw new ApiException(400, "Missing the required parameter 'newProjectGoalV1' when calling addGoalToProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/goals"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(newProjectGoalV1);
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;
}
/**
* Add an imported git repository to this project
* Add an imported git repository to this project. Required permissions: `ChangeProjectSettings`
* @param projectId Project ID (required)
* @param newProjectGitRepositoryV1 Repository to add (required)
* @return ProjectGitRepositoryEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectGitRepositoryEnvelopeV1 addRepoToProject(String projectId, NewProjectGitRepositoryV1 newProjectGitRepositoryV1) throws ApiException {
ApiResponse localVarResponse = addRepoToProjectWithHttpInfo(projectId, newProjectGitRepositoryV1);
return localVarResponse.getData();
}
/**
* Add an imported git repository to this project
* Add an imported git repository to this project. Required permissions: `ChangeProjectSettings`
* @param projectId Project ID (required)
* @param newProjectGitRepositoryV1 Repository to add (required)
* @return ApiResponse<ProjectGitRepositoryEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse addRepoToProjectWithHttpInfo(String projectId, NewProjectGitRepositoryV1 newProjectGitRepositoryV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = addRepoToProjectRequestBuilder(projectId, newProjectGitRepositoryV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("addRepoToProject", 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);
}
}
protected HttpRequest.Builder addRepoToProjectRequestBuilder(String projectId, NewProjectGitRepositoryV1 newProjectGitRepositoryV1) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling addRepoToProject");
}
// verify the required parameter 'newProjectGitRepositoryV1' is set
if (newProjectGitRepositoryV1 == null) {
throw new ApiException(400, "Missing the required parameter 'newProjectGitRepositoryV1' when calling addRepoToProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/repositories"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(newProjectGitRepositoryV1);
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 project by id
* Archive a project by id. Required permissions: `ArchiveProject`. *Note:* This is a beta endpoint with known limitations.
* @param projectId ID of the project to retrieve (required)
* @return DeleteEnvelopeV1
* @throws ApiException if fails to make API call
*/
public DeleteEnvelopeV1 archiveProject(String projectId) throws ApiException {
ApiResponse localVarResponse = archiveProjectWithHttpInfo(projectId);
return localVarResponse.getData();
}
/**
* Archive project by id
* Archive a project by id. Required permissions: `ArchiveProject`. *Note:* This is a beta endpoint with known limitations.
* @param projectId ID of the project to retrieve (required)
* @return ApiResponse<DeleteEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse archiveProjectWithHttpInfo(String projectId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = archiveProjectRequestBuilder(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("archiveProject", 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);
}
}
protected HttpRequest.Builder archiveProjectRequestBuilder(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 archiveProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/beta/projects/{projectId}"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Create a new project by copying an existing project and providing optional overrides.
* Create a new project by copying an existing project and providing optional overrides. Specify a git repository to link to the copied project or copy the original project's git repository for the copied project.
* @param projectId Project ID (required)
* @param copyProjectSpecV1 Information needed in order to copy a project. (required)
* @return ProjectCopyResultEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectCopyResultEnvelopeV1 copyProject(String projectId, CopyProjectSpecV1 copyProjectSpecV1) throws ApiException {
ApiResponse localVarResponse = copyProjectWithHttpInfo(projectId, copyProjectSpecV1);
return localVarResponse.getData();
}
/**
* Create a new project by copying an existing project and providing optional overrides.
* Create a new project by copying an existing project and providing optional overrides. Specify a git repository to link to the copied project or copy the original project's git repository for the copied project.
* @param projectId Project ID (required)
* @param copyProjectSpecV1 Information needed in order to copy a project. (required)
* @return ApiResponse<ProjectCopyResultEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse copyProjectWithHttpInfo(String projectId, CopyProjectSpecV1 copyProjectSpecV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = copyProjectRequestBuilder(projectId, copyProjectSpecV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("copyProject", 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);
}
}
protected HttpRequest.Builder copyProjectRequestBuilder(String projectId, CopyProjectSpecV1 copyProjectSpecV1) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling copyProject");
}
// verify the required parameter 'copyProjectSpecV1' is set
if (copyProjectSpecV1 == null) {
throw new ApiException(400, "Missing the required parameter 'copyProjectSpecV1' when calling copyProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/copy-project"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(copyProjectSpecV1);
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;
}
/**
* Create a project
* Create a project. Required permissions: `CreateProject, UseFileStorage`. *Note:* This is a beta endpoint with known limitations.
* @param newProjectV1 Project to create (required)
* @return ProjectEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectEnvelopeV1 createProject(NewProjectV1 newProjectV1) throws ApiException {
ApiResponse localVarResponse = createProjectWithHttpInfo(newProjectV1);
return localVarResponse.getData();
}
/**
* Create a project
* Create a project. Required permissions: `CreateProject, UseFileStorage`. *Note:* This is a beta endpoint with known limitations.
* @param newProjectV1 Project to create (required)
* @return ApiResponse<ProjectEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse createProjectWithHttpInfo(NewProjectV1 newProjectV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = createProjectRequestBuilder(newProjectV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("createProject", 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);
}
}
protected HttpRequest.Builder createProjectRequestBuilder(NewProjectV1 newProjectV1) throws ApiException {
// verify the required parameter 'newProjectV1' is set
if (newProjectV1 == null) {
throw new ApiException(400, "Missing the required parameter 'newProjectV1' when calling createProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/beta/projects";
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(newProjectV1);
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;
}
/**
* Delete a project goal
* Delete a project goal. Required permissions: `Edit`
* @param projectId ID of the project to delete goal from (required)
* @param goalId ID of the goal to delete (required)
* @return DeleteEnvelopeV1
* @throws ApiException if fails to make API call
*/
public DeleteEnvelopeV1 deleteProjectGoal(String projectId, String goalId) throws ApiException {
ApiResponse localVarResponse = deleteProjectGoalWithHttpInfo(projectId, goalId);
return localVarResponse.getData();
}
/**
* Delete a project goal
* Delete a project goal. Required permissions: `Edit`
* @param projectId ID of the project to delete goal from (required)
* @param goalId ID of the goal to delete (required)
* @return ApiResponse<DeleteEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteProjectGoalWithHttpInfo(String projectId, String goalId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = deleteProjectGoalRequestBuilder(projectId, goalId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("deleteProjectGoal", 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);
}
}
protected HttpRequest.Builder deleteProjectGoalRequestBuilder(String projectId, String goalId) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling deleteProjectGoal");
}
// verify the required parameter 'goalId' is set
if (goalId == null) {
throw new ApiException(400, "Missing the required parameter 'goalId' when calling deleteProjectGoal");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/goals/{goalId}"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{goalId}", ApiClient.urlEncode(goalId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get all imported git repositories in this project
* Get all imported git repositories in this project. Required permissions: `ListProject`
* @param projectId Project ID (required)
* @param offset How many Projects from the start to skip. Defaults to 0. (optional)
* @param limit Max number of Projects to fetch. Defaults to 10. (optional)
* @return PaginatedGitRepositoriesEnvelopeV1
* @throws ApiException if fails to make API call
*/
public PaginatedGitRepositoriesEnvelopeV1 getImportedRepos(String projectId, Integer offset, Integer limit) throws ApiException {
ApiResponse localVarResponse = getImportedReposWithHttpInfo(projectId, offset, limit);
return localVarResponse.getData();
}
/**
* Get all imported git repositories in this project
* Get all imported git repositories in this project. Required permissions: `ListProject`
* @param projectId Project ID (required)
* @param offset How many Projects from the start to skip. Defaults to 0. (optional)
* @param limit Max number of Projects to fetch. Defaults to 10. (optional)
* @return ApiResponse<PaginatedGitRepositoriesEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse getImportedReposWithHttpInfo(String projectId, Integer offset, Integer limit) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getImportedReposRequestBuilder(projectId, offset, limit);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getImportedRepos", 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);
}
}
protected HttpRequest.Builder getImportedReposRequestBuilder(String projectId, Integer offset, Integer limit) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling getImportedRepos");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/repositories"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "offset";
localVarQueryParams.addAll(ApiClient.parameterToPairs("offset", offset));
localVarQueryParameterBaseName = "limit";
localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit));
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 Project by Id
* Get project by id. Required permissions: `ListProject`
* @param projectId ID of the project to retrieve (required)
* @return ProjectEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectEnvelopeV1 getProjectById(String projectId) throws ApiException {
ApiResponse localVarResponse = getProjectByIdWithHttpInfo(projectId);
return localVarResponse.getData();
}
/**
* Get Project by Id
* Get project by id. Required permissions: `ListProject`
* @param projectId ID of the project to retrieve (required)
* @return ApiResponse<ProjectEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse getProjectByIdWithHttpInfo(String projectId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getProjectByIdRequestBuilder(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("getProjectById", 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);
}
}
protected HttpRequest.Builder getProjectByIdRequestBuilder(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 getProjectById");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}"
.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 goals in this project
* Get goals in this project. Required permissions: `ListProject`
* @param projectId Project ID (required)
* @return ProjectGoalsEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectGoalsEnvelopeV1 getProjectGoals(String projectId) throws ApiException {
ApiResponse localVarResponse = getProjectGoalsWithHttpInfo(projectId);
return localVarResponse.getData();
}
/**
* Get goals in this project
* Get goals in this project. Required permissions: `ListProject`
* @param projectId Project ID (required)
* @return ApiResponse<ProjectGoalsEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse getProjectGoalsWithHttpInfo(String projectId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getProjectGoalsRequestBuilder(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("getProjectGoals", 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);
}
}
protected HttpRequest.Builder getProjectGoalsRequestBuilder(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 getProjectGoals");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/goals"
.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 result settings
*
* @param projectId Project ID (required)
* @return ProjectResultsSettingsEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectResultsSettingsEnvelopeV1 getProjectResultSettings(String projectId) throws ApiException {
ApiResponse localVarResponse = getProjectResultSettingsWithHttpInfo(projectId);
return localVarResponse.getData();
}
/**
* Get project result settings
*
* @param projectId Project ID (required)
* @return ApiResponse<ProjectResultsSettingsEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse getProjectResultSettingsWithHttpInfo(String projectId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getProjectResultSettingsRequestBuilder(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("getProjectResultSettings", 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);
}
}
protected HttpRequest.Builder getProjectResultSettingsRequestBuilder(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 getProjectResultSettings");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/beta/projects/{projectId}/results-settings"
.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 Projects visible to user
* Get projects that a user can see. Required permissions: `ListProject`. *Note:* This is a beta endpoint with known limitations.
* @param offset How many Projects from the start to skip. Defaults to 0. (optional)
* @param limit Max number of Projects to fetch. Defaults to 10. (optional)
* @return PaginatedProjectsEnvelopeV1
* @throws ApiException if fails to make API call
*/
public PaginatedProjectsEnvelopeV1 getProjects(Integer offset, Integer limit) throws ApiException {
ApiResponse localVarResponse = getProjectsWithHttpInfo(offset, limit);
return localVarResponse.getData();
}
/**
* Get Projects visible to user
* Get projects that a user can see. Required permissions: `ListProject`. *Note:* This is a beta endpoint with known limitations.
* @param offset How many Projects from the start to skip. Defaults to 0. (optional)
* @param limit Max number of Projects to fetch. Defaults to 10. (optional)
* @return ApiResponse<PaginatedProjectsEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse getProjectsWithHttpInfo(Integer offset, Integer limit) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getProjectsRequestBuilder(offset, limit);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getProjects", 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);
}
}
protected HttpRequest.Builder getProjectsRequestBuilder(Integer offset, Integer limit) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/beta/projects";
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "offset";
localVarQueryParams.addAll(ApiClient.parameterToPairs("offset", offset));
localVarQueryParameterBaseName = "limit";
localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit));
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;
}
/**
* Remove a collaborator from project
* Remove a collaborator from the project. Required permissions: `ManageCollaborators`
* @param projectId ID of the project to remove collaborator from (required)
* @param collaboratorId ID of the collaborator to remove (required)
* @return DeleteEnvelopeV1
* @throws ApiException if fails to make API call
*/
public DeleteEnvelopeV1 removeCollaboratorFromProject(String projectId, String collaboratorId) throws ApiException {
ApiResponse localVarResponse = removeCollaboratorFromProjectWithHttpInfo(projectId, collaboratorId);
return localVarResponse.getData();
}
/**
* Remove a collaborator from project
* Remove a collaborator from the project. Required permissions: `ManageCollaborators`
* @param projectId ID of the project to remove collaborator from (required)
* @param collaboratorId ID of the collaborator to remove (required)
* @return ApiResponse<DeleteEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse removeCollaboratorFromProjectWithHttpInfo(String projectId, String collaboratorId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = removeCollaboratorFromProjectRequestBuilder(projectId, collaboratorId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("removeCollaboratorFromProject", 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);
}
}
protected HttpRequest.Builder removeCollaboratorFromProjectRequestBuilder(String projectId, String collaboratorId) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling removeCollaboratorFromProject");
}
// verify the required parameter 'collaboratorId' is set
if (collaboratorId == null) {
throw new ApiException(400, "Missing the required parameter 'collaboratorId' when calling removeCollaboratorFromProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/collaborators/{collaboratorId}"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{collaboratorId}", ApiClient.urlEncode(collaboratorId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Remove an imported repository from project
* Remove an imported repository from the project. Required permissions: `ChangeProjectSettings`
* @param projectId ID of the project to remove goal from (required)
* @param repositoryId ID of the repository to remove (required)
* @return DeleteEnvelopeV1
* @throws ApiException if fails to make API call
*/
public DeleteEnvelopeV1 removeRepoFromProject(String projectId, String repositoryId) throws ApiException {
ApiResponse localVarResponse = removeRepoFromProjectWithHttpInfo(projectId, repositoryId);
return localVarResponse.getData();
}
/**
* Remove an imported repository from project
* Remove an imported repository from the project. Required permissions: `ChangeProjectSettings`
* @param projectId ID of the project to remove goal from (required)
* @param repositoryId ID of the repository to remove (required)
* @return ApiResponse<DeleteEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse removeRepoFromProjectWithHttpInfo(String projectId, String repositoryId) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = removeRepoFromProjectRequestBuilder(projectId, repositoryId);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("removeRepoFromProject", 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);
}
}
protected HttpRequest.Builder removeRepoFromProjectRequestBuilder(String projectId, String repositoryId) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling removeRepoFromProject");
}
// verify the required parameter 'repositoryId' is set
if (repositoryId == null) {
throw new ApiException(400, "Missing the required parameter 'repositoryId' when calling removeRepoFromProject");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/repositories/{repositoryId}"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{repositoryId}", ApiClient.urlEncode(repositoryId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Update project goal status
* Update project goal status. Required permissions: `Edit`
* @param projectId Project ID of the goal (required)
* @param goalId ID of the goal to update (required)
* @param projectGoalForUpdateV1 Project goal for update (required)
* @return ProjectGoalEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectGoalEnvelopeV1 updateProjectGoal(String projectId, String goalId, ProjectGoalForUpdateV1 projectGoalForUpdateV1) throws ApiException {
ApiResponse localVarResponse = updateProjectGoalWithHttpInfo(projectId, goalId, projectGoalForUpdateV1);
return localVarResponse.getData();
}
/**
* Update project goal status
* Update project goal status. Required permissions: `Edit`
* @param projectId Project ID of the goal (required)
* @param goalId ID of the goal to update (required)
* @param projectGoalForUpdateV1 Project goal for update (required)
* @return ApiResponse<ProjectGoalEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse updateProjectGoalWithHttpInfo(String projectId, String goalId, ProjectGoalForUpdateV1 projectGoalForUpdateV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = updateProjectGoalRequestBuilder(projectId, goalId, projectGoalForUpdateV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("updateProjectGoal", 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);
}
}
protected HttpRequest.Builder updateProjectGoalRequestBuilder(String projectId, String goalId, ProjectGoalForUpdateV1 projectGoalForUpdateV1) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling updateProjectGoal");
}
// verify the required parameter 'goalId' is set
if (goalId == null) {
throw new ApiException(400, "Missing the required parameter 'goalId' when calling updateProjectGoal");
}
// verify the required parameter 'projectGoalForUpdateV1' is set
if (projectGoalForUpdateV1 == null) {
throw new ApiException(400, "Missing the required parameter 'projectGoalForUpdateV1' when calling updateProjectGoal");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/goals/{goalId}"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{goalId}", ApiClient.urlEncode(goalId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(projectGoalForUpdateV1);
localVarRequestBuilder.method("PATCH", 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;
}
/**
* Update project result settings
*
* @param projectId Project ID (required)
* @param projectResultsSettingsV1 Project status (required)
* @return ProjectResultsSettingsEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectResultsSettingsEnvelopeV1 updateProjectResultSettings(String projectId, ProjectResultsSettingsV1 projectResultsSettingsV1) throws ApiException {
ApiResponse localVarResponse = updateProjectResultSettingsWithHttpInfo(projectId, projectResultsSettingsV1);
return localVarResponse.getData();
}
/**
* Update project result settings
*
* @param projectId Project ID (required)
* @param projectResultsSettingsV1 Project status (required)
* @return ApiResponse<ProjectResultsSettingsEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse updateProjectResultSettingsWithHttpInfo(String projectId, ProjectResultsSettingsV1 projectResultsSettingsV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = updateProjectResultSettingsRequestBuilder(projectId, projectResultsSettingsV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("updateProjectResultSettings", 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);
}
}
protected HttpRequest.Builder updateProjectResultSettingsRequestBuilder(String projectId, ProjectResultsSettingsV1 projectResultsSettingsV1) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling updateProjectResultSettings");
}
// verify the required parameter 'projectResultsSettingsV1' is set
if (projectResultsSettingsV1 == null) {
throw new ApiException(400, "Missing the required parameter 'projectResultsSettingsV1' when calling updateProjectResultSettings");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/beta/projects/{projectId}/results-settings"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(projectResultsSettingsV1);
localVarRequestBuilder.method("PUT", 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;
}
/**
* Update project status
* Update the status of a project. Required permissions: `Edit`
* @param projectId Project ID (required)
* @param projectStatusV1 Project status (required)
* @return ProjectStatusEnvelopeV1
* @throws ApiException if fails to make API call
*/
public ProjectStatusEnvelopeV1 updateProjectStatus(String projectId, ProjectStatusV1 projectStatusV1) throws ApiException {
ApiResponse localVarResponse = updateProjectStatusWithHttpInfo(projectId, projectStatusV1);
return localVarResponse.getData();
}
/**
* Update project status
* Update the status of a project. Required permissions: `Edit`
* @param projectId Project ID (required)
* @param projectStatusV1 Project status (required)
* @return ApiResponse<ProjectStatusEnvelopeV1>
* @throws ApiException if fails to make API call
*/
public ApiResponse updateProjectStatusWithHttpInfo(String projectId, ProjectStatusV1 projectStatusV1) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = updateProjectStatusRequestBuilder(projectId, projectStatusV1);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("updateProjectStatus", 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);
}
}
protected HttpRequest.Builder updateProjectStatusRequestBuilder(String projectId, ProjectStatusV1 projectStatusV1) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling updateProjectStatus");
}
// verify the required parameter 'projectStatusV1' is set
if (projectStatusV1 == null) {
throw new ApiException(400, "Missing the required parameter 'projectStatusV1' when calling updateProjectStatus");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/api/projects/v1/projects/{projectId}/status"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()));
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
localVarRequestBuilder.header("Content-Type", "application/json");
localVarRequestBuilder.header("Accept", "application/json");
try {
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(projectStatusV1);
localVarRequestBuilder.method("PUT", 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;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy