com.dominodatalab.api.rest.LogsApi Maven / Gradle / Ivy
/*
* Domino Data Lab API v4
* This API is going to provide access to all the Domino functions available in the user interface. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key.
*
* The version of the OpenAPI document: 4.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.dominodatalab.api.rest;
import com.dominodatalab.api.invoker.ApiClient;
import com.dominodatalab.api.invoker.ApiException;
import com.dominodatalab.api.invoker.ApiResponse;
import com.dominodatalab.api.invoker.Pair;
import java.math.BigDecimal;
import com.dominodatalab.api.model.DominoApiErrorResponse;
import com.dominodatalab.api.model.DominoComputegridLogSet;
import com.dominodatalab.api.model.DominoWorkspacesApiLogSet;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import java.io.InputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.http.HttpRequest;
import java.nio.channels.Channels;
import java.nio.channels.Pipe;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.util.ArrayList;
import java.util.StringJoiner;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class LogsApi {
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 LogsApi() {
this(new ApiClient());
}
public LogsApi(ApiClient apiClient) {
memberVarHttpClient = apiClient.getHttpClient();
memberVarObjectMapper = apiClient.getObjectMapper();
memberVarBaseUri = apiClient.getBaseUri();
memberVarInterceptor = apiClient.getRequestInterceptor();
memberVarReadTimeout = apiClient.getReadTimeout();
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor();
}
protected ApiException getApiException(String operationId, HttpResponse response) throws IOException {
String body = response.body() == null ? null : new String(response.body().readAllBytes());
String message = formatExceptionMessage(operationId, response.statusCode(), body);
return new ApiException(response.statusCode(), message, response.headers(), body);
}
private String formatExceptionMessage(String operationId, int statusCode, String body) {
if (body == null || body.isEmpty()) {
body = "[no body]";
}
return operationId + " call failed with: " + statusCode + " - " + body;
}
/**
* Get the logs of a workspace
*
* @param projectId ID of the project with the workspace (required)
* @param workspaceSessionId ID of the workspace session (required)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return DominoComputegridLogSet
* @throws ApiException if fails to make API call
*/
public DominoComputegridLogSet getLogs(String projectId, String workspaceSessionId, Integer limit, Integer offset, String latestTimeNano) throws ApiException {
ApiResponse localVarResponse = getLogsWithHttpInfo(projectId, workspaceSessionId, limit, offset, latestTimeNano);
return localVarResponse.getData();
}
/**
* Get the logs of a workspace
*
* @param projectId ID of the project with the workspace (required)
* @param workspaceSessionId ID of the workspace session (required)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return ApiResponse<DominoComputegridLogSet>
* @throws ApiException if fails to make API call
*/
public ApiResponse getLogsWithHttpInfo(String projectId, String workspaceSessionId, Integer limit, Integer offset, String latestTimeNano) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getLogsRequestBuilder(projectId, workspaceSessionId, limit, offset, latestTimeNano);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getLogs", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
private HttpRequest.Builder getLogsRequestBuilder(String projectId, String workspaceSessionId, Integer limit, Integer offset, String latestTimeNano) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling getLogs");
}
// verify the required parameter 'workspaceSessionId' is set
if (workspaceSessionId == null) {
throw new ApiException(400, "Missing the required parameter 'workspaceSessionId' when calling getLogs");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/workspace/{projectId}/{workspaceSessionId}/logs"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{workspaceSessionId}", ApiClient.urlEncode(workspaceSessionId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "limit";
localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit));
localVarQueryParameterBaseName = "offset";
localVarQueryParams.addAll(ApiClient.parameterToPairs("offset", offset));
localVarQueryParameterBaseName = "latestTimeNano";
localVarQueryParams.addAll(ApiClient.parameterToPairs("latestTimeNano", latestTimeNano));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get the logs of a workspace
*
* @param projectId ID of the project with the workspace (required)
* @param workspaceSessionId ID of the workspace session (required)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return DominoComputegridLogSet
* @throws ApiException if fails to make API call
*/
public DominoComputegridLogSet getRealTimeLogs(String projectId, String workspaceSessionId, Integer limit, Integer offset, String latestTimeNano) throws ApiException {
ApiResponse localVarResponse = getRealTimeLogsWithHttpInfo(projectId, workspaceSessionId, limit, offset, latestTimeNano);
return localVarResponse.getData();
}
/**
* Get the logs of a workspace
*
* @param projectId ID of the project with the workspace (required)
* @param workspaceSessionId ID of the workspace session (required)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return ApiResponse<DominoComputegridLogSet>
* @throws ApiException if fails to make API call
*/
public ApiResponse getRealTimeLogsWithHttpInfo(String projectId, String workspaceSessionId, Integer limit, Integer offset, String latestTimeNano) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getRealTimeLogsRequestBuilder(projectId, workspaceSessionId, limit, offset, latestTimeNano);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getRealTimeLogs", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
private HttpRequest.Builder getRealTimeLogsRequestBuilder(String projectId, String workspaceSessionId, Integer limit, Integer offset, String latestTimeNano) throws ApiException {
// verify the required parameter 'projectId' is set
if (projectId == null) {
throw new ApiException(400, "Missing the required parameter 'projectId' when calling getRealTimeLogs");
}
// verify the required parameter 'workspaceSessionId' is set
if (workspaceSessionId == null) {
throw new ApiException(400, "Missing the required parameter 'workspaceSessionId' when calling getRealTimeLogs");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/workspace/{projectId}/{workspaceSessionId}/realTimeLogs"
.replace("{projectId}", ApiClient.urlEncode(projectId.toString()))
.replace("{workspaceSessionId}", ApiClient.urlEncode(workspaceSessionId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "limit";
localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit));
localVarQueryParameterBaseName = "offset";
localVarQueryParams.addAll(ApiClient.parameterToPairs("offset", offset));
localVarQueryParameterBaseName = "latestTimeNano";
localVarQueryParams.addAll(ApiClient.parameterToPairs("latestTimeNano", latestTimeNano));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get the logs of a workspace
*
* @param workspaceId ID of the workspace (required)
* @param logType Types of logs: * `console` - This is the default if the value is not provided. All logs lines displayed in the workspace's runtime environment. * `stdout` - Log lines displayed in the stderr of the workspace's runtime environment. * `stderr` - Log lines displayed in the stderr of the workspace's runtime environment. * `stdoutstderr` - Interleaved stdout and stderr. * `prepareoutput` - Log lines generated by the environment preparing the workspace. (optional, default to console)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return DominoWorkspacesApiLogSet
* @throws ApiException if fails to make API call
*/
public DominoWorkspacesApiLogSet getWorkspaceLogs(String workspaceId, String logType, BigDecimal limit, BigDecimal offset, String latestTimeNano) throws ApiException {
ApiResponse localVarResponse = getWorkspaceLogsWithHttpInfo(workspaceId, logType, limit, offset, latestTimeNano);
return localVarResponse.getData();
}
/**
* Get the logs of a workspace
*
* @param workspaceId ID of the workspace (required)
* @param logType Types of logs: * `console` - This is the default if the value is not provided. All logs lines displayed in the workspace's runtime environment. * `stdout` - Log lines displayed in the stderr of the workspace's runtime environment. * `stderr` - Log lines displayed in the stderr of the workspace's runtime environment. * `stdoutstderr` - Interleaved stdout and stderr. * `prepareoutput` - Log lines generated by the environment preparing the workspace. (optional, default to console)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return ApiResponse<DominoWorkspacesApiLogSet>
* @throws ApiException if fails to make API call
*/
public ApiResponse getWorkspaceLogsWithHttpInfo(String workspaceId, String logType, BigDecimal limit, BigDecimal offset, String latestTimeNano) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getWorkspaceLogsRequestBuilder(workspaceId, logType, limit, offset, latestTimeNano);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getWorkspaceLogs", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
private HttpRequest.Builder getWorkspaceLogsRequestBuilder(String workspaceId, String logType, BigDecimal limit, BigDecimal offset, String latestTimeNano) throws ApiException {
// verify the required parameter 'workspaceId' is set
if (workspaceId == null) {
throw new ApiException(400, "Missing the required parameter 'workspaceId' when calling getWorkspaceLogs");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/workspaces/{workspaceId}/logs"
.replace("{workspaceId}", ApiClient.urlEncode(workspaceId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "logType";
localVarQueryParams.addAll(ApiClient.parameterToPairs("logType", logType));
localVarQueryParameterBaseName = "limit";
localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit));
localVarQueryParameterBaseName = "offset";
localVarQueryParams.addAll(ApiClient.parameterToPairs("offset", offset));
localVarQueryParameterBaseName = "latestTimeNano";
localVarQueryParams.addAll(ApiClient.parameterToPairs("latestTimeNano", latestTimeNano));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/**
* Get the logs of a workspace without going to s3
*
* @param workspaceId ID of the workspace (required)
* @param logType Types of logs: * `console` - This is the default if the value is not provided. All logs lines displayed in the workspace's runtime environment. * `stdout` - Log lines displayed in the stderr of the workspace's runtime environment. * `stderr` - Log lines displayed in the stderr of the workspace's runtime environment. * `stdoutstderr` - Interleaved stdout and stderr. * `prepareoutput` - Log lines generated by the environment preparing the workspace. (optional, default to console)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return DominoWorkspacesApiLogSet
* @throws ApiException if fails to make API call
*/
public DominoWorkspacesApiLogSet getWorkspaceRealTimeLogs(String workspaceId, String logType, BigDecimal limit, BigDecimal offset, String latestTimeNano) throws ApiException {
ApiResponse localVarResponse = getWorkspaceRealTimeLogsWithHttpInfo(workspaceId, logType, limit, offset, latestTimeNano);
return localVarResponse.getData();
}
/**
* Get the logs of a workspace without going to s3
*
* @param workspaceId ID of the workspace (required)
* @param logType Types of logs: * `console` - This is the default if the value is not provided. All logs lines displayed in the workspace's runtime environment. * `stdout` - Log lines displayed in the stderr of the workspace's runtime environment. * `stderr` - Log lines displayed in the stderr of the workspace's runtime environment. * `stdoutstderr` - Interleaved stdout and stderr. * `prepareoutput` - Log lines generated by the environment preparing the workspace. (optional, default to console)
* @param limit Max number of log lines to fetch. Will be overridden by the configuration's limit if this value exceeds the configuration's limit, or if this value is not provided. (optional, default to 10000)
* @param offset The index of the current body of logs to start fetching from. 0 by default and typically won't be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @param latestTimeNano The epoch time in nanoseconds to start fetching from, such as \"1543538813745986325\". \"0\" by default and will typically be used for a timestamp-based offset log fetching strategy. (optional, default to 0)
* @return ApiResponse<DominoWorkspacesApiLogSet>
* @throws ApiException if fails to make API call
*/
public ApiResponse getWorkspaceRealTimeLogsWithHttpInfo(String workspaceId, String logType, BigDecimal limit, BigDecimal offset, String latestTimeNano) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = getWorkspaceRealTimeLogsRequestBuilder(workspaceId, logType, limit, offset, latestTimeNano);
try {
HttpResponse localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("getWorkspaceRealTimeLogs", localVarResponse);
}
return new ApiResponse(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream
);
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
private HttpRequest.Builder getWorkspaceRealTimeLogsRequestBuilder(String workspaceId, String logType, BigDecimal limit, BigDecimal offset, String latestTimeNano) throws ApiException {
// verify the required parameter 'workspaceId' is set
if (workspaceId == null) {
throw new ApiException(400, "Missing the required parameter 'workspaceId' when calling getWorkspaceRealTimeLogs");
}
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/workspaces/{workspaceId}/realTimeLogs"
.replace("{workspaceId}", ApiClient.urlEncode(workspaceId.toString()));
List localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "logType";
localVarQueryParams.addAll(ApiClient.parameterToPairs("logType", logType));
localVarQueryParameterBaseName = "limit";
localVarQueryParams.addAll(ApiClient.parameterToPairs("limit", limit));
localVarQueryParameterBaseName = "offset";
localVarQueryParams.addAll(ApiClient.parameterToPairs("offset", offset));
localVarQueryParameterBaseName = "latestTimeNano";
localVarQueryParams.addAll(ApiClient.parameterToPairs("latestTimeNano", latestTimeNano));
if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "application/json");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy