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

com.dominodatalab.pub.rest.EnvironmentsApi Maven / Gradle / Ivy

Go to download

Domino Data Lab API Client to connect to Domino web services using Java HTTP Client.

There is a newer version: 6.0.1.0
Show newest version
/*
 * 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.EnvironmentEnvelopeV1;
import com.dominodatalab.pub.model.EnvironmentRevisionEnvelopeV1;
import com.dominodatalab.pub.model.EnvironmentRevisionUpdateEnvelopeV1;
import com.dominodatalab.pub.model.FailureEnvelopeV1;
import com.dominodatalab.pub.model.GetAIGatewayAuditData400Response;
import com.dominodatalab.pub.model.NewEnvironmentRevisionV1;
import com.dominodatalab.pub.model.NewEnvironmentV1;
import com.dominodatalab.pub.model.PaginatedEnvironmentEnvelopeV1;
import com.dominodatalab.pub.model.UpdateEnvironmentRevisionV1;

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 EnvironmentsApi {
  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 EnvironmentsApi() {
    this(new ApiClient());
  }

  public EnvironmentsApi(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;
  }

  /**
   * Archive an environment
   * Archive an Environment, removing it from the list of visible environments. Required permissions: `ManageEnvironments, EditEnvironment`
   * @param environmentId Id of environment to archive (required)
   * @return EnvironmentEnvelopeV1
   * @throws ApiException if fails to make API call
   */
  public EnvironmentEnvelopeV1 archiveEnvironment(String environmentId) throws ApiException {
    ApiResponse localVarResponse = archiveEnvironmentWithHttpInfo(environmentId);
    return localVarResponse.getData();
  }

  /**
   * Archive an environment
   * Archive an Environment, removing it from the list of visible environments. Required permissions: `ManageEnvironments, EditEnvironment`
   * @param environmentId Id of environment to archive (required)
   * @return ApiResponse<EnvironmentEnvelopeV1>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse archiveEnvironmentWithHttpInfo(String environmentId) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = archiveEnvironmentRequestBuilder(environmentId);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("archiveEnvironment", 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 archiveEnvironmentRequestBuilder(String environmentId) throws ApiException {
    // verify the required parameter 'environmentId' is set
    if (environmentId == null) {
      throw new ApiException(400, "Missing the required parameter 'environmentId' when calling archiveEnvironment");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/api/environments/v1/environments/{environmentId}"
        .replace("{environmentId}", ApiClient.urlEncode(environmentId.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 an environment
   * Create an environment. Required permissions: `CreateEnvironment, EditEnvironment, UseFileStorage`. *Note:* This is a beta endpoint with known limitations.
   * @param newEnvironmentV1 Environment to create (required)
   * @return EnvironmentEnvelopeV1
   * @throws ApiException if fails to make API call
   */
  public EnvironmentEnvelopeV1 createEnvironment(NewEnvironmentV1 newEnvironmentV1) throws ApiException {
    ApiResponse localVarResponse = createEnvironmentWithHttpInfo(newEnvironmentV1);
    return localVarResponse.getData();
  }

  /**
   * Create an environment
   * Create an environment. Required permissions: `CreateEnvironment, EditEnvironment, UseFileStorage`. *Note:* This is a beta endpoint with known limitations.
   * @param newEnvironmentV1 Environment to create (required)
   * @return ApiResponse<EnvironmentEnvelopeV1>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse createEnvironmentWithHttpInfo(NewEnvironmentV1 newEnvironmentV1) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = createEnvironmentRequestBuilder(newEnvironmentV1);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("createEnvironment", 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 createEnvironmentRequestBuilder(NewEnvironmentV1 newEnvironmentV1) throws ApiException {
    // verify the required parameter 'newEnvironmentV1' is set
    if (newEnvironmentV1 == null) {
      throw new ApiException(400, "Missing the required parameter 'newEnvironmentV1' when calling createEnvironment");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/api/environments/beta/environments";

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

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

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(newEnvironmentV1);
      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 Revision of an Environment
   * Create a revision of an environment. Required permissions: `ManageEnvironments, EditEnvironment, UseFileStorage`. *Note:* This is a beta endpoint with known limitations.
   * @param environmentId Id of environment to create revision of (required)
   * @param newEnvironmentRevisionV1 Environment revision to create (required)
   * @return EnvironmentRevisionEnvelopeV1
   * @throws ApiException if fails to make API call
   */
  public EnvironmentRevisionEnvelopeV1 createEnvironmentRevision(String environmentId, NewEnvironmentRevisionV1 newEnvironmentRevisionV1) throws ApiException {
    ApiResponse localVarResponse = createEnvironmentRevisionWithHttpInfo(environmentId, newEnvironmentRevisionV1);
    return localVarResponse.getData();
  }

  /**
   * Create a Revision of an Environment
   * Create a revision of an environment. Required permissions: `ManageEnvironments, EditEnvironment, UseFileStorage`. *Note:* This is a beta endpoint with known limitations.
   * @param environmentId Id of environment to create revision of (required)
   * @param newEnvironmentRevisionV1 Environment revision to create (required)
   * @return ApiResponse<EnvironmentRevisionEnvelopeV1>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse createEnvironmentRevisionWithHttpInfo(String environmentId, NewEnvironmentRevisionV1 newEnvironmentRevisionV1) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = createEnvironmentRevisionRequestBuilder(environmentId, newEnvironmentRevisionV1);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("createEnvironmentRevision", 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 createEnvironmentRevisionRequestBuilder(String environmentId, NewEnvironmentRevisionV1 newEnvironmentRevisionV1) throws ApiException {
    // verify the required parameter 'environmentId' is set
    if (environmentId == null) {
      throw new ApiException(400, "Missing the required parameter 'environmentId' when calling createEnvironmentRevision");
    }
    // verify the required parameter 'newEnvironmentRevisionV1' is set
    if (newEnvironmentRevisionV1 == null) {
      throw new ApiException(400, "Missing the required parameter 'newEnvironmentRevisionV1' when calling createEnvironmentRevision");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/api/environments/beta/environments/{environmentId}/revisions"
        .replace("{environmentId}", ApiClient.urlEncode(environmentId.toString()));

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

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

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(newEnvironmentRevisionV1);
      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;
  }
  /**
   * Get an environment
   * Get an Environment by its Id. Required permissions: `ViewEnvironment`
   * @param environmentId Id of environment to retrieve (required)
   * @return EnvironmentEnvelopeV1
   * @throws ApiException if fails to make API call
   */
  public EnvironmentEnvelopeV1 getEnvironment(String environmentId) throws ApiException {
    ApiResponse localVarResponse = getEnvironmentWithHttpInfo(environmentId);
    return localVarResponse.getData();
  }

  /**
   * Get an environment
   * Get an Environment by its Id. Required permissions: `ViewEnvironment`
   * @param environmentId Id of environment to retrieve (required)
   * @return ApiResponse<EnvironmentEnvelopeV1>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getEnvironmentWithHttpInfo(String environmentId) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getEnvironmentRequestBuilder(environmentId);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("getEnvironment", 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 getEnvironmentRequestBuilder(String environmentId) throws ApiException {
    // verify the required parameter 'environmentId' is set
    if (environmentId == null) {
      throw new ApiException(400, "Missing the required parameter 'environmentId' when calling getEnvironment");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/api/environments/v1/environments/{environmentId}"
        .replace("{environmentId}", ApiClient.urlEncode(environmentId.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 Environments visible to a user
   * Get environments that a user can see. Required permissions: `None`. *Note:* This is a beta endpoint with known limitations.
   * @param offset How many Environments from the start to skip. Defaults to 0. (optional)
   * @param limit Max number of Environments to fetch. Defaults to 10. (optional)
   * @return PaginatedEnvironmentEnvelopeV1
   * @throws ApiException if fails to make API call
   */
  public PaginatedEnvironmentEnvelopeV1 getEnvironments(Integer offset, Integer limit) throws ApiException {
    ApiResponse localVarResponse = getEnvironmentsWithHttpInfo(offset, limit);
    return localVarResponse.getData();
  }

  /**
   * Get Environments visible to a user
   * Get environments that a user can see. Required permissions: `None`. *Note:* This is a beta endpoint with known limitations.
   * @param offset How many Environments from the start to skip. Defaults to 0. (optional)
   * @param limit Max number of Environments to fetch. Defaults to 10. (optional)
   * @return ApiResponse<PaginatedEnvironmentEnvelopeV1>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse getEnvironmentsWithHttpInfo(Integer offset, Integer limit) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = getEnvironmentsRequestBuilder(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("getEnvironments", 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 getEnvironmentsRequestBuilder(Integer offset, Integer limit) throws ApiException {

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/api/environments/beta/environments";

    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;
  }
  /**
   * Update the restricted revision of an environment
   * Update a revision of an environment to mark if isRestricted. Required permissions: `ClassifyEnvironments`. *Note:* This is a beta endpoint with known limitations.
   * @param environmentId Id of environment to mark restricted revision (required)
   * @param revisionId Id of environment revision to mark is restricted (required)
   * @param updateEnvironmentRevisionV1 Body of isRestricted (required)
   * @return EnvironmentRevisionUpdateEnvelopeV1
   * @throws ApiException if fails to make API call
   */
  public EnvironmentRevisionUpdateEnvelopeV1 updateEnvironmentRevisionIsRestricted(String environmentId, String revisionId, UpdateEnvironmentRevisionV1 updateEnvironmentRevisionV1) throws ApiException {
    ApiResponse localVarResponse = updateEnvironmentRevisionIsRestrictedWithHttpInfo(environmentId, revisionId, updateEnvironmentRevisionV1);
    return localVarResponse.getData();
  }

  /**
   * Update the restricted revision of an environment
   * Update a revision of an environment to mark if isRestricted. Required permissions: `ClassifyEnvironments`. *Note:* This is a beta endpoint with known limitations.
   * @param environmentId Id of environment to mark restricted revision (required)
   * @param revisionId Id of environment revision to mark is restricted (required)
   * @param updateEnvironmentRevisionV1 Body of isRestricted (required)
   * @return ApiResponse<EnvironmentRevisionUpdateEnvelopeV1>
   * @throws ApiException if fails to make API call
   */
  public ApiResponse updateEnvironmentRevisionIsRestrictedWithHttpInfo(String environmentId, String revisionId, UpdateEnvironmentRevisionV1 updateEnvironmentRevisionV1) throws ApiException {
    HttpRequest.Builder localVarRequestBuilder = updateEnvironmentRevisionIsRestrictedRequestBuilder(environmentId, revisionId, updateEnvironmentRevisionV1);
    try {
      HttpResponse localVarResponse = memberVarHttpClient.send(
          localVarRequestBuilder.build(),
          HttpResponse.BodyHandlers.ofInputStream());
      if (memberVarResponseInterceptor != null) {
        memberVarResponseInterceptor.accept(localVarResponse);
      }
      try {
        if (localVarResponse.statusCode()/ 100 != 2) {
          throw getApiException("updateEnvironmentRevisionIsRestricted", 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 updateEnvironmentRevisionIsRestrictedRequestBuilder(String environmentId, String revisionId, UpdateEnvironmentRevisionV1 updateEnvironmentRevisionV1) throws ApiException {
    // verify the required parameter 'environmentId' is set
    if (environmentId == null) {
      throw new ApiException(400, "Missing the required parameter 'environmentId' when calling updateEnvironmentRevisionIsRestricted");
    }
    // verify the required parameter 'revisionId' is set
    if (revisionId == null) {
      throw new ApiException(400, "Missing the required parameter 'revisionId' when calling updateEnvironmentRevisionIsRestricted");
    }
    // verify the required parameter 'updateEnvironmentRevisionV1' is set
    if (updateEnvironmentRevisionV1 == null) {
      throw new ApiException(400, "Missing the required parameter 'updateEnvironmentRevisionV1' when calling updateEnvironmentRevisionIsRestricted");
    }

    HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

    String localVarPath = "/api/environments/beta/environments/{environmentId}/revisions/{revisionId}"
        .replace("{environmentId}", ApiClient.urlEncode(environmentId.toString()))
        .replace("{revisionId}", ApiClient.urlEncode(revisionId.toString()));

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

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

    try {
      byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(updateEnvironmentRevisionV1);
      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;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy