response, InputStream responseBody) throws ApiException {
+ if (responseBody == null) {
+ throw new ApiException(new IOException("Response body is empty"));
+ }
+ try {
+ File file = prepareDownloadFile(response);
+ java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare the file for download from the response.
+ *
+ * @param response a {@link java.net.http.HttpResponse} object.
+ * @return a {@link java.io.File} object.
+ * @throws java.io.IOException if any.
+ */
+ private File prepareDownloadFile(HttpResponse response) throws IOException {
+ String filename = null;
+ java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition");
+ if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) {
+ // Get filename from the Content-Disposition header.
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get());
+ if (matcher.find())
+ filename = matcher.group(1);
+ }
+ File file = null;
+ if (filename != null) {
+ java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native");
+ java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename));
+ file = filePath.toFile();
+ tempDir.toFile().deleteOnExit(); // best effort cleanup
+ file.deleteOnExit(); // best effort cleanup
+ } else {
+ file = java.nio.file.Files.createTempFile("download-", "").toFile();
+ file.deleteOnExit(); // best effort cleanup
+ }
+ return file;
+ }
+
+ /**
+ * Retrieve a delivery attempt
+ * This endpoint fetches an app event delivery attempt
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param deliveryAttemptID delivery attempt id (required)
+ * @return GetDeliveryAttempt200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetDeliveryAttempt200Response getDeliveryAttempt(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID) throws ApiException {
+ return getDeliveryAttempt(projectID, eventDeliveryID, deliveryAttemptID, null);
+ }
+
+ /**
+ * Retrieve a delivery attempt
+ * This endpoint fetches an app event delivery attempt
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param deliveryAttemptID delivery attempt id (required)
+ * @param headers Optional headers to include in the request
+ * @return GetDeliveryAttempt200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetDeliveryAttempt200Response getDeliveryAttempt(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = getDeliveryAttemptWithHttpInfo(projectID, eventDeliveryID, deliveryAttemptID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Retrieve a delivery attempt
+ * This endpoint fetches an app event delivery attempt
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param deliveryAttemptID delivery attempt id (required)
+ * @return ApiResponse<GetDeliveryAttempt200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getDeliveryAttemptWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID) throws ApiException {
+ return getDeliveryAttemptWithHttpInfo(projectID, eventDeliveryID, deliveryAttemptID, null);
+ }
+
+ /**
+ * Retrieve a delivery attempt
+ * This endpoint fetches an app event delivery attempt
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param deliveryAttemptID delivery attempt id (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetDeliveryAttempt200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getDeliveryAttemptWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = getDeliveryAttemptRequestBuilder(projectID, eventDeliveryID, deliveryAttemptID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("getDeliveryAttempt", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetDeliveryAttempt200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder getDeliveryAttemptRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, @jakarta.annotation.Nonnull String deliveryAttemptID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling getDeliveryAttempt");
+ }
+ // verify the required parameter 'eventDeliveryID' is set
+ if (eventDeliveryID == null) {
+ throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling getDeliveryAttempt");
+ }
+ // verify the required parameter 'deliveryAttemptID' is set
+ if (deliveryAttemptID == null) {
+ throw new ApiException(400, "Missing the required parameter 'deliveryAttemptID' when calling getDeliveryAttempt");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}/deliveryattempts/{deliveryAttemptID}"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString()))
+ .replace("{deliveryAttemptID}", ApiClient.urlEncode(deliveryAttemptID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * List delivery attempts
+ * This endpoint fetches an app message's delivery attempts
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @return GetDeliveryAttempts200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetDeliveryAttempts200Response getDeliveryAttempts(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException {
+ return getDeliveryAttempts(projectID, eventDeliveryID, null);
+ }
+
+ /**
+ * List delivery attempts
+ * This endpoint fetches an app message's delivery attempts
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param headers Optional headers to include in the request
+ * @return GetDeliveryAttempts200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetDeliveryAttempts200Response getDeliveryAttempts(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = getDeliveryAttemptsWithHttpInfo(projectID, eventDeliveryID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * List delivery attempts
+ * This endpoint fetches an app message's delivery attempts
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @return ApiResponse<GetDeliveryAttempts200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getDeliveryAttemptsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException {
+ return getDeliveryAttemptsWithHttpInfo(projectID, eventDeliveryID, null);
+ }
+
+ /**
+ * List delivery attempts
+ * This endpoint fetches an app message's delivery attempts
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetDeliveryAttempts200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getDeliveryAttemptsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = getDeliveryAttemptsRequestBuilder(projectID, eventDeliveryID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("getDeliveryAttempts", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetDeliveryAttempts200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder getDeliveryAttemptsRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling getDeliveryAttempts");
+ }
+ // verify the required parameter 'eventDeliveryID' is set
+ if (eventDeliveryID == null) {
+ throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling getDeliveryAttempts");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}/deliveryattempts"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+}
diff --git a/src/main/java/com/getconvoy/api/EndpointsApi.java b/src/main/java/com/getconvoy/api/EndpointsApi.java
new file mode 100644
index 0000000..075b92a
--- /dev/null
+++ b/src/main/java/com/getconvoy/api/EndpointsApi.java
@@ -0,0 +1,1399 @@
+/*
+ * Convoy API Reference
+ * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification.
+ *
+ * The version of the OpenAPI document: 26.3.5
+ * Contact: support@getconvoy.io
+ *
+ * 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.getconvoy.api;
+
+import com.getconvoy.client.ApiClient;
+import com.getconvoy.client.ApiException;
+import com.getconvoy.client.ApiResponse;
+import com.getconvoy.client.Configuration;
+import com.getconvoy.client.Pair;
+
+import com.getconvoy.models.CreateEndpoint201Response;
+import com.getconvoy.models.GetEndpoints200Response;
+import com.getconvoy.models.GetProjects400Response;
+import com.getconvoy.models.ModelsCreateEndpoint;
+import com.getconvoy.models.ModelsExpireSecret;
+import com.getconvoy.models.ModelsTestOAuth2Request;
+import com.getconvoy.models.ModelsUpdateEndpoint;
+import com.getconvoy.models.TestOAuth2Connection200Response;
+
+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;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0")
+public class EndpointsApi {
+ /**
+ * Utility class for extending HttpRequest.Builder functionality.
+ */
+ private static class HttpRequestBuilderExtensions {
+ /**
+ * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers.
+ *
+ * @param builder the HttpRequest.Builder to which headers will be added
+ * @param headers a map of header names and values to add; may be null
+ * @return the same HttpRequest.Builder instance with the additional headers set
+ */
+ static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) {
+ if (headers != null) {
+ for (Map.Entry entry : headers.entrySet()) {
+ builder.header(entry.getKey(), entry.getValue());
+ }
+ }
+ return builder;
+ }
+ }
+ 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 EndpointsApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public EndpointsApi(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 {
+ InputStream responseBody = ApiClient.getResponseBody(response);
+ String body = null;
+ try {
+ body = responseBody == null ? null : new String(responseBody.readAllBytes());
+ } finally {
+ if (responseBody != null) {
+ responseBody.close();
+ }
+ }
+ 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;
+ }
+
+ /**
+ * Download file from the given response.
+ *
+ * @param response Response
+ * @return File
+ * @throws ApiException If fail to read file content from response and write to disk
+ */
+ public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException {
+ if (responseBody == null) {
+ throw new ApiException(new IOException("Response body is empty"));
+ }
+ try {
+ File file = prepareDownloadFile(response);
+ java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare the file for download from the response.
+ *
+ * @param response a {@link java.net.http.HttpResponse} object.
+ * @return a {@link java.io.File} object.
+ * @throws java.io.IOException if any.
+ */
+ private File prepareDownloadFile(HttpResponse response) throws IOException {
+ String filename = null;
+ java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition");
+ if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) {
+ // Get filename from the Content-Disposition header.
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get());
+ if (matcher.find())
+ filename = matcher.group(1);
+ }
+ File file = null;
+ if (filename != null) {
+ java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native");
+ java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename));
+ file = filePath.toFile();
+ tempDir.toFile().deleteOnExit(); // best effort cleanup
+ file.deleteOnExit(); // best effort cleanup
+ } else {
+ file = java.nio.file.Files.createTempFile("download-", "").toFile();
+ file.deleteOnExit(); // best effort cleanup
+ }
+ return file;
+ }
+
+ /**
+ * Activate endpoint
+ * Activated an inactive endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response activateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return activateEndpoint(projectID, endpointID, null);
+ }
+
+ /**
+ * Activate endpoint
+ * Activated an inactive endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response activateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = activateEndpointWithHttpInfo(projectID, endpointID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Activate endpoint
+ * Activated an inactive endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse activateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return activateEndpointWithHttpInfo(projectID, endpointID, null);
+ }
+
+ /**
+ * Activate endpoint
+ * Activated an inactive endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse activateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = activateEndpointRequestBuilder(projectID, endpointID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("activateEndpoint", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder activateEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling activateEndpoint");
+ }
+ // verify the required parameter 'endpointID' is set
+ if (endpointID == null) {
+ throw new ApiException(400, "Missing the required parameter 'endpointID' when calling activateEndpoint");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}/activate"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Create an endpoint
+ * This endpoint creates an endpoint
+ * @param projectID Project ID (required)
+ * @param modelsCreateEndpoint Endpoint Details (required)
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response createEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint) throws ApiException {
+ return createEndpoint(projectID, modelsCreateEndpoint, null);
+ }
+
+ /**
+ * Create an endpoint
+ * This endpoint creates an endpoint
+ * @param projectID Project ID (required)
+ * @param modelsCreateEndpoint Endpoint Details (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response createEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint, Map headers) throws ApiException {
+ ApiResponse localVarResponse = createEndpointWithHttpInfo(projectID, modelsCreateEndpoint, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Create an endpoint
+ * This endpoint creates an endpoint
+ * @param projectID Project ID (required)
+ * @param modelsCreateEndpoint Endpoint Details (required)
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse createEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint) throws ApiException {
+ return createEndpointWithHttpInfo(projectID, modelsCreateEndpoint, null);
+ }
+
+ /**
+ * Create an endpoint
+ * This endpoint creates an endpoint
+ * @param projectID Project ID (required)
+ * @param modelsCreateEndpoint Endpoint Details (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse createEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = createEndpointRequestBuilder(projectID, modelsCreateEndpoint, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("createEndpoint", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder createEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEndpoint modelsCreateEndpoint, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling createEndpoint");
+ }
+ // verify the required parameter 'modelsCreateEndpoint' is set
+ if (modelsCreateEndpoint == null) {
+ throw new ApiException(400, "Missing the required parameter 'modelsCreateEndpoint' when calling createEndpoint");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints"
+ .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(modelsCreateEndpoint);
+ localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Delete endpoint
+ * This endpoint deletes an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return GetProjects400Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetProjects400Response deleteEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return deleteEndpoint(projectID, endpointID, null);
+ }
+
+ /**
+ * Delete endpoint
+ * This endpoint deletes an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return GetProjects400Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetProjects400Response deleteEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = deleteEndpointWithHttpInfo(projectID, endpointID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Delete endpoint
+ * This endpoint deletes an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return ApiResponse<GetProjects400Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse deleteEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return deleteEndpointWithHttpInfo(projectID, endpointID, null);
+ }
+
+ /**
+ * Delete endpoint
+ * This endpoint deletes an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetProjects400Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse deleteEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = deleteEndpointRequestBuilder(projectID, endpointID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("deleteEndpoint", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder deleteEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling deleteEndpoint");
+ }
+ // verify the required parameter 'endpointID' is set
+ if (endpointID == null) {
+ throw new ApiException(400, "Missing the required parameter 'endpointID' when calling deleteEndpoint");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Roll endpoint secret
+ * This endpoint expires and re-generates the endpoint secret.
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsExpireSecret Expire Secret Body Parameters (required)
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response expireSecret(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret) throws ApiException {
+ return expireSecret(projectID, endpointID, modelsExpireSecret, null);
+ }
+
+ /**
+ * Roll endpoint secret
+ * This endpoint expires and re-generates the endpoint secret.
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsExpireSecret Expire Secret Body Parameters (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response expireSecret(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret, Map headers) throws ApiException {
+ ApiResponse localVarResponse = expireSecretWithHttpInfo(projectID, endpointID, modelsExpireSecret, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Roll endpoint secret
+ * This endpoint expires and re-generates the endpoint secret.
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsExpireSecret Expire Secret Body Parameters (required)
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse expireSecretWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret) throws ApiException {
+ return expireSecretWithHttpInfo(projectID, endpointID, modelsExpireSecret, null);
+ }
+
+ /**
+ * Roll endpoint secret
+ * This endpoint expires and re-generates the endpoint secret.
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsExpireSecret Expire Secret Body Parameters (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse expireSecretWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = expireSecretRequestBuilder(projectID, endpointID, modelsExpireSecret, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("expireSecret", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder expireSecretRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsExpireSecret modelsExpireSecret, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling expireSecret");
+ }
+ // verify the required parameter 'endpointID' is set
+ if (endpointID == null) {
+ throw new ApiException(400, "Missing the required parameter 'endpointID' when calling expireSecret");
+ }
+ // verify the required parameter 'modelsExpireSecret' is set
+ if (modelsExpireSecret == null) {
+ throw new ApiException(400, "Missing the required parameter 'modelsExpireSecret' when calling expireSecret");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}/expire_secret"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Content-Type", "application/json");
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ try {
+ byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsExpireSecret);
+ localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Retrieve endpoint
+ * This endpoint fetches an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response getEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return getEndpoint(projectID, endpointID, null);
+ }
+
+ /**
+ * Retrieve endpoint
+ * This endpoint fetches an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response getEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = getEndpointWithHttpInfo(projectID, endpointID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Retrieve endpoint
+ * This endpoint fetches an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return getEndpointWithHttpInfo(projectID, endpointID, null);
+ }
+
+ /**
+ * Retrieve endpoint
+ * This endpoint fetches an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = getEndpointRequestBuilder(projectID, endpointID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("getEndpoint", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder getEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEndpoint");
+ }
+ // verify the required parameter 'endpointID' is set
+ if (endpointID == null) {
+ throw new ApiException(400, "Missing the required parameter 'endpointID' when calling getEndpoint");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * List all endpoints
+ * This endpoint fetches an endpoints
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param ownerId The owner ID of the endpoint (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param q The name of the endpoint (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @return GetEndpoints200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEndpoints200Response getEndpoints(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort) throws ApiException {
+ return getEndpoints(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, null);
+ }
+
+ /**
+ * List all endpoints
+ * This endpoint fetches an endpoints
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param ownerId The owner ID of the endpoint (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param q The name of the endpoint (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param headers Optional headers to include in the request
+ * @return GetEndpoints200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEndpoints200Response getEndpoints(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException {
+ ApiResponse localVarResponse = getEndpointsWithHttpInfo(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * List all endpoints
+ * This endpoint fetches an endpoints
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param ownerId The owner ID of the endpoint (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param q The name of the endpoint (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @return ApiResponse<GetEndpoints200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEndpointsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort) throws ApiException {
+ return getEndpointsWithHttpInfo(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, null);
+ }
+
+ /**
+ * List all endpoints
+ * This endpoint fetches an endpoints
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param ownerId The owner ID of the endpoint (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param q The name of the endpoint (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetEndpoints200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEndpointsWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = getEndpointsRequestBuilder(projectID, direction, nextPageCursor, ownerId, perPage, prevPageCursor, q, sort, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("getEndpoints", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetEndpoints200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder getEndpointsRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable String ownerId, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String q, @jakarta.annotation.Nullable String sort, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEndpoints");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()));
+
+ List localVarQueryParams = new ArrayList<>();
+ StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
+ String localVarQueryParameterBaseName;
+ localVarQueryParameterBaseName = "direction";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction));
+ localVarQueryParameterBaseName = "next_page_cursor";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor));
+ localVarQueryParameterBaseName = "ownerId";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("ownerId", ownerId));
+ localVarQueryParameterBaseName = "perPage";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage));
+ localVarQueryParameterBaseName = "prev_page_cursor";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor));
+ localVarQueryParameterBaseName = "q";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("q", q));
+ localVarQueryParameterBaseName = "sort";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort));
+
+ 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);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Pause endpoint
+ * Toggles an endpoint's status between active and paused states
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response pauseEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return pauseEndpoint(projectID, endpointID, null);
+ }
+
+ /**
+ * Pause endpoint
+ * Toggles an endpoint's status between active and paused states
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response pauseEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = pauseEndpointWithHttpInfo(projectID, endpointID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Pause endpoint
+ * Toggles an endpoint's status between active and paused states
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse pauseEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID) throws ApiException {
+ return pauseEndpointWithHttpInfo(projectID, endpointID, null);
+ }
+
+ /**
+ * Pause endpoint
+ * Toggles an endpoint's status between active and paused states
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse pauseEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = pauseEndpointRequestBuilder(projectID, endpointID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("pauseEndpoint", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder pauseEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling pauseEndpoint");
+ }
+ // verify the required parameter 'endpointID' is set
+ if (endpointID == null) {
+ throw new ApiException(400, "Missing the required parameter 'endpointID' when calling pauseEndpoint");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}/pause"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Test OAuth2 connection
+ * This endpoint tests the OAuth2 connection by attempting to exchange a token
+ * @param projectID Project ID (required)
+ * @param modelsTestOAuth2Request OAuth2 Configuration (required)
+ * @return TestOAuth2Connection200Response
+ * @throws ApiException if fails to make API call
+ */
+ public TestOAuth2Connection200Response testOAuth2Connection(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request) throws ApiException {
+ return testOAuth2Connection(projectID, modelsTestOAuth2Request, null);
+ }
+
+ /**
+ * Test OAuth2 connection
+ * This endpoint tests the OAuth2 connection by attempting to exchange a token
+ * @param projectID Project ID (required)
+ * @param modelsTestOAuth2Request OAuth2 Configuration (required)
+ * @param headers Optional headers to include in the request
+ * @return TestOAuth2Connection200Response
+ * @throws ApiException if fails to make API call
+ */
+ public TestOAuth2Connection200Response testOAuth2Connection(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request, Map headers) throws ApiException {
+ ApiResponse localVarResponse = testOAuth2ConnectionWithHttpInfo(projectID, modelsTestOAuth2Request, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Test OAuth2 connection
+ * This endpoint tests the OAuth2 connection by attempting to exchange a token
+ * @param projectID Project ID (required)
+ * @param modelsTestOAuth2Request OAuth2 Configuration (required)
+ * @return ApiResponse<TestOAuth2Connection200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse testOAuth2ConnectionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request) throws ApiException {
+ return testOAuth2ConnectionWithHttpInfo(projectID, modelsTestOAuth2Request, null);
+ }
+
+ /**
+ * Test OAuth2 connection
+ * This endpoint tests the OAuth2 connection by attempting to exchange a token
+ * @param projectID Project ID (required)
+ * @param modelsTestOAuth2Request OAuth2 Configuration (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<TestOAuth2Connection200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse testOAuth2ConnectionWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = testOAuth2ConnectionRequestBuilder(projectID, modelsTestOAuth2Request, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("testOAuth2Connection", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ TestOAuth2Connection200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder testOAuth2ConnectionRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsTestOAuth2Request modelsTestOAuth2Request, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling testOAuth2Connection");
+ }
+ // verify the required parameter 'modelsTestOAuth2Request' is set
+ if (modelsTestOAuth2Request == null) {
+ throw new ApiException(400, "Missing the required parameter 'modelsTestOAuth2Request' when calling testOAuth2Connection");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints/oauth2/test"
+ .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(modelsTestOAuth2Request);
+ localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Update an endpoint
+ * This endpoint updates an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsUpdateEndpoint Endpoint Details (required)
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response updateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint) throws ApiException {
+ return updateEndpoint(projectID, endpointID, modelsUpdateEndpoint, null);
+ }
+
+ /**
+ * Update an endpoint
+ * This endpoint updates an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsUpdateEndpoint Endpoint Details (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEndpoint201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEndpoint201Response updateEndpoint(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint, Map headers) throws ApiException {
+ ApiResponse localVarResponse = updateEndpointWithHttpInfo(projectID, endpointID, modelsUpdateEndpoint, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Update an endpoint
+ * This endpoint updates an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsUpdateEndpoint Endpoint Details (required)
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse updateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint) throws ApiException {
+ return updateEndpointWithHttpInfo(projectID, endpointID, modelsUpdateEndpoint, null);
+ }
+
+ /**
+ * Update an endpoint
+ * This endpoint updates an endpoint
+ * @param projectID Project ID (required)
+ * @param endpointID Endpoint ID (required)
+ * @param modelsUpdateEndpoint Endpoint Details (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEndpoint201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse updateEndpointWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = updateEndpointRequestBuilder(projectID, endpointID, modelsUpdateEndpoint, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("updateEndpoint", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEndpoint201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder updateEndpointRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String endpointID, @jakarta.annotation.Nonnull ModelsUpdateEndpoint modelsUpdateEndpoint, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling updateEndpoint");
+ }
+ // verify the required parameter 'endpointID' is set
+ if (endpointID == null) {
+ throw new ApiException(400, "Missing the required parameter 'endpointID' when calling updateEndpoint");
+ }
+ // verify the required parameter 'modelsUpdateEndpoint' is set
+ if (modelsUpdateEndpoint == null) {
+ throw new ApiException(400, "Missing the required parameter 'modelsUpdateEndpoint' when calling updateEndpoint");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/endpoints/{endpointID}"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{endpointID}", ApiClient.urlEncode(endpointID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Content-Type", "application/json");
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ try {
+ byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsUpdateEndpoint);
+ localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+}
diff --git a/src/main/java/com/getconvoy/api/EventDeliveriesApi.java b/src/main/java/com/getconvoy/api/EventDeliveriesApi.java
new file mode 100644
index 0000000..3be0be5
--- /dev/null
+++ b/src/main/java/com/getconvoy/api/EventDeliveriesApi.java
@@ -0,0 +1,972 @@
+/*
+ * Convoy API Reference
+ * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification.
+ *
+ * The version of the OpenAPI document: 26.3.5
+ * Contact: support@getconvoy.io
+ *
+ * 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.getconvoy.api;
+
+import com.getconvoy.client.ApiClient;
+import com.getconvoy.client.ApiException;
+import com.getconvoy.client.ApiResponse;
+import com.getconvoy.client.Configuration;
+import com.getconvoy.client.Pair;
+
+import com.getconvoy.models.GetEventDeliveriesPaged200Response;
+import com.getconvoy.models.GetEventDelivery200Response;
+import com.getconvoy.models.GetProjects400Response;
+import com.getconvoy.models.ModelsIDs;
+
+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;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0")
+public class EventDeliveriesApi {
+ /**
+ * Utility class for extending HttpRequest.Builder functionality.
+ */
+ private static class HttpRequestBuilderExtensions {
+ /**
+ * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers.
+ *
+ * @param builder the HttpRequest.Builder to which headers will be added
+ * @param headers a map of header names and values to add; may be null
+ * @return the same HttpRequest.Builder instance with the additional headers set
+ */
+ static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) {
+ if (headers != null) {
+ for (Map.Entry entry : headers.entrySet()) {
+ builder.header(entry.getKey(), entry.getValue());
+ }
+ }
+ return builder;
+ }
+ }
+ 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 EventDeliveriesApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public EventDeliveriesApi(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 {
+ InputStream responseBody = ApiClient.getResponseBody(response);
+ String body = null;
+ try {
+ body = responseBody == null ? null : new String(responseBody.readAllBytes());
+ } finally {
+ if (responseBody != null) {
+ responseBody.close();
+ }
+ }
+ 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;
+ }
+
+ /**
+ * Download file from the given response.
+ *
+ * @param response Response
+ * @return File
+ * @throws ApiException If fail to read file content from response and write to disk
+ */
+ public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException {
+ if (responseBody == null) {
+ throw new ApiException(new IOException("Response body is empty"));
+ }
+ try {
+ File file = prepareDownloadFile(response);
+ java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare the file for download from the response.
+ *
+ * @param response a {@link java.net.http.HttpResponse} object.
+ * @return a {@link java.io.File} object.
+ * @throws java.io.IOException if any.
+ */
+ private File prepareDownloadFile(HttpResponse response) throws IOException {
+ String filename = null;
+ java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition");
+ if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) {
+ // Get filename from the Content-Disposition header.
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get());
+ if (matcher.find())
+ filename = matcher.group(1);
+ }
+ File file = null;
+ if (filename != null) {
+ java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native");
+ java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename));
+ file = filePath.toFile();
+ tempDir.toFile().deleteOnExit(); // best effort cleanup
+ file.deleteOnExit(); // best effort cleanup
+ } else {
+ file = java.nio.file.Files.createTempFile("download-", "").toFile();
+ file.deleteOnExit(); // best effort cleanup
+ }
+ return file;
+ }
+
+ /**
+ * Batch retry event delivery
+ * This endpoint batch retries multiple event deliveries at once.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @return GetProjects400Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetProjects400Response batchRetryEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException {
+ return batchRetryEventDelivery(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null);
+ }
+
+ /**
+ * Batch retry event delivery
+ * This endpoint batch retries multiple event deliveries at once.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @param headers Optional headers to include in the request
+ * @return GetProjects400Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetProjects400Response batchRetryEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException {
+ ApiResponse localVarResponse = batchRetryEventDeliveryWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Batch retry event delivery
+ * This endpoint batch retries multiple event deliveries at once.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @return ApiResponse<GetProjects400Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse batchRetryEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException {
+ return batchRetryEventDeliveryWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null);
+ }
+
+ /**
+ * Batch retry event delivery
+ * This endpoint batch retries multiple event deliveries at once.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetProjects400Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse batchRetryEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = batchRetryEventDeliveryRequestBuilder(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("batchRetryEventDelivery", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder batchRetryEventDeliveryRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling batchRetryEventDelivery");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/eventdeliveries/batchretry"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()));
+
+ List localVarQueryParams = new ArrayList<>();
+ StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
+ String localVarQueryParameterBaseName;
+ localVarQueryParameterBaseName = "direction";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction));
+ localVarQueryParameterBaseName = "endDate";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate));
+ localVarQueryParameterBaseName = "endpointId";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId));
+ localVarQueryParameterBaseName = "eventId";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("eventId", eventId));
+ localVarQueryParameterBaseName = "event_type";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("event_type", eventType));
+ localVarQueryParameterBaseName = "idempotencyKey";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("idempotencyKey", idempotencyKey));
+ localVarQueryParameterBaseName = "next_page_cursor";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor));
+ localVarQueryParameterBaseName = "perPage";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage));
+ localVarQueryParameterBaseName = "prev_page_cursor";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor));
+ localVarQueryParameterBaseName = "sort";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort));
+ localVarQueryParameterBaseName = "startDate";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate));
+ localVarQueryParameterBaseName = "status";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "status", status));
+ localVarQueryParameterBaseName = "subscriptionId";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("subscriptionId", subscriptionId));
+
+ 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("POST", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Force retry event delivery
+ * This endpoint enables you retry a previously successful event delivery
+ * @param projectID Project ID (required)
+ * @param modelsIDs event delivery ids (required)
+ * @return GetProjects400Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetProjects400Response forceResendEventDeliveries(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs) throws ApiException {
+ return forceResendEventDeliveries(projectID, modelsIDs, null);
+ }
+
+ /**
+ * Force retry event delivery
+ * This endpoint enables you retry a previously successful event delivery
+ * @param projectID Project ID (required)
+ * @param modelsIDs event delivery ids (required)
+ * @param headers Optional headers to include in the request
+ * @return GetProjects400Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetProjects400Response forceResendEventDeliveries(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs, Map headers) throws ApiException {
+ ApiResponse localVarResponse = forceResendEventDeliveriesWithHttpInfo(projectID, modelsIDs, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Force retry event delivery
+ * This endpoint enables you retry a previously successful event delivery
+ * @param projectID Project ID (required)
+ * @param modelsIDs event delivery ids (required)
+ * @return ApiResponse<GetProjects400Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse forceResendEventDeliveriesWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs) throws ApiException {
+ return forceResendEventDeliveriesWithHttpInfo(projectID, modelsIDs, null);
+ }
+
+ /**
+ * Force retry event delivery
+ * This endpoint enables you retry a previously successful event delivery
+ * @param projectID Project ID (required)
+ * @param modelsIDs event delivery ids (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetProjects400Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse forceResendEventDeliveriesWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = forceResendEventDeliveriesRequestBuilder(projectID, modelsIDs, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("forceResendEventDeliveries", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetProjects400Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder forceResendEventDeliveriesRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsIDs modelsIDs, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling forceResendEventDeliveries");
+ }
+ // verify the required parameter 'modelsIDs' is set
+ if (modelsIDs == null) {
+ throw new ApiException(400, "Missing the required parameter 'modelsIDs' when calling forceResendEventDeliveries");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/eventdeliveries/forceresend"
+ .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(modelsIDs);
+ localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * List all event deliveries
+ * This endpoint retrieves all event deliveries paginated.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @return GetEventDeliveriesPaged200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventDeliveriesPaged200Response getEventDeliveriesPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException {
+ return getEventDeliveriesPaged(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null);
+ }
+
+ /**
+ * List all event deliveries
+ * This endpoint retrieves all event deliveries paginated.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @param headers Optional headers to include in the request
+ * @return GetEventDeliveriesPaged200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventDeliveriesPaged200Response getEventDeliveriesPaged(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException {
+ ApiResponse localVarResponse = getEventDeliveriesPagedWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * List all event deliveries
+ * This endpoint retrieves all event deliveries paginated.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @return ApiResponse<GetEventDeliveriesPaged200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEventDeliveriesPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId) throws ApiException {
+ return getEventDeliveriesPagedWithHttpInfo(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, null);
+ }
+
+ /**
+ * List all event deliveries
+ * This endpoint retrieves all event deliveries paginated.
+ * @param projectID Project ID (required)
+ * @param direction (optional)
+ * @param endDate The end date (optional)
+ * @param endpointId A list of endpoint IDs to filter by (optional)
+ * @param eventId Event ID to filter by (optional)
+ * @param eventType EventType to filter by (optional)
+ * @param idempotencyKey IdempotencyKey to filter by (optional)
+ * @param nextPageCursor A pagination cursor to fetch the next page of a list (optional)
+ * @param perPage The number of items to return per page (optional)
+ * @param prevPageCursor A pagination cursor to fetch the previous page of a list (optional)
+ * @param sort Sort order, values are `ASC` or `DESC`, defaults to `DESC` (optional)
+ * @param startDate The start date (optional)
+ * @param status A list of event delivery statuses to filter by (optional)
+ * @param subscriptionId SubscriptionID to filter by (optional)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetEventDeliveriesPaged200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEventDeliveriesPagedWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = getEventDeliveriesPagedRequestBuilder(projectID, direction, endDate, endpointId, eventId, eventType, idempotencyKey, nextPageCursor, perPage, prevPageCursor, sort, startDate, status, subscriptionId, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("getEventDeliveriesPaged", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetEventDeliveriesPaged200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder getEventDeliveriesPagedRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable String direction, @jakarta.annotation.Nullable String endDate, @jakarta.annotation.Nullable List endpointId, @jakarta.annotation.Nullable String eventId, @jakarta.annotation.Nullable String eventType, @jakarta.annotation.Nullable String idempotencyKey, @jakarta.annotation.Nullable String nextPageCursor, @jakarta.annotation.Nullable Integer perPage, @jakarta.annotation.Nullable String prevPageCursor, @jakarta.annotation.Nullable String sort, @jakarta.annotation.Nullable String startDate, @jakarta.annotation.Nullable List status, @jakarta.annotation.Nullable String subscriptionId, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEventDeliveriesPaged");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/eventdeliveries"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()));
+
+ List localVarQueryParams = new ArrayList<>();
+ StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
+ String localVarQueryParameterBaseName;
+ localVarQueryParameterBaseName = "direction";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("direction", direction));
+ localVarQueryParameterBaseName = "endDate";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("endDate", endDate));
+ localVarQueryParameterBaseName = "endpointId";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "endpointId", endpointId));
+ localVarQueryParameterBaseName = "eventId";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("eventId", eventId));
+ localVarQueryParameterBaseName = "event_type";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("event_type", eventType));
+ localVarQueryParameterBaseName = "idempotencyKey";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("idempotencyKey", idempotencyKey));
+ localVarQueryParameterBaseName = "next_page_cursor";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("next_page_cursor", nextPageCursor));
+ localVarQueryParameterBaseName = "perPage";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("perPage", perPage));
+ localVarQueryParameterBaseName = "prev_page_cursor";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("prev_page_cursor", prevPageCursor));
+ localVarQueryParameterBaseName = "sort";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("sort", sort));
+ localVarQueryParameterBaseName = "startDate";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("startDate", startDate));
+ localVarQueryParameterBaseName = "status";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "status", status));
+ localVarQueryParameterBaseName = "subscriptionId";
+ localVarQueryParams.addAll(ApiClient.parameterToPairs("subscriptionId", subscriptionId));
+
+ 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);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Retrieve an event delivery
+ * This endpoint fetches an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @return GetEventDelivery200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventDelivery200Response getEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException {
+ return getEventDelivery(projectID, eventDeliveryID, null);
+ }
+
+ /**
+ * Retrieve an event delivery
+ * This endpoint fetches an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param headers Optional headers to include in the request
+ * @return GetEventDelivery200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventDelivery200Response getEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = getEventDeliveryWithHttpInfo(projectID, eventDeliveryID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Retrieve an event delivery
+ * This endpoint fetches an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @return ApiResponse<GetEventDelivery200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException {
+ return getEventDeliveryWithHttpInfo(projectID, eventDeliveryID, null);
+ }
+
+ /**
+ * Retrieve an event delivery
+ * This endpoint fetches an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetEventDelivery200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = getEventDeliveryRequestBuilder(projectID, eventDeliveryID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("getEventDelivery", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetEventDelivery200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder getEventDeliveryRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEventDelivery");
+ }
+ // verify the required parameter 'eventDeliveryID' is set
+ if (eventDeliveryID == null) {
+ throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling getEventDelivery");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Retry event delivery
+ * This endpoint retries an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @return GetEventDelivery200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventDelivery200Response resendEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException {
+ return resendEventDelivery(projectID, eventDeliveryID, null);
+ }
+
+ /**
+ * Retry event delivery
+ * This endpoint retries an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param headers Optional headers to include in the request
+ * @return GetEventDelivery200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventDelivery200Response resendEventDelivery(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = resendEventDeliveryWithHttpInfo(projectID, eventDeliveryID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Retry event delivery
+ * This endpoint retries an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @return ApiResponse<GetEventDelivery200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse resendEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID) throws ApiException {
+ return resendEventDeliveryWithHttpInfo(projectID, eventDeliveryID, null);
+ }
+
+ /**
+ * Retry event delivery
+ * This endpoint retries an event delivery.
+ * @param projectID Project ID (required)
+ * @param eventDeliveryID event delivery id (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetEventDelivery200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse resendEventDeliveryWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = resendEventDeliveryRequestBuilder(projectID, eventDeliveryID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("resendEventDelivery", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetEventDelivery200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder resendEventDeliveryRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventDeliveryID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling resendEventDelivery");
+ }
+ // verify the required parameter 'eventDeliveryID' is set
+ if (eventDeliveryID == null) {
+ throw new ApiException(400, "Missing the required parameter 'eventDeliveryID' when calling resendEventDelivery");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/eventdeliveries/{eventDeliveryID}/resend"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{eventDeliveryID}", ApiClient.urlEncode(eventDeliveryID.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+}
diff --git a/src/main/java/com/getconvoy/api/EventTypesApi.java b/src/main/java/com/getconvoy/api/EventTypesApi.java
new file mode 100644
index 0000000..ae1f5cc
--- /dev/null
+++ b/src/main/java/com/getconvoy/api/EventTypesApi.java
@@ -0,0 +1,820 @@
+/*
+ * Convoy API Reference
+ * Convoy is a fast and secure webhooks proxy. This document contains datastore's API specification.
+ *
+ * The version of the OpenAPI document: 26.3.5
+ * Contact: support@getconvoy.io
+ *
+ * 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.getconvoy.api;
+
+import com.getconvoy.client.ApiClient;
+import com.getconvoy.client.ApiException;
+import com.getconvoy.client.ApiResponse;
+import com.getconvoy.client.Configuration;
+import com.getconvoy.client.Pair;
+
+import com.getconvoy.models.CreateEventType201Response;
+import com.getconvoy.models.GetEventTypes200Response;
+import com.getconvoy.models.GetProjects400Response;
+import com.getconvoy.models.ModelsCreateEventType;
+import com.getconvoy.models.ModelsImportOpenAPISpec;
+import com.getconvoy.models.ModelsUpdateEventType;
+
+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;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0")
+public class EventTypesApi {
+ /**
+ * Utility class for extending HttpRequest.Builder functionality.
+ */
+ private static class HttpRequestBuilderExtensions {
+ /**
+ * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers.
+ *
+ * @param builder the HttpRequest.Builder to which headers will be added
+ * @param headers a map of header names and values to add; may be null
+ * @return the same HttpRequest.Builder instance with the additional headers set
+ */
+ static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) {
+ if (headers != null) {
+ for (Map.Entry entry : headers.entrySet()) {
+ builder.header(entry.getKey(), entry.getValue());
+ }
+ }
+ return builder;
+ }
+ }
+ 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 EventTypesApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public EventTypesApi(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 {
+ InputStream responseBody = ApiClient.getResponseBody(response);
+ String body = null;
+ try {
+ body = responseBody == null ? null : new String(responseBody.readAllBytes());
+ } finally {
+ if (responseBody != null) {
+ responseBody.close();
+ }
+ }
+ 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;
+ }
+
+ /**
+ * Download file from the given response.
+ *
+ * @param response Response
+ * @return File
+ * @throws ApiException If fail to read file content from response and write to disk
+ */
+ public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException {
+ if (responseBody == null) {
+ throw new ApiException(new IOException("Response body is empty"));
+ }
+ try {
+ File file = prepareDownloadFile(response);
+ java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare the file for download from the response.
+ *
+ * @param response a {@link java.net.http.HttpResponse} object.
+ * @return a {@link java.io.File} object.
+ * @throws java.io.IOException if any.
+ */
+ private File prepareDownloadFile(HttpResponse response) throws IOException {
+ String filename = null;
+ java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition");
+ if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) {
+ // Get filename from the Content-Disposition header.
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get());
+ if (matcher.find())
+ filename = matcher.group(1);
+ }
+ File file = null;
+ if (filename != null) {
+ java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native");
+ java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename));
+ file = filePath.toFile();
+ tempDir.toFile().deleteOnExit(); // best effort cleanup
+ file.deleteOnExit(); // best effort cleanup
+ } else {
+ file = java.nio.file.Files.createTempFile("download-", "").toFile();
+ file.deleteOnExit(); // best effort cleanup
+ }
+ return file;
+ }
+
+ /**
+ * Create an event type
+ * This endpoint creates an event type
+ * @param projectID Project ID (required)
+ * @param modelsCreateEventType Event Type Details (required)
+ * @return CreateEventType201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEventType201Response createEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType) throws ApiException {
+ return createEventType(projectID, modelsCreateEventType, null);
+ }
+
+ /**
+ * Create an event type
+ * This endpoint creates an event type
+ * @param projectID Project ID (required)
+ * @param modelsCreateEventType Event Type Details (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEventType201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEventType201Response createEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType, Map headers) throws ApiException {
+ ApiResponse localVarResponse = createEventTypeWithHttpInfo(projectID, modelsCreateEventType, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Create an event type
+ * This endpoint creates an event type
+ * @param projectID Project ID (required)
+ * @param modelsCreateEventType Event Type Details (required)
+ * @return ApiResponse<CreateEventType201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse createEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType) throws ApiException {
+ return createEventTypeWithHttpInfo(projectID, modelsCreateEventType, null);
+ }
+
+ /**
+ * Create an event type
+ * This endpoint creates an event type
+ * @param projectID Project ID (required)
+ * @param modelsCreateEventType Event Type Details (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEventType201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse createEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = createEventTypeRequestBuilder(projectID, modelsCreateEventType, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("createEventType", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEventType201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder createEventTypeRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsCreateEventType modelsCreateEventType, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling createEventType");
+ }
+ // verify the required parameter 'modelsCreateEventType' is set
+ if (modelsCreateEventType == null) {
+ throw new ApiException(400, "Missing the required parameter 'modelsCreateEventType' when calling createEventType");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/event-types"
+ .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(modelsCreateEventType);
+ localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Deprecates an event type
+ * This endpoint deprecates an event type
+ * @param projectID Project ID (required)
+ * @param eventTypeId Event Type ID (required)
+ * @return CreateEventType201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEventType201Response deprecateEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId) throws ApiException {
+ return deprecateEventType(projectID, eventTypeId, null);
+ }
+
+ /**
+ * Deprecates an event type
+ * This endpoint deprecates an event type
+ * @param projectID Project ID (required)
+ * @param eventTypeId Event Type ID (required)
+ * @param headers Optional headers to include in the request
+ * @return CreateEventType201Response
+ * @throws ApiException if fails to make API call
+ */
+ public CreateEventType201Response deprecateEventType(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, Map headers) throws ApiException {
+ ApiResponse localVarResponse = deprecateEventTypeWithHttpInfo(projectID, eventTypeId, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Deprecates an event type
+ * This endpoint deprecates an event type
+ * @param projectID Project ID (required)
+ * @param eventTypeId Event Type ID (required)
+ * @return ApiResponse<CreateEventType201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse deprecateEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId) throws ApiException {
+ return deprecateEventTypeWithHttpInfo(projectID, eventTypeId, null);
+ }
+
+ /**
+ * Deprecates an event type
+ * This endpoint deprecates an event type
+ * @param projectID Project ID (required)
+ * @param eventTypeId Event Type ID (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<CreateEventType201Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse deprecateEventTypeWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = deprecateEventTypeRequestBuilder(projectID, eventTypeId, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("deprecateEventType", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ CreateEventType201Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder deprecateEventTypeRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull String eventTypeId, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling deprecateEventType");
+ }
+ // verify the required parameter 'eventTypeId' is set
+ if (eventTypeId == null) {
+ throw new ApiException(400, "Missing the required parameter 'eventTypeId' when calling deprecateEventType");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/event-types/{eventTypeId}/deprecate"
+ .replace("{projectID}", ApiClient.urlEncode(projectID.toString()))
+ .replace("{eventTypeId}", ApiClient.urlEncode(eventTypeId.toString()));
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Accept", "application/json");
+
+ localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Retrieves a project's event types
+ * This endpoint fetches the project's event types
+ * @param projectID Project ID (required)
+ * @return GetEventTypes200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventTypes200Response getEventTypes(@jakarta.annotation.Nonnull String projectID) throws ApiException {
+ return getEventTypes(projectID, null);
+ }
+
+ /**
+ * Retrieves a project's event types
+ * This endpoint fetches the project's event types
+ * @param projectID Project ID (required)
+ * @param headers Optional headers to include in the request
+ * @return GetEventTypes200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventTypes200Response getEventTypes(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException {
+ ApiResponse localVarResponse = getEventTypesWithHttpInfo(projectID, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Retrieves a project's event types
+ * This endpoint fetches the project's event types
+ * @param projectID Project ID (required)
+ * @return ApiResponse<GetEventTypes200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEventTypesWithHttpInfo(@jakarta.annotation.Nonnull String projectID) throws ApiException {
+ return getEventTypesWithHttpInfo(projectID, null);
+ }
+
+ /**
+ * Retrieves a project's event types
+ * This endpoint fetches the project's event types
+ * @param projectID Project ID (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetEventTypes200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse getEventTypesWithHttpInfo(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = getEventTypesRequestBuilder(projectID, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("getEventTypes", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ GetEventTypes200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder getEventTypesRequestBuilder(@jakarta.annotation.Nonnull String projectID, Map headers) throws ApiException {
+ // verify the required parameter 'projectID' is set
+ if (projectID == null) {
+ throw new ApiException(400, "Missing the required parameter 'projectID' when calling getEventTypes");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/v1/projects/{projectID}/event-types"
+ .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);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+ /**
+ * Import event types from OpenAPI spec
+ * This endpoint imports event types from an OpenAPI specification
+ * @param projectID Project ID (required)
+ * @param modelsImportOpenAPISpec OpenAPI specification (required)
+ * @return GetEventTypes200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventTypes200Response importOpenApiSpec(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec) throws ApiException {
+ return importOpenApiSpec(projectID, modelsImportOpenAPISpec, null);
+ }
+
+ /**
+ * Import event types from OpenAPI spec
+ * This endpoint imports event types from an OpenAPI specification
+ * @param projectID Project ID (required)
+ * @param modelsImportOpenAPISpec OpenAPI specification (required)
+ * @param headers Optional headers to include in the request
+ * @return GetEventTypes200Response
+ * @throws ApiException if fails to make API call
+ */
+ public GetEventTypes200Response importOpenApiSpec(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec, Map headers) throws ApiException {
+ ApiResponse localVarResponse = importOpenApiSpecWithHttpInfo(projectID, modelsImportOpenAPISpec, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Import event types from OpenAPI spec
+ * This endpoint imports event types from an OpenAPI specification
+ * @param projectID Project ID (required)
+ * @param modelsImportOpenAPISpec OpenAPI specification (required)
+ * @return ApiResponse<GetEventTypes200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse importOpenApiSpecWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec) throws ApiException {
+ return importOpenApiSpecWithHttpInfo(projectID, modelsImportOpenAPISpec, null);
+ }
+
+ /**
+ * Import event types from OpenAPI spec
+ * This endpoint imports event types from an OpenAPI specification
+ * @param projectID Project ID (required)
+ * @param modelsImportOpenAPISpec OpenAPI specification (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<GetEventTypes200Response>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse importOpenApiSpecWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nonnull ModelsImportOpenAPISpec modelsImportOpenAPISpec, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = importOpenApiSpecRequestBuilder(projectID, modelsImportOpenAPISpec, headers);
+ try {
+ HttpResponse