index int64 | repo_id string | file_path string | content string |
|---|---|---|---|
0 | java-sources/ai/wanaku/wanaku-tool-service-sqs/0.0.7/ai/wanaku/tool | java-sources/ai/wanaku/wanaku-tool-service-sqs/0.0.7/ai/wanaku/tool/sqs/SQSDelegate.java | package ai.wanaku.tool.sqs;
import java.util.List;
import jakarta.enterprise.context.ApplicationScoped;
import ai.wanaku.api.exceptions.InvalidResponseTypeException;
import ai.wanaku.api.exceptions.NonConvertableResponseException;
import ai.wanaku.core.capabilities.tool.AbstractToolDelegate;
@ApplicationScoped
public class SQSDelegate extends AbstractToolDelegate {
@Override
protected List<String> coerceResponse(Object response) throws InvalidResponseTypeException, NonConvertableResponseException {
if (response != null) {
return List.of(response.toString());
}
throw new InvalidResponseTypeException("The response is null");
}
}
|
0 | java-sources/ai/wanaku/wanaku-tool-service-tavily/0.0.7/ai/wanaku/tool | java-sources/ai/wanaku/wanaku-tool-service-tavily/0.0.7/ai/wanaku/tool/tavily/TavilyClient.java | package ai.wanaku.tool.tavily;
import ai.wanaku.core.capabilities.config.WanakuServiceConfig;
import ai.wanaku.core.config.provider.api.ConfigResource;
import ai.wanaku.core.capabilities.common.ParsedToolInvokeRequest;
import ai.wanaku.core.exchange.ToolInvokeRequest;
import ai.wanaku.core.capabilities.tool.Client;
import ai.wanaku.core.runtime.camel.CamelQueryParameterBuilder;
import dev.langchain4j.web.search.WebSearchEngine;
import dev.langchain4j.web.search.tavily.TavilyWebSearchEngine;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.jboss.logging.Logger;
@ApplicationScoped
public class TavilyClient implements Client {
private static final Logger LOG = Logger.getLogger(TavilyClient.class);
private final ProducerTemplate producer;
private final CamelContext camelContext;
@Inject
WanakuServiceConfig config;
public TavilyClient(CamelContext camelContext) {
this.camelContext = camelContext;
this.producer = camelContext.createProducerTemplate();
}
@Override
public Object exchange(ToolInvokeRequest request, ConfigResource configResource) {
try {
String tavilyApiKey = configResource.getSecret("tavily.api.key");
WebSearchEngine tavilyWebSearchEngine = TavilyWebSearchEngine.builder()
.apiKey(tavilyApiKey)
.includeRawContent(false)
.build();
camelContext.getRegistry().bind("tavily", tavilyWebSearchEngine);
producer.start();
String baseUri = config.baseUri();
CamelQueryParameterBuilder parameterBuilder = new CamelQueryParameterBuilder(configResource);
ParsedToolInvokeRequest parsedRequest = ParsedToolInvokeRequest.parseRequest(baseUri, request, parameterBuilder::build);
return producer.requestBody(parsedRequest.uri(), parsedRequest.body());
} finally {
producer.stop();
}
}
} |
0 | java-sources/ai/wanaku/wanaku-tool-service-tavily/0.0.7/ai/wanaku/tool | java-sources/ai/wanaku/wanaku-tool-service-tavily/0.0.7/ai/wanaku/tool/tavily/TavilyDelegate.java | package ai.wanaku.tool.tavily;
import java.util.List;
import jakarta.enterprise.context.ApplicationScoped;
import ai.wanaku.api.exceptions.InvalidResponseTypeException;
import ai.wanaku.api.exceptions.NonConvertableResponseException;
import ai.wanaku.core.capabilities.tool.AbstractToolDelegate;
import java.util.stream.Collectors;
@ApplicationScoped
public class TavilyDelegate extends AbstractToolDelegate {
@SuppressWarnings("unchecked")
@Override
protected List<String> coerceResponse(Object response) throws InvalidResponseTypeException, NonConvertableResponseException {
if (response == null) {
throw new InvalidResponseTypeException("Invalid response type from the consumer: null");
}
// Here, convert the response from whatever format it is, to a String instance.
if (response instanceof String) {
return List.of(response.toString());
}
if (response instanceof List) {
List<String> responseStrings = (List<String>) response;
// Annoyingly, the component sometimes return null elements. We have to filter them
return responseStrings.stream().filter(s -> s != null && !s.isEmpty()).collect(Collectors.toList());
}
throw new InvalidResponseTypeException("Invalid response type from the consumer: " + response.getClass().getName());
}
}
|
0 | java-sources/ai/wanaku/wanaku-tool-service-telegram/0.0.7/ai/wanaku/tool | java-sources/ai/wanaku/wanaku-tool-service-telegram/0.0.7/ai/wanaku/tool/telegram/TelegramClient.java | package ai.wanaku.tool.telegram;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import ai.wanaku.core.capabilities.common.ParsedToolInvokeRequest;
import ai.wanaku.core.capabilities.config.WanakuServiceConfig;
import ai.wanaku.core.config.provider.api.ConfigResource;
import ai.wanaku.core.exchange.ToolInvokeRequest;
import ai.wanaku.core.capabilities.tool.Client;
import ai.wanaku.core.runtime.camel.CamelQueryParameterBuilder;
import org.apache.camel.ProducerTemplate;
@ApplicationScoped
public class TelegramClient implements Client {
@Inject
ProducerTemplate producer;
@Inject
WanakuServiceConfig config;
@Override
public Object exchange(ToolInvokeRequest request, ConfigResource configResource) {
CamelQueryParameterBuilder parameterBuilder = new CamelQueryParameterBuilder(configResource);
ParsedToolInvokeRequest parsedRequest =
ParsedToolInvokeRequest.parseRequest(config.baseUri(), request, parameterBuilder::build);
String message = request.getArgumentsMap().get("message");
producer.sendBody(parsedRequest.uri(), message);
return "Message sent successfully to telegram";
}
} |
0 | java-sources/ai/wanaku/wanaku-tool-service-telegram/0.0.7/ai/wanaku/tool | java-sources/ai/wanaku/wanaku-tool-service-telegram/0.0.7/ai/wanaku/tool/telegram/TelegramDelegate.java | package ai.wanaku.tool.telegram;
import java.util.List;
import ai.wanaku.core.capabilities.tool.AbstractToolDelegate;
import jakarta.enterprise.context.ApplicationScoped;
import ai.wanaku.api.exceptions.InvalidResponseTypeException;
import ai.wanaku.api.exceptions.NonConvertableResponseException;
@ApplicationScoped
public class TelegramDelegate extends AbstractToolDelegate {
@Override
protected List<String> coerceResponse(Object response) throws InvalidResponseTypeException, NonConvertableResponseException {
if (response != null) {
return List.of(response.toString());
}
// Here, convert the response from whatever format it is, to a String instance.
throw new InvalidResponseTypeException("The downstream service has not implemented the response coercion method");
}
}
|
0 | java-sources/ai/wanaku/wanaku-tool-service-yaml-route/0.0.7/ai/wanaku/tool/yaml | java-sources/ai/wanaku/wanaku-tool-service-yaml-route/0.0.7/ai/wanaku/tool/yaml/route/RouteClient.java | package ai.wanaku.tool.yaml.route;
import jakarta.enterprise.context.ApplicationScoped;
import ai.wanaku.api.exceptions.WanakuException;
import ai.wanaku.core.config.provider.api.ConfigResource;
import ai.wanaku.core.capabilities.common.ParsedToolInvokeRequest;
import ai.wanaku.core.exchange.ToolInvokeRequest;
import ai.wanaku.core.capabilities.config.WanakuServiceConfig;
import ai.wanaku.core.capabilities.tool.Client;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.spi.Resource;
import org.apache.camel.support.PluginHelper;
import org.jboss.logging.Logger;
import static ai.wanaku.core.runtime.camel.CamelQueryHelper.safeLog;
@ApplicationScoped
public class RouteClient implements Client {
private static final Logger LOG = Logger.getLogger(RouteClient.class);
private final CamelContext camelContext;
private final ProducerTemplate producer;
private final WanakuServiceConfig config;
public RouteClient(CamelContext camelContext, WanakuServiceConfig config) {
this.camelContext = camelContext;
this.producer = camelContext.createProducerTemplate();
this.config = config;
}
@Override
public Object exchange(ToolInvokeRequest request, ConfigResource configResource) throws WanakuException {
producer.start();
LOG.infof("Loading resource from URI: %s", request.getUri());
Resource resource = PluginHelper.getResourceLoader(camelContext).resolveResource(request.getUri());
try {
PluginHelper.getRoutesLoader(camelContext).loadRoutes(resource);
} catch (Exception e) {
throw new WanakuException(e);
}
ParsedToolInvokeRequest parsedRequest = ParsedToolInvokeRequest.parseRequest(request, configResource);
LOG.infof("Invoking tool at URI: %s", safeLog(parsedRequest.uri()));
return producer.requestBody(config.baseUri(), parsedRequest.body(), String.class);
}
}
|
0 | java-sources/ai/wanaku/wanaku-tool-service-yaml-route/0.0.7/ai/wanaku/tool/yaml | java-sources/ai/wanaku/wanaku-tool-service-yaml-route/0.0.7/ai/wanaku/tool/yaml/route/YamlRouteDelegate.java | package ai.wanaku.tool.yaml.route;
import jakarta.enterprise.context.ApplicationScoped;
import ai.wanaku.api.exceptions.InvalidResponseTypeException;
import ai.wanaku.core.capabilities.tool.AbstractToolDelegate;
import java.util.List;
@ApplicationScoped
public class YamlRouteDelegate extends AbstractToolDelegate {
protected List<String> coerceResponse(Object response) throws InvalidResponseTypeException {
if (response != null) {
return List.of(response.toString());
}
throw new InvalidResponseTypeException("The response is null");
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/client/Main.java | package ai.wavespeed.client;
import ai.wavespeed.openapi.client.ApiException;
import ai.wavespeed.openapi.client.model.Prediction;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) throws InterruptedException {
WaveSpeed waveSpeed = new WaveSpeed();
Map<String, Object> input = new HashMap<String, Object>();
input.put("enable_base64_output", true);
input.put("enable_safety_checker", true);
input.put("guidance_scale", 3.5);
input.put("num_images", 1);
input.put("num_inference_steps", 28);
input.put("prompt", "Girl in red dress, hilltop, white deer, rabbits, sunset, japanese anime style");
input.put("seed", -1);
input.put("size", "1024*1024");
input.put("strength", 0.8);
try {
System.out.println(input);
Prediction prediction = waveSpeed.run("wavespeed-ai/flux-dev", input);
System.out.println(prediction);
Prediction prediction2 = waveSpeed.create("wavespeed-ai/flux-dev", input);
while (prediction2.getStatus() != Prediction.StatusEnum.COMPLETED && prediction2.getStatus() != Prediction.StatusEnum.FAILED) {
Thread.sleep(2000);
System.out.println("query status: " + prediction2.getStatus());
prediction2 = waveSpeed.getPrediction(prediction2.getId());
}
System.out.println(prediction2);
} catch (ApiException e) {
throw new RuntimeException(e);
}
}
} |
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/client/Options.java | package ai.wavespeed.client;
import lombok.Builder;
@Builder
public class Options {
String webhookUrl = null;
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/client/WaveSpeed.java | package ai.wavespeed.client;
import ai.wavespeed.openapi.client.ApiException;
import ai.wavespeed.openapi.client.api.DefaultApi;
import ai.wavespeed.openapi.client.model.Prediction;
import ai.wavespeed.openapi.client.model.PredictionResponse;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
@Setter
@Getter
@Slf4j
public class WaveSpeed extends DefaultApi {
public int pollInterval = 500;
public WaveSpeed() {
super();
String apiKey = System.getenv("WAVESPEED_API_KEY");
if (apiKey == null) {
throw new RuntimeException("Not set WAVESPEED_API_KEY environment variable.");
}
getApiClient().setBearerToken(apiKey);
}
public WaveSpeed(String apiKey) {
super();
getApiClient().setBearerToken(apiKey);
}
public Prediction run(String modelId, Map<String, Object> input) throws ApiException {
return this.run(modelId, input, Options.builder().build());
}
public Prediction run(String modelId, Map<String, Object> input, Options options) throws ApiException {
PredictionResponse predictionResponse = createPredictionData(modelId, input, options.webhookUrl);
if (predictionResponse.getCode() != 200) {
throw new ApiException(String.format("Failed : Response error code : %s, message: %s"
, predictionResponse.getCode(), predictionResponse.getMessage()));
}
Prediction prediction = predictionResponse.getData();
try {
while (prediction.getStatus() != Prediction.StatusEnum.COMPLETED &&
prediction.getStatus() != Prediction.StatusEnum.FAILED) {
Thread.sleep(pollInterval);
log.debug("Polling prediction: {} status: {}", prediction.getId(), prediction.getStatus());
predictionResponse = getPredictionData(prediction.getId());
prediction = predictionResponse.getData();
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return prediction;
}
public Prediction create(String id, Map<String, Object> input) throws ApiException {
return this.create(id, input, Options.builder().build());
}
public Prediction create(String id, Map<String, Object> input, Options options) throws ApiException {
PredictionResponse predictionResponse = createPredictionData(id, input, options.webhookUrl);
if (predictionResponse.getCode() != 200) {
throw new ApiException(String.format("Failed : Response error code : %s, message: %s",
predictionResponse.getCode(), predictionResponse.getMessage()));
}
return predictionResponse.getData();
}
public Prediction getPrediction(String predictionId) throws ApiException {
PredictionResponse predictionResponse = getPredictionData(predictionId);
if (predictionResponse.getCode() != 200) {
throw new ApiException(String.format("Failed : Response error code : %s, message: %s",
predictionResponse.getCode(), predictionResponse.getMessage()));
}
return predictionResponse.getData();
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ApiCallback.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import java.io.IOException;
import java.util.Map;
import java.util.List;
/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
/**
* This is called when the API download processing.
*
* @param bytesRead bytes Read
* @param contentLength content length of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ApiClient.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import okhttp3.*;
import okhttp3.internal.http.HttpMethod;
import okhttp3.internal.tls.OkHostnameVerifier;
import okhttp3.logging.HttpLoggingInterceptor;
import okhttp3.logging.HttpLoggingInterceptor.Level;
import okio.Buffer;
import okio.BufferedSink;
import okio.Okio;
import javax.net.ssl.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.DateFormat;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import ai.wavespeed.openapi.client.auth.Authentication;
import ai.wavespeed.openapi.client.auth.HttpBasicAuth;
import ai.wavespeed.openapi.client.auth.HttpBearerAuth;
import ai.wavespeed.openapi.client.auth.ApiKeyAuth;
/**
* <p>ApiClient class.</p>
*/
public class ApiClient {
private String basePath = "https://api.wavespeed.ai/api/v2";
protected List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>(Arrays.asList(
new ServerConfiguration(
"https://api.wavespeed.ai/api/v2",
"No description provided",
new HashMap<String, ServerVariable>()
)
));
protected Integer serverIndex = 0;
protected Map<String, String> serverVariables = null;
private boolean debugging = false;
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
private String tempFolderPath = null;
private Map<String, Authentication> authentications;
private DateFormat dateFormat;
private DateFormat datetimeFormat;
private boolean lenientDatetimeFormat;
private int dateLength;
private InputStream sslCaCert;
private boolean verifyingSsl;
private KeyManager[] keyManagers;
private OkHttpClient httpClient;
private JSON json;
private HttpLoggingInterceptor loggingInterceptor;
/**
* Basic constructor for ApiClient
*/
public ApiClient() {
init();
initHttpClient();
// Setup authentications (key: authentication name, value: authentication).
authentications.put("bearerAuth", new HttpBearerAuth("bearer"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
/**
* Basic constructor with custom OkHttpClient
*
* @param client a {@link okhttp3.OkHttpClient} object
*/
public ApiClient(OkHttpClient client) {
init();
httpClient = client;
// Setup authentications (key: authentication name, value: authentication).
authentications.put("bearerAuth", new HttpBearerAuth("bearer"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
private void initHttpClient() {
initHttpClient(Collections.<Interceptor>emptyList());
}
private void initHttpClient(List<Interceptor> interceptors) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.addNetworkInterceptor(getProgressInterceptor());
for (Interceptor interceptor: interceptors) {
builder.addInterceptor(interceptor);
}
httpClient = builder.build();
}
private void init() {
verifyingSsl = true;
json = new JSON();
// Set default User-Agent.
setUserAgent("OpenAPI-Generator/0.0.1/java");
authentications = new HashMap<String, Authentication>();
}
/**
* Get base path
*
* @return Base path
*/
public String getBasePath() {
return basePath;
}
/**
* Set base path
*
* @param basePath Base path of the URL (e.g https://api.wavespeed.ai/api/v2
* @return An instance of OkHttpClient
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
this.serverIndex = null;
return this;
}
public List<ServerConfiguration> getServers() {
return servers;
}
public ApiClient setServers(List<ServerConfiguration> servers) {
this.servers = servers;
return this;
}
public Integer getServerIndex() {
return serverIndex;
}
public ApiClient setServerIndex(Integer serverIndex) {
this.serverIndex = serverIndex;
return this;
}
public Map<String, String> getServerVariables() {
return serverVariables;
}
public ApiClient setServerVariables(Map<String, String> serverVariables) {
this.serverVariables = serverVariables;
return this;
}
/**
* Get HTTP client
*
* @return An instance of OkHttpClient
*/
public OkHttpClient getHttpClient() {
return httpClient;
}
/**
* Set HTTP client, which must never be null.
*
* @param newHttpClient An instance of OkHttpClient
* @return Api Client
* @throws java.lang.NullPointerException when newHttpClient is null
*/
public ApiClient setHttpClient(OkHttpClient newHttpClient) {
this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!");
return this;
}
/**
* Get JSON
*
* @return JSON object
*/
public JSON getJSON() {
return json;
}
/**
* Set JSON
*
* @param json JSON object
* @return Api client
*/
public ApiClient setJSON(JSON json) {
this.json = json;
return this;
}
/**
* True if isVerifyingSsl flag is on
*
* @return True if isVerifySsl flag is on
*/
public boolean isVerifyingSsl() {
return verifyingSsl;
}
/**
* Configure whether to verify certificate and hostname when making https requests.
* Default to true.
* NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks.
*
* @param verifyingSsl True to verify TLS/SSL connection
* @return ApiClient
*/
public ApiClient setVerifyingSsl(boolean verifyingSsl) {
this.verifyingSsl = verifyingSsl;
applySslSettings();
return this;
}
/**
* Get SSL CA cert.
*
* @return Input stream to the SSL CA cert
*/
public InputStream getSslCaCert() {
return sslCaCert;
}
/**
* Configure the CA certificate to be trusted when making https requests.
* Use null to reset to default.
*
* @param sslCaCert input stream for SSL CA cert
* @return ApiClient
*/
public ApiClient setSslCaCert(InputStream sslCaCert) {
this.sslCaCert = sslCaCert;
applySslSettings();
return this;
}
/**
* <p>Getter for the field <code>keyManagers</code>.</p>
*
* @return an array of {@link javax.net.ssl.KeyManager} objects
*/
public KeyManager[] getKeyManagers() {
return keyManagers;
}
/**
* Configure client keys to use for authorization in an SSL session.
* Use null to reset to default.
*
* @param managers The KeyManagers to use
* @return ApiClient
*/
public ApiClient setKeyManagers(KeyManager[] managers) {
this.keyManagers = managers;
applySslSettings();
return this;
}
/**
* <p>Getter for the field <code>dateFormat</code>.</p>
*
* @return a {@link java.text.DateFormat} object
*/
public DateFormat getDateFormat() {
return dateFormat;
}
/**
* <p>Setter for the field <code>dateFormat</code>.</p>
*
* @param dateFormat a {@link java.text.DateFormat} object
* @return a {@link ai.wavespeed.openapi.client.ApiClient} object
*/
public ApiClient setDateFormat(DateFormat dateFormat) {
JSON.setDateFormat(dateFormat);
return this;
}
/**
* <p>Set SqlDateFormat.</p>
*
* @param dateFormat a {@link java.text.DateFormat} object
* @return a {@link ai.wavespeed.openapi.client.ApiClient} object
*/
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
JSON.setSqlDateFormat(dateFormat);
return this;
}
/**
* <p>Set OffsetDateTimeFormat.</p>
*
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
* @return a {@link ai.wavespeed.openapi.client.ApiClient} object
*/
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
JSON.setOffsetDateTimeFormat(dateFormat);
return this;
}
/**
* <p>Set LocalDateFormat.</p>
*
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
* @return a {@link ai.wavespeed.openapi.client.ApiClient} object
*/
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
JSON.setLocalDateFormat(dateFormat);
return this;
}
/**
* <p>Set LenientOnJson.</p>
*
* @param lenientOnJson a boolean
* @return a {@link ai.wavespeed.openapi.client.ApiClient} object
*/
public ApiClient setLenientOnJson(boolean lenientOnJson) {
JSON.setLenientOnJson(lenientOnJson);
return this;
}
/**
* Get authentications (key: authentication name, value: authentication).
*
* @return Map of authentication objects
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
}
/**
* Get authentication for the given name.
*
* @param authName The authentication name
* @return The authentication, null if not found
*/
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
/**
* Helper method to set access token for the first Bearer authentication.
* @param bearerToken Bearer token
*/
public void setBearerToken(String bearerToken) {
setBearerToken(() -> bearerToken);
}
/**
* Helper method to set the supplier of access tokens for Bearer authentication.
*
* @param tokenSupplier The supplier of bearer tokens
*/
public void setBearerToken(Supplier<String> tokenSupplier) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBearerAuth) {
((HttpBearerAuth) auth).setBearerToken(tokenSupplier);
return;
}
}
throw new RuntimeException("No Bearer authentication configured!");
}
/**
* Helper method to set username for the first HTTP basic authentication.
*
* @param username Username
*/
public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setUsername(username);
return;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
/**
* Helper method to set password for the first HTTP basic authentication.
*
* @param password Password
*/
public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setPassword(password);
return;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
/**
* Helper method to set API key value for the first API key authentication.
*
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set API key prefix for the first API key authentication.
*
* @param apiKeyPrefix API key prefix
*/
public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
return;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set access token for the first OAuth2 authentication.
*
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
throw new RuntimeException("No OAuth2 authentication configured!");
}
/**
* Helper method to set credentials for AWSV4 Signature
*
* @param accessKey Access Key
* @param secretKey Secret Key
* @param region Region
* @param service Service to access to
*/
public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) {
throw new RuntimeException("No AWS4 authentication configured!");
}
/**
* Helper method to set credentials for AWSV4 Signature
*
* @param accessKey Access Key
* @param secretKey Secret Key
* @param sessionToken Session Token
* @param region Region
* @param service Service to access to
*/
public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
throw new RuntimeException("No AWS4 authentication configured!");
}
/**
* Set the User-Agent header's value (by adding to the default header map).
*
* @param userAgent HTTP request's user agent
* @return ApiClient
*/
public ApiClient setUserAgent(String userAgent) {
addDefaultHeader("User-Agent", userAgent);
return this;
}
/**
* Add a default header.
*
* @param key The header's key
* @param value The header's value
* @return ApiClient
*/
public ApiClient addDefaultHeader(String key, String value) {
defaultHeaderMap.put(key, value);
return this;
}
/**
* Add a default cookie.
*
* @param key The cookie's key
* @param value The cookie's value
* @return ApiClient
*/
public ApiClient addDefaultCookie(String key, String value) {
defaultCookieMap.put(key, value);
return this;
}
/**
* Check that whether debugging is enabled for this API client.
*
* @return True if debugging is enabled, false otherwise.
*/
public boolean isDebugging() {
return debugging;
}
/**
* Enable/disable debugging for this API client.
*
* @param debugging To enable (true) or disable (false) debugging
* @return ApiClient
*/
public ApiClient setDebugging(boolean debugging) {
if (debugging != this.debugging) {
if (debugging) {
loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(Level.BODY);
httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build();
} else {
final OkHttpClient.Builder builder = httpClient.newBuilder();
builder.interceptors().remove(loggingInterceptor);
httpClient = builder.build();
loggingInterceptor = null;
}
}
this.debugging = debugging;
return this;
}
/**
* The path of temporary folder used to store downloaded files from endpoints
* with file response. The default value is <code>null</code>, i.e. using
* the system's default temporary folder.
*
* @see <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempFile(java.lang.String,%20java.lang.String,%20java.nio.file.attribute.FileAttribute...)">createTempFile</a>
* @return Temporary folder path
*/
public String getTempFolderPath() {
return tempFolderPath;
}
/**
* Set the temporary folder path (for downloading files)
*
* @param tempFolderPath Temporary folder path
* @return ApiClient
*/
public ApiClient setTempFolderPath(String tempFolderPath) {
this.tempFolderPath = tempFolderPath;
return this;
}
/**
* Get connection timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getConnectTimeout() {
return httpClient.connectTimeoutMillis();
}
/**
* Sets the connect timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link java.lang.Integer#MAX_VALUE}.
*
* @param connectionTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Get read timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getReadTimeout() {
return httpClient.readTimeoutMillis();
}
/**
* Sets the read timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link java.lang.Integer#MAX_VALUE}.
*
* @param readTimeout read timeout in milliseconds
* @return Api client
*/
public ApiClient setReadTimeout(int readTimeout) {
httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Get write timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getWriteTimeout() {
return httpClient.writeTimeoutMillis();
}
/**
* Sets the write timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link java.lang.Integer#MAX_VALUE}.
*
* @param writeTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setWriteTimeout(int writeTimeout) {
httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Format the given parameter object into string.
*
* @param param Parameter
* @return String representation of the parameter
*/
public String parameterToString(Object param) {
if (param == null) {
return "";
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
//Serialize to json string and remove the " enclosing characters
String jsonStr = JSON.serialize(param);
return jsonStr.substring(1, jsonStr.length() - 1);
} else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for (Object o : (Collection) param) {
if (b.length() > 0) {
b.append(",");
}
b.append(o);
}
return b.toString();
} else {
return String.valueOf(param);
}
}
/**
* Formats the specified query parameter to a list containing a single {@code Pair} object.
*
* Note that {@code value} must not be a collection.
*
* @param name The name of the parameter.
* @param value The value of the parameter.
* @return A list containing a single {@code Pair} object.
*/
public List<Pair> parameterToPair(String name, Object value) {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
return params;
}
params.add(new Pair(name, parameterToString(value)));
return params;
}
/**
* Formats the specified collection query parameters to a list of {@code Pair} objects.
*
* Note that the values of each of the returned Pair objects are percent-encoded.
*
* @param collectionFormat The collection format of the parameter.
* @param name The name of the parameter.
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}
// create the params based on the collection format
if ("multi".equals(collectionFormat)) {
for (Object item : value) {
params.add(new Pair(name, escapeString(parameterToString(item))));
}
return params;
}
// collectionFormat is assumed to be "csv" by default
String delimiter = ",";
// escape all delimiters except commas, which are URI reserved
// characters
if ("ssv".equals(collectionFormat)) {
delimiter = escapeString(" ");
} else if ("tsv".equals(collectionFormat)) {
delimiter = escapeString("\t");
} else if ("pipes".equals(collectionFormat)) {
delimiter = escapeString("|");
}
StringBuilder sb = new StringBuilder();
for (Object item : value) {
sb.append(delimiter);
sb.append(escapeString(parameterToString(item)));
}
params.add(new Pair(name, sb.substring(delimiter.length())));
return params;
}
/**
* Formats the specified free-form query parameters to a list of {@code Pair} objects.
*
* @param value The free-form query parameters.
* @return A list of {@code Pair} objects.
*/
public List<Pair> freeFormParameterToPairs(Object value) {
List<Pair> params = new ArrayList<>();
// preconditions
if (value == null || !(value instanceof Map )) {
return params;
}
@SuppressWarnings("unchecked")
final Map<String, Object> valuesMap = (Map<String, Object>) value;
for (Map.Entry<String, Object> entry : valuesMap.entrySet()) {
params.add(new Pair(entry.getKey(), parameterToString(entry.getValue())));
}
return params;
}
/**
* Formats the specified collection path parameter to a string value.
*
* @param collectionFormat The collection format of the parameter.
* @param value The value of the parameter.
* @return String representation of the parameter
*/
public String collectionPathParameterToString(String collectionFormat, Collection value) {
// create the value based on the collection format
if ("multi".equals(collectionFormat)) {
// not valid for path params
return parameterToString(value);
}
// collectionFormat is assumed to be "csv" by default
String delimiter = ",";
if ("ssv".equals(collectionFormat)) {
delimiter = " ";
} else if ("tsv".equals(collectionFormat)) {
delimiter = "\t";
} else if ("pipes".equals(collectionFormat)) {
delimiter = "|";
}
StringBuilder sb = new StringBuilder() ;
for (Object item : value) {
sb.append(delimiter);
sb.append(parameterToString(item));
}
return sb.substring(delimiter.length());
}
/**
* Sanitize filename by removing path.
* e.g. ../../sun.gif becomes sun.gif
*
* @param filename The filename to be sanitized
* @return The sanitized filename
*/
public String sanitizeFilename(String filename) {
return filename.replaceAll(".*[/\\\\]", "");
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* "* / *" is also default to JSON
* @param mime MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**
* Select the Accept header's value from the given accepts array:
* if JSON exists in the given array, use it;
* otherwise use all of them (joining into a string)
*
* @param accepts The accepts array to select from
* @return The Accept header to use. If the given array is empty,
* null will be returned (not to set the Accept header explicitly).
*/
public String selectHeaderAccept(String[] accepts) {
if (accepts.length == 0) {
return null;
}
for (String accept : accepts) {
if (isJsonMime(accept)) {
return accept;
}
}
return StringUtil.join(accepts, ",");
}
/**
* Select the Content-Type header's value from the given array:
* if JSON exists in the given array, use it;
* otherwise use the first one of the array.
*
* @param contentTypes The Content-Type array to select from
* @return The Content-Type header to use. If the given array is empty,
* returns null. If it matches "any", JSON will be used.
*/
public String selectHeaderContentType(String[] contentTypes) {
if (contentTypes.length == 0) {
return null;
}
if (contentTypes[0].equals("*/*")) {
return "application/json";
}
for (String contentType : contentTypes) {
if (isJsonMime(contentType)) {
return contentType;
}
}
return contentTypes[0];
}
/**
* Escape the given string to be used as URL query value.
*
* @param str String to be escaped
* @return Escaped string
*/
public String escapeString(String str) {
try {
return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
} catch (UnsupportedEncodingException e) {
return str;
}
}
/**
* Deserialize response body to Java object, according to the return type and
* the Content-Type response header.
*
* @param <T> Type
* @param response HTTP response
* @param returnType The type of the Java object
* @return The deserialized Java object
* @throws ai.wavespeed.openapi.client.ApiException If fail to deserialize response body, i.e. cannot read response body
* or the Content-Type of the response is not supported.
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
}
if ("byte[]".equals(returnType.toString())) {
// Handle binary response (byte array).
try {
return (T) response.body().bytes();
} catch (IOException e) {
throw new ApiException(e);
}
} else if (returnType.equals(File.class)) {
// Handle file downloading.
return (T) downloadFileFromResponse(response);
}
String respBody;
try {
if (response.body() != null)
respBody = response.body().string();
else
respBody = null;
} catch (IOException e) {
throw new ApiException(e);
}
if (respBody == null || "".equals(respBody)) {
return null;
}
String contentType = response.headers().get("Content-Type");
if (contentType == null) {
// ensuring a default content type
contentType = "application/json";
}
if (isJsonMime(contentType)) {
return JSON.deserialize(respBody, returnType);
} else if (returnType.equals(String.class)) {
// Expecting string, return the raw response body.
return (T) respBody;
} else {
throw new ApiException(
"Content type \"" + contentType + "\" is not supported for type: " + returnType,
response.code(),
response.headers().toMultimap(),
respBody);
}
}
/**
* Serialize the given Java object into request body according to the object's
* class and the request Content-Type.
*
* @param obj The Java object
* @param contentType The request Content-Type
* @return The serialized request body
* @throws ai.wavespeed.openapi.client.ApiException If fail to serialize the given object
*/
public RequestBody serialize(Object obj, String contentType) throws ApiException {
if (obj instanceof byte[]) {
// Binary (byte array) body parameter support.
return RequestBody.create((byte[]) obj, MediaType.parse(contentType));
} else if (obj instanceof File) {
// File body parameter support.
return RequestBody.create((File) obj, MediaType.parse(contentType));
} else if ("text/plain".equals(contentType) && obj instanceof String) {
return RequestBody.create((String) obj, MediaType.parse(contentType));
} else if (isJsonMime(contentType)) {
String content;
if (obj != null) {
content = JSON.serialize(obj);
} else {
content = null;
}
return RequestBody.create(content, MediaType.parse(contentType));
} else if (obj instanceof String) {
return RequestBody.create((String) obj, MediaType.parse(contentType));
} else {
throw new ApiException("Content type \"" + contentType + "\" is not supported");
}
}
/**
* Download file from the given response.
*
* @param response An instance of the Response object
* @throws ai.wavespeed.openapi.client.ApiException If fail to read file content from response and write to disk
* @return Downloaded file
*/
public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
BufferedSink sink = Okio.buffer(Okio.sink(file));
sink.writeAll(response.body().source());
sink.close();
return file;
} catch (IOException e) {
throw new ApiException(e);
}
}
/**
* Prepare file for download
*
* @param response An instance of the Response object
* @return Prepared file for the download
* @throws java.io.IOException If fail to prepare file for download
*/
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
String contentDisposition = response.header("Content-Disposition");
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find()) {
filename = sanitizeFilename(matcher.group(1));
}
}
String prefix = null;
String suffix = null;
if (filename == null) {
prefix = "download-";
suffix = "";
} else {
int pos = filename.lastIndexOf(".");
if (pos == -1) {
prefix = filename + "-";
} else {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// Files.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return Files.createTempFile(prefix, suffix).toFile();
else
return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
}
/**
* {@link #execute(Call, Type)}
*
* @param <T> Type
* @param call An instance of the Call object
* @return ApiResponse<T>
* @throws ai.wavespeed.openapi.client.ApiException If fail to execute the call
*/
public <T> ApiResponse<T> execute(Call call) throws ApiException {
return execute(call, null);
}
/**
* Execute HTTP call and deserialize the HTTP response body into the given return type.
*
* @param returnType The return type used to deserialize HTTP response body
* @param <T> The return type corresponding to (same with) returnType
* @param call Call
* @return ApiResponse object containing response status, headers and
* data, which is a Java object deserialized from response body and would be null
* when returnType is null.
* @throws ai.wavespeed.openapi.client.ApiException If fail to execute the call
*/
public <T> ApiResponse<T> execute(Call call, Type returnType) throws ApiException {
try {
Response response = call.execute();
T data = handleResponse(response, returnType);
return new ApiResponse<T>(response.code(), response.headers().toMultimap(), data);
} catch (IOException e) {
throw new ApiException(e);
}
}
/**
* {@link #executeAsync(Call, Type, ApiCallback)}
*
* @param <T> Type
* @param call An instance of the Call object
* @param callback ApiCallback<T>
*/
public <T> void executeAsync(Call call, ApiCallback<T> callback) {
executeAsync(call, null, callback);
}
/**
* Execute HTTP call asynchronously.
*
* @param <T> Type
* @param call The callback to be executed when the API call finishes
* @param returnType Return type
* @param callback ApiCallback
* @see #execute(Call, Type)
*/
@SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
callback.onFailure(new ApiException(e), 0, null);
}
@Override
public void onResponse(Call call, Response response) throws IOException {
T result;
try {
result = (T) handleResponse(response, returnType);
} catch (ApiException e) {
callback.onFailure(e, response.code(), response.headers().toMultimap());
return;
} catch (Exception e) {
callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap());
return;
}
callback.onSuccess(result, response.code(), response.headers().toMultimap());
}
});
}
/**
* Handle the given response, return the deserialized object when the response is successful.
*
* @param <T> Type
* @param response Response
* @param returnType Return type
* @return Type
* @throws ai.wavespeed.openapi.client.ApiException If the response has an unsuccessful status code or
* fail to deserialize the response body
*/
public <T> T handleResponse(Response response, Type returnType) throws ApiException {
if (response.isSuccessful()) {
if (returnType == null || response.code() == 204) {
// returning null if the returnType is not defined,
// or the status code is 204 (No Content)
if (response.body() != null) {
try {
response.body().close();
} catch (Exception e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
return null;
} else {
return deserialize(response, returnType);
}
} else {
String respBody = null;
if (response.body() != null) {
try {
respBody = response.body().string();
} catch (IOException e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody);
}
}
/**
* Build HTTP call with the given options.
*
* @param baseUrl The base URL
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param cookieParams The cookie parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
* @param callback Callback for upload/download progress
* @return The HTTP call
* @throws ai.wavespeed.openapi.client.ApiException If fail to serialize the request body object
*/
public Call buildCall(String baseUrl, String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException {
Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback);
return httpClient.newCall(request);
}
/**
* Build an HTTP request with the given options.
*
* @param baseUrl The base URL
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param cookieParams The cookie parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
* @param callback Callback for upload/download progress
* @return The HTTP request
* @throws ai.wavespeed.openapi.client.ApiException If fail to serialize the request body object
*/
public Request buildRequest(String baseUrl, String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException {
final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams);
// prepare HTTP request body
RequestBody reqBody;
String contentType = headerParams.get("Content-Type");
String contentTypePure = contentType;
if (contentTypePure != null && contentTypePure.contains(";")) {
contentTypePure = contentType.substring(0, contentType.indexOf(";"));
}
if (!HttpMethod.permitsRequestBody(method)) {
reqBody = null;
} else if ("application/x-www-form-urlencoded".equals(contentTypePure)) {
reqBody = buildRequestBodyFormEncoding(formParams);
} else if ("multipart/form-data".equals(contentTypePure)) {
reqBody = buildRequestBodyMultipart(formParams);
} else if (body == null) {
if ("DELETE".equals(method)) {
// allow calling DELETE without sending a request body
reqBody = null;
} else {
// use an empty request body (for POST, PUT and PATCH)
reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType));
}
} else {
reqBody = serialize(body, contentType);
}
List<Pair> updatedQueryParams = new ArrayList<>(queryParams);
// update parameters with authentication settings
updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url));
final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams));
processHeaderParams(headerParams, reqBuilder);
processCookieParams(cookieParams, reqBuilder);
// Associate callback with request (if not null) so interceptor can
// access it when creating ProgressResponseBody
reqBuilder.tag(callback);
Request request = null;
if (callback != null && reqBody != null) {
ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback);
request = reqBuilder.method(method, progressRequestBody).build();
} else {
request = reqBuilder.method(method, reqBody).build();
}
return request;
}
/**
* Build full URL by concatenating base path, the given sub path and query parameters.
*
* @param baseUrl The base URL
* @param path The sub path
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @return The full URL
*/
public String buildUrl(String baseUrl, String path, List<Pair> queryParams, List<Pair> collectionQueryParams) {
final StringBuilder url = new StringBuilder();
if (baseUrl != null) {
url.append(baseUrl).append(path);
} else {
String baseURL;
if (serverIndex != null) {
if (serverIndex < 0 || serverIndex >= servers.size()) {
throw new ArrayIndexOutOfBoundsException(String.format(
"Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size()
));
}
baseURL = servers.get(serverIndex).URL(serverVariables);
} else {
baseURL = basePath;
}
url.append(baseURL).append(path);
}
if (queryParams != null && !queryParams.isEmpty()) {
// support (constant) query string in `path`, e.g. "/posts?draft=1"
String prefix = path.contains("?") ? "&" : "?";
for (Pair param : queryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
prefix = null;
} else {
url.append("&");
}
String value = parameterToString(param.getValue());
url.append(escapeString(param.getName())).append("=").append(escapeString(value));
}
}
}
if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
String prefix = url.toString().contains("?") ? "&" : "?";
for (Pair param : collectionQueryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
prefix = null;
} else {
url.append("&");
}
String value = parameterToString(param.getValue());
// collection query parameter value already escaped as part of parameterToPairs
url.append(escapeString(param.getName())).append("=").append(value);
}
}
}
return url.toString();
}
/**
* Set header parameters to the request builder, including default headers.
*
* @param headerParams Header parameters in the form of Map
* @param reqBuilder Request.Builder
*/
public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : headerParams.entrySet()) {
reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
}
for (Entry<String, String> header : defaultHeaderMap.entrySet()) {
if (!headerParams.containsKey(header.getKey())) {
reqBuilder.header(header.getKey(), parameterToString(header.getValue()));
}
}
}
/**
* Set cookie parameters to the request builder, including default cookies.
*
* @param cookieParams Cookie parameters in the form of Map
* @param reqBuilder Request.Builder
*/
public void processCookieParams(Map<String, String> cookieParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : cookieParams.entrySet()) {
reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
}
for (Entry<String, String> param : defaultCookieMap.entrySet()) {
if (!cookieParams.containsKey(param.getKey())) {
reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
}
}
}
/**
* Update query and header parameters based on authentication settings.
*
* @param authNames The authentications to apply
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
* @param payload HTTP request body
* @param method HTTP method
* @param uri URI
* @throws ai.wavespeed.openapi.client.ApiException If fails to update the parameters
*/
public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams,
Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) {
throw new RuntimeException("Authentication undefined: " + authName);
}
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
/**
* Build a form-encoding request body with the given form parameters.
*
* @param formParams Form parameters in the form of Map
* @return RequestBody
*/
public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams) {
okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder();
for (Entry<String, Object> param : formParams.entrySet()) {
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
}
return formBuilder.build();
}
/**
* Build a multipart (file uploading) request body with the given form parameters,
* which could contain text fields and file fields.
*
* @param formParams Form parameters in the form of Map
* @return RequestBody
*/
public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
for (Entry<String, Object> param : formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (File) param.getValue();
addPartToMultiPartBuilder(mpBuilder, param.getKey(), file);
} else if (param.getValue() instanceof List) {
List list = (List) param.getValue();
for (Object item: list) {
if (item instanceof File) {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item);
} else {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue());
}
}
} else {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue());
}
}
return mpBuilder.build();
}
/**
* Guess Content-Type header from the given file (defaults to "application/octet-stream").
*
* @param file The given file
* @return The guessed Content-Type
*/
public String guessContentTypeFromFile(File file) {
String contentType = URLConnection.guessContentTypeFromName(file.getName());
if (contentType == null) {
return "application/octet-stream";
} else {
return contentType;
}
}
/**
* Add a Content-Disposition Header for the given key and file to the MultipartBody Builder.
*
* @param mpBuilder MultipartBody.Builder
* @param key The key of the Header element
* @param file The file to add to the Header
*/
private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) {
Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\"");
MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType));
}
/**
* Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder.
*
* @param mpBuilder MultipartBody.Builder
* @param key The key of the Header element
* @param obj The complex object to add to the Header
*/
private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) {
RequestBody requestBody;
if (obj instanceof String) {
requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain"));
} else {
String content;
if (obj != null) {
content = JSON.serialize(obj);
} else {
content = null;
}
requestBody = RequestBody.create(content, MediaType.parse("application/json"));
}
Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"");
mpBuilder.addPart(partHeaders, requestBody);
}
/**
* Get network interceptor to add it to the httpClient to track download progress for
* async requests.
*/
private Interceptor getProgressInterceptor() {
return new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
final Request request = chain.request();
final Response originalResponse = chain.proceed(request);
if (request.tag() instanceof ApiCallback) {
final ApiCallback callback = (ApiCallback) request.tag();
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), callback))
.build();
}
return originalResponse;
}
};
}
/**
* Apply SSL related settings to httpClient according to the current values of
* verifyingSsl and sslCaCert.
*/
private void applySslSettings() {
try {
TrustManager[] trustManagers;
HostnameVerifier hostnameVerifier;
if (!verifyingSsl) {
trustManagers = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
}
};
hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
} else {
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
if (sslCaCert == null) {
trustManagerFactory.init((KeyStore) null);
} else {
char[] password = null; // Any password will work.
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
Collection<? extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert);
if (certificates.isEmpty()) {
throw new IllegalArgumentException("expected non-empty set of trusted certificates");
}
KeyStore caKeyStore = newEmptyKeyStore(password);
int index = 0;
for (Certificate certificate : certificates) {
String certificateAlias = "ca" + (index++);
caKeyStore.setCertificateEntry(certificateAlias, certificate);
}
trustManagerFactory.init(caKeyStore);
}
trustManagers = trustManagerFactory.getTrustManagers();
hostnameVerifier = OkHostnameVerifier.INSTANCE;
}
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagers, trustManagers, new SecureRandom());
httpClient = httpClient.newBuilder()
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0])
.hostnameVerifier(hostnameVerifier)
.build();
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
}
private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException {
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, password);
return keyStore;
} catch (IOException e) {
throw new AssertionError(e);
}
}
/**
* Convert the HTTP request body to a string.
*
* @param requestBody The HTTP request object
* @return The string representation of the HTTP request body
* @throws ai.wavespeed.openapi.client.ApiException If fail to serialize the request body object into a string
*/
private String requestBodyToString(RequestBody requestBody) throws ApiException {
if (requestBody != null) {
try {
final Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
return buffer.readUtf8();
} catch (final IOException e) {
throw new ApiException(e);
}
}
// empty http request body
return "";
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ApiException.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import java.util.Map;
import java.util.List;
/**
* <p>ApiException class.</p>
*/
@SuppressWarnings("serial")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class ApiException extends Exception {
private static final long serialVersionUID = 1L;
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
private String responseBody = null;
/**
* <p>Constructor for ApiException.</p>
*/
public ApiException() {}
/**
* <p>Constructor for ApiException.</p>
*
* @param throwable a {@link java.lang.Throwable} object
*/
public ApiException(Throwable throwable) {
super(throwable);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
*/
public ApiException(String message) {
super(message);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
super(message, throwable);
this.code = code;
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
this(message, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param message the error message
* @param throwable a {@link java.lang.Throwable} object
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
*/
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
this(message, throwable, code, responseHeaders, null);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody);
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message a {@link java.lang.String} object
*/
public ApiException(int code, String message) {
super(message);
this.code = code;
}
/**
* <p>Constructor for ApiException.</p>
*
* @param code HTTP status code
* @param message the error message
* @param responseHeaders a {@link java.util.Map} of HTTP response headers
* @param responseBody the response body
*/
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
this(code, message);
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* Get the HTTP status code.
*
* @return HTTP status code
*/
public int getCode() {
return code;
}
/**
* Get the HTTP response headers.
*
* @return A map of list of string
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
}
/**
* Get the HTTP response body.
*
* @return Response body in the form of string
*/
public String getResponseBody() {
return responseBody;
}
/**
* Get the exception message including HTTP response data.
*
* @return The exception message
*/
public String getMessage() {
return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s",
super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders());
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ApiResponse.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import java.util.List;
import java.util.Map;
/**
* API response returned by API call.
*/
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
final private T data;
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
}
/**
* <p>Constructor for ApiResponse.</p>
*
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
this.headers = headers;
this.data = data;
}
/**
* <p>Get the <code>status code</code>.</p>
*
* @return the status code
*/
public int getStatusCode() {
return statusCode;
}
/**
* <p>Get the <code>headers</code>.</p>
*
* @return a {@link java.util.Map} of headers
*/
public Map<String, List<String>> getHeaders() {
return headers;
}
/**
* <p>Get the <code>data</code>.</p>
*
* @return the data
*/
public T getData() {
return data;
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/Configuration.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class Configuration {
public static final String VERSION = "0.0.1";
private static ApiClient defaultApiClient = new ApiClient();
/**
* Get the default API client, which would be used when creating API
* instances without providing an API client.
*
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
return defaultApiClient;
}
/**
* Set the default API client, which would be used when creating API
* instances without providing an API client.
*
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient = apiClient;
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/GzipRequestInterceptor.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import okhttp3.*;
import okio.Buffer;
import okio.BufferedSink;
import okio.GzipSink;
import okio.Okio;
import java.io.IOException;
/**
* Encodes request bodies using gzip.
*
* Taken from https://github.com/square/okhttp/issues/350
*/
class GzipRequestInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
return chain.proceed(originalRequest);
}
Request compressedRequest = originalRequest.newBuilder()
.header("Content-Encoding", "gzip")
.method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
.build();
return chain.proceed(compressedRequest);
}
private RequestBody forceContentLength(final RequestBody requestBody) throws IOException {
final Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
return new RequestBody() {
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() {
return buffer.size();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
sink.write(buffer.snapshot());
}
};
}
private RequestBody gzip(final RequestBody body) {
return new RequestBody() {
@Override
public MediaType contentType() {
return body.contentType();
}
@Override
public long contentLength() {
return -1; // We don't know the compressed length in advance!
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
body.writeTo(gzipSink);
gzipSink.close();
}
};
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/JSON.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
import io.gsonfire.TypeSelector;
import okio.ByteString;
import java.io.IOException;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
/*
* A JSON utility class
*
* NOTE: in the future, this class may be converted to static, which may break
* backward-compatibility
*/
public class JSON {
private static Gson gson;
private static boolean isLenientOnJson = false;
private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
@SuppressWarnings("unchecked")
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
}
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
}
return element.getAsString();
}
/**
* Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
*
* @param classByDiscriminatorValue The map of discriminator values to Java classes.
* @param discriminatorValue The value of the OpenAPI discriminator in the input data.
* @return The Java class that implements the OpenAPI schema
*/
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}
return clazz;
}
static {
GsonBuilder gsonBuilder = createGson();
gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter);
gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
gsonBuilder.registerTypeAdapterFactory(new ai.wavespeed.openapi.client.model.CreatePredictionData400Response.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new ai.wavespeed.openapi.client.model.CreatePredictionData400ResponseData.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new ai.wavespeed.openapi.client.model.CreatePredictionData401Response.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new ai.wavespeed.openapi.client.model.CreatePredictionData500Response.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new ai.wavespeed.openapi.client.model.Prediction.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new ai.wavespeed.openapi.client.model.PredictionResponse.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new ai.wavespeed.openapi.client.model.PredictionUrls.CustomTypeAdapterFactory());
gson = gsonBuilder.create();
}
/**
* Get Gson.
*
* @return Gson
*/
public static Gson getGson() {
return gson;
}
/**
* Set Gson.
*
* @param gson Gson
*/
public static void setGson(Gson gson) {
JSON.gson = gson;
}
public static void setLenientOnJson(boolean lenientOnJson) {
isLenientOnJson = lenientOnJson;
}
/**
* Serialize the given Java object into JSON string.
*
* @param obj Object
* @return String representation of the JSON
*/
public static String serialize(Object obj) {
return gson.toJson(obj);
}
/**
* Deserialize the given JSON string to Java object.
*
* @param <T> Type
* @param body The JSON string
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public static <T> T deserialize(String body, Type returnType) {
try {
if (isLenientOnJson) {
JsonReader jsonReader = new JsonReader(new StringReader(body));
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(body, returnType);
}
} catch (JsonParseException e) {
// Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type;
if (returnType.equals(String.class)) {
return (T) body;
} else {
throw (e);
}
}
}
/**
* Gson TypeAdapter for Byte Array type
*/
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {
@Override
public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
}
}
@Override
public byte[] read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String bytesAsBase64 = in.nextString();
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
return byteString.toByteArray();
}
}
}
/**
* Gson TypeAdapter for JSR310 OffsetDateTime type
*/
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
private DateTimeFormatter formatter;
public OffsetDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}
public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, OffsetDateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public OffsetDateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
if (date.endsWith("+0000")) {
date = date.substring(0, date.length()-5) + "Z";
}
return OffsetDateTime.parse(date, formatter);
}
}
}
/**
* Gson TypeAdapter for JSR310 LocalDate type
*/
public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private DateTimeFormatter formatter;
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return LocalDate.parse(date, formatter);
}
}
}
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
}
public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
}
/**
* Gson TypeAdapter for java.sql.Date type
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
* (more efficient than SimpleDateFormat).
*/
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
private DateFormat dateFormat;
public SqlDateTypeAdapter() {}
public SqlDateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, java.sql.Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = date.toString();
}
out.value(value);
}
}
@Override
public java.sql.Date read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return new java.sql.Date(dateFormat.parse(date).getTime());
}
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
}
}
/**
* Gson TypeAdapter for java.util.Date type
* If the dateFormat is null, ISO8601Utils will be used.
*/
public static class DateTypeAdapter extends TypeAdapter<Date> {
private DateFormat dateFormat;
public DateTypeAdapter() {}
public DateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = ISO8601Utils.format(date, true);
}
out.value(value);
}
}
@Override
public Date read(JsonReader in) throws IOException {
try {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return dateFormat.parse(date);
}
return ISO8601Utils.parse(date, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
} catch (IllegalArgumentException e) {
throw new JsonParseException(e);
}
}
}
public static void setDateFormat(DateFormat dateFormat) {
dateTypeAdapter.setFormat(dateFormat);
}
public static void setSqlDateFormat(DateFormat dateFormat) {
sqlDateTypeAdapter.setFormat(dateFormat);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/Pair.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class Pair {
private String name = "";
private String value = "";
public Pair (String name, String value) {
setName(name);
setValue(value);
}
private void setName(String name) {
if (!isValidString(name)) {
return;
}
this.name = name;
}
private void setValue(String value) {
if (!isValidString(value)) {
return;
}
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private boolean isValidString(String arg) {
if (arg == null) {
return false;
}
return true;
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ProgressRequestBody.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;
public class ProgressRequestBody extends RequestBody {
private final RequestBody requestBody;
private final ApiCallback callback;
public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
this.requestBody = requestBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() throws IOException {
return requestBody.contentLength();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink bufferedSink = Okio.buffer(sink(sink));
requestBody.writeTo(bufferedSink);
bufferedSink.flush();
}
private Sink sink(Sink sink) {
return new ForwardingSink(sink) {
long bytesWritten = 0L;
long contentLength = 0L;
@Override
public void write(Buffer source, long byteCount) throws IOException {
super.write(source, byteCount);
if (contentLength == 0) {
contentLength = contentLength();
}
bytesWritten += byteCount;
callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
}
};
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ProgressResponseBody.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import okhttp3.MediaType;
import okhttp3.ResponseBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;
import okio.Source;
public class ProgressResponseBody extends ResponseBody {
private final ResponseBody responseBody;
private final ApiCallback callback;
private BufferedSource bufferedSource;
public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
this.responseBody = responseBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return responseBody.contentType();
}
@Override
public long contentLength() {
return responseBody.contentLength();
}
@Override
public BufferedSource source() {
if (bufferedSource == null) {
bufferedSource = Okio.buffer(source(responseBody.source()));
}
return bufferedSource;
}
private Source source(Source source) {
return new ForwardingSource(source) {
long totalBytesRead = 0L;
@Override
public long read(Buffer sink, long byteCount) throws IOException {
long bytesRead = super.read(sink, byteCount);
// read() returns the number of bytes read, or -1 if this source is exhausted.
totalBytesRead += bytesRead != -1 ? bytesRead : 0;
callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
return bytesRead;
}
};
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ServerConfiguration.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import java.util.Map;
/**
* Representing a Server configuration.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class ServerConfiguration {
public String URL;
public String description;
public Map<String, ServerVariable> variables;
/**
* @param URL A URL to the target host.
* @param description A description of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
this.URL = URL;
this.description = description;
this.variables = variables;
}
/**
* Format URL template using given variables.
*
* @param variables A map between a variable name and its value.
* @return Formatted URL.
*/
public String URL(Map<String, String> variables) {
String url = this.URL;
// go through variables and replace placeholders
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
String name = variable.getKey();
ServerVariable serverVariable = variable.getValue();
String value = serverVariable.defaultValue;
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replace("{" + name + "}", value);
}
return url;
}
/**
* Format URL template using default server variables.
*
* @return Formatted URL.
*/
public String URL() {
return URL(null);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/ServerVariable.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import java.util.HashSet;
/**
* Representing a Server Variable for server URL template substitution.
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class ServerVariable {
public String description;
public String defaultValue;
public HashSet<String> enumValues = null;
/**
* @param description A description for the server variable.
* @param defaultValue The default value to use for substitution.
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
*/
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
this.description = description;
this.defaultValue = defaultValue;
this.enumValues = enumValues;
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/StringUtil.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client;
import java.util.Collection;
import java.util.Iterator;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) {
return true;
}
if (value != null && value.equalsIgnoreCase(str)) {
return true;
}
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) {
return "";
}
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
/**
* Join a list of strings with the given separator.
*
* @param list The list of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(Collection<String> list, String separator) {
Iterator<String> iterator = list.iterator();
StringBuilder out = new StringBuilder();
if (iterator.hasNext()) {
out.append(iterator.next());
}
while (iterator.hasNext()) {
out.append(separator).append(iterator.next());
}
return out.toString();
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/api/DefaultApi.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.api;
import ai.wavespeed.openapi.client.ApiCallback;
import ai.wavespeed.openapi.client.ApiClient;
import ai.wavespeed.openapi.client.ApiException;
import ai.wavespeed.openapi.client.ApiResponse;
import ai.wavespeed.openapi.client.Configuration;
import ai.wavespeed.openapi.client.Pair;
import ai.wavespeed.openapi.client.ProgressRequestBody;
import ai.wavespeed.openapi.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import ai.wavespeed.openapi.client.model.CreatePredictionData400Response;
import ai.wavespeed.openapi.client.model.CreatePredictionData401Response;
import ai.wavespeed.openapi.client.model.CreatePredictionData500Response;
import ai.wavespeed.openapi.client.model.PredictionResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DefaultApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public DefaultApi() {
this(Configuration.getDefaultApiClient());
}
public DefaultApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createPredictionData
* @param modelId The ID of the model to use for image generation (required)
* @param requestBody (required)
* @param webhook The URL to which the webhook will be sent (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createPredictionDataCall(String modelId, Map<String, Object> requestBody, String webhook, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = requestBody;
// create path and map variables
String localVarPath = "/{model_id}"
.replace("{" + "model_id" + "}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (webhook != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("webhook", webhook));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createPredictionDataValidateBeforeCall(String modelId, Map<String, Object> requestBody, String webhook, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling createPredictionData(Async)");
}
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException("Missing the required parameter 'requestBody' when calling createPredictionData(Async)");
}
return createPredictionDataCall(modelId, requestBody, webhook, _callback);
}
/**
* Generate an image using the specified model
* This endpoint generates an image based on the provided parameters. The `model_id` is a required path parameter specifying the model to use. The request body can contain various key-value pairs to customize the model generation process.
* @param modelId The ID of the model to use for image generation (required)
* @param requestBody (required)
* @param webhook The URL to which the webhook will be sent (optional)
* @return PredictionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public PredictionResponse createPredictionData(String modelId, Map<String, Object> requestBody, String webhook) throws ApiException {
ApiResponse<PredictionResponse> localVarResp = createPredictionDataWithHttpInfo(modelId, requestBody, webhook);
return localVarResp.getData();
}
/**
* Generate an image using the specified model
* This endpoint generates an image based on the provided parameters. The `model_id` is a required path parameter specifying the model to use. The request body can contain various key-value pairs to customize the model generation process.
* @param modelId The ID of the model to use for image generation (required)
* @param requestBody (required)
* @param webhook The URL to which the webhook will be sent (optional)
* @return ApiResponse<PredictionResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public ApiResponse<PredictionResponse> createPredictionDataWithHttpInfo(String modelId, Map<String, Object> requestBody, String webhook) throws ApiException {
okhttp3.Call localVarCall = createPredictionDataValidateBeforeCall(modelId, requestBody, webhook, null);
Type localVarReturnType = new TypeToken<PredictionResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Generate an image using the specified model (asynchronously)
* This endpoint generates an image based on the provided parameters. The `model_id` is a required path parameter specifying the model to use. The request body can contain various key-value pairs to customize the model generation process.
* @param modelId The ID of the model to use for image generation (required)
* @param requestBody (required)
* @param webhook The URL to which the webhook will be sent (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createPredictionDataAsync(String modelId, Map<String, Object> requestBody, String webhook, final ApiCallback<PredictionResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = createPredictionDataValidateBeforeCall(modelId, requestBody, webhook, _callback);
Type localVarReturnType = new TypeToken<PredictionResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPredictionData
* @param predictionId The ID of the prediction request (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPredictionDataCall(String predictionId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/predictions/{predictionId}/result"
.replace("{" + "predictionId" + "}", localVarApiClient.escapeString(predictionId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getPredictionDataValidateBeforeCall(String predictionId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'predictionId' is set
if (predictionId == null) {
throw new ApiException("Missing the required parameter 'predictionId' when calling getPredictionData(Async)");
}
return getPredictionDataCall(predictionId, _callback);
}
/**
* Retrieve the result of a prediction
* This endpoint retrieves the result of a prediction based on the provided request ID.
* @param predictionId The ID of the prediction request (required)
* @return PredictionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public PredictionResponse getPredictionData(String predictionId) throws ApiException {
ApiResponse<PredictionResponse> localVarResp = getPredictionDataWithHttpInfo(predictionId);
return localVarResp.getData();
}
/**
* Retrieve the result of a prediction
* This endpoint retrieves the result of a prediction based on the provided request ID.
* @param predictionId The ID of the prediction request (required)
* @return ApiResponse<PredictionResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public ApiResponse<PredictionResponse> getPredictionDataWithHttpInfo(String predictionId) throws ApiException {
okhttp3.Call localVarCall = getPredictionDataValidateBeforeCall(predictionId, null);
Type localVarReturnType = new TypeToken<PredictionResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Retrieve the result of a prediction (asynchronously)
* This endpoint retrieves the result of a prediction based on the provided request ID.
* @param predictionId The ID of the prediction request (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Image generation successful </td><td> - </td></tr>
<tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
<tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
<tr><td> 500 </td><td> Internal Server Error </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getPredictionDataAsync(String predictionId, final ApiCallback<PredictionResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = getPredictionDataValidateBeforeCall(predictionId, _callback);
Type localVarReturnType = new TypeToken<PredictionResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/auth/ApiKeyAuth.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.auth;
import ai.wavespeed.openapi.client.ApiException;
import ai.wavespeed.openapi.client.Pair;
import java.net.URI;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
} else if ("cookie".equals(location)) {
cookieParams.put(paramName, value);
}
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/auth/Authentication.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.auth;
import ai.wavespeed.openapi.client.Pair;
import ai.wavespeed.openapi.client.ApiException;
import java.net.URI;
import java.util.Map;
import java.util.List;
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
* @param payload HTTP request body
* @param method HTTP method
* @param uri URI
* @throws ApiException if failed to update the parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException;
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/auth/HttpBasicAuth.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.auth;
import ai.wavespeed.openapi.client.Pair;
import ai.wavespeed.openapi.client.ApiException;
import okhttp3.Credentials;
import java.net.URI;
import java.util.Map;
import java.util.List;
public class HttpBasicAuth implements Authentication {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
if (username == null && password == null) {
return;
}
headerParams.put("Authorization", Credentials.basic(
username == null ? "" : username,
password == null ? "" : password));
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/auth/HttpBearerAuth.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.auth;
import ai.wavespeed.openapi.client.ApiException;
import ai.wavespeed.openapi.client.Pair;
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class HttpBearerAuth implements Authentication {
private final String scheme;
private Supplier<String> tokenSupplier;
public HttpBearerAuth(String scheme) {
this.scheme = scheme;
}
/**
* Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @return The bearer token
*/
public String getBearerToken() {
return tokenSupplier.get();
}
/**
* Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @param bearerToken The bearer token to send in the Authorization header
*/
public void setBearerToken(String bearerToken) {
this.tokenSupplier = () -> bearerToken;
}
/**
* Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
*
* @param tokenSupplier The supplier of bearer tokens to send in the Authorization header
*/
public void setBearerToken(Supplier<String> tokenSupplier) {
this.tokenSupplier = tokenSupplier;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams,
String payload, String method, URI uri) throws ApiException {
String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null);
if (bearerToken == null) {
return;
}
headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
}
private static String upperCaseBearer(String scheme) {
return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/AbstractOpenApiSchema.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import ai.wavespeed.openapi.client.ApiException;
import java.util.Objects;
import java.lang.reflect.Type;
import java.util.Map;
/**
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public abstract class AbstractOpenApiSchema {
// store the actual instance of the schema/object
private Object instance;
// is nullable
private Boolean isNullable;
// schema type (e.g. oneOf, anyOf)
private final String schemaType;
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
this.schemaType = schemaType;
this.isNullable = isNullable;
}
/**
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
*
* @return an instance of the actual schema/object
*/
public abstract Map<String, Class<?>> getSchemas();
/**
* Get the actual instance
*
* @return an instance of the actual schema/object
*/
//@JsonValue
public Object getActualInstance() {return instance;}
/**
* Set the actual instance
*
* @param instance the actual instance of the schema/object
*/
public void setActualInstance(Object instance) {this.instance = instance;}
/**
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
*
* @return an instance of the actual schema/object
*/
public Object getActualInstanceRecursively() {
return getActualInstanceRecursively(this);
}
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
if (object.getActualInstance() == null) {
return null;
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
} else {
return object.getActualInstance();
}
}
/**
* Get the schema type (e.g. anyOf, oneOf)
*
* @return the schema type
*/
public String getSchemaType() {
return schemaType;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ").append(getClass()).append(" {\n");
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
return Objects.equals(this.instance, a.instance) &&
Objects.equals(this.isNullable, a.isNullable) &&
Objects.equals(this.schemaType, a.schemaType);
}
@Override
public int hashCode() {
return Objects.hash(instance, isNullable, schemaType);
}
/**
* Is nullable
*
* @return true if it's nullable
*/
public Boolean isNullable() {
if (Boolean.TRUE.equals(isNullable)) {
return Boolean.TRUE;
} else {
return Boolean.FALSE;
}
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/CreatePredictionData400Response.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import java.util.Objects;
import ai.wavespeed.openapi.client.model.CreatePredictionData400ResponseData;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ai.wavespeed.openapi.client.JSON;
/**
* CreatePredictionData400Response
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class CreatePredictionData400Response {
public static final String SERIALIZED_NAME_CODE = "code";
@SerializedName(SERIALIZED_NAME_CODE)
@javax.annotation.Nullable
private Integer code;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
@javax.annotation.Nullable
private String message;
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
@javax.annotation.Nullable
private CreatePredictionData400ResponseData data;
public CreatePredictionData400Response() {
}
public CreatePredictionData400Response code(@javax.annotation.Nullable Integer code) {
this.code = code;
return this;
}
/**
* HTTP status code (e.g., 400 for bad request)
* @return code
*/
@javax.annotation.Nullable
public Integer getCode() {
return code;
}
public void setCode(@javax.annotation.Nullable Integer code) {
this.code = code;
}
public CreatePredictionData400Response message(@javax.annotation.Nullable String message) {
this.message = message;
return this;
}
/**
* Status message (e.g., \"Bad Request\")
* @return message
*/
@javax.annotation.Nullable
public String getMessage() {
return message;
}
public void setMessage(@javax.annotation.Nullable String message) {
this.message = message;
}
public CreatePredictionData400Response data(@javax.annotation.Nullable CreatePredictionData400ResponseData data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
*/
@javax.annotation.Nullable
public CreatePredictionData400ResponseData getData() {
return data;
}
public void setData(@javax.annotation.Nullable CreatePredictionData400ResponseData data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreatePredictionData400Response createPredictionData400Response = (CreatePredictionData400Response) o;
return Objects.equals(this.code, createPredictionData400Response.code) &&
Objects.equals(this.message, createPredictionData400Response.message) &&
Objects.equals(this.data, createPredictionData400Response.data);
}
@Override
public int hashCode() {
return Objects.hash(code, message, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreatePredictionData400Response {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("code");
openapiFields.add("message");
openapiFields.add("data");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to CreatePredictionData400Response
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!CreatePredictionData400Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreatePredictionData400Response is not found in the empty JSON string", CreatePredictionData400Response.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!CreatePredictionData400Response.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePredictionData400Response` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
// validate the optional field `data`
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
CreatePredictionData400ResponseData.validateJsonElement(jsonObj.get("data"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreatePredictionData400Response.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreatePredictionData400Response' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreatePredictionData400Response> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreatePredictionData400Response.class));
return (TypeAdapter<T>) new TypeAdapter<CreatePredictionData400Response>() {
@Override
public void write(JsonWriter out, CreatePredictionData400Response value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreatePredictionData400Response read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of CreatePredictionData400Response given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreatePredictionData400Response
* @throws IOException if the JSON string is invalid with respect to CreatePredictionData400Response
*/
public static CreatePredictionData400Response fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreatePredictionData400Response.class);
}
/**
* Convert an instance of CreatePredictionData400Response to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/CreatePredictionData400ResponseData.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import java.util.Objects;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ai.wavespeed.openapi.client.JSON;
/**
* CreatePredictionData400ResponseData
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class CreatePredictionData400ResponseData {
public static final String SERIALIZED_NAME_ERROR = "error";
@SerializedName(SERIALIZED_NAME_ERROR)
@javax.annotation.Nullable
private String error;
public CreatePredictionData400ResponseData() {
}
public CreatePredictionData400ResponseData error(@javax.annotation.Nullable String error) {
this.error = error;
return this;
}
/**
* Error message
* @return error
*/
@javax.annotation.Nullable
public String getError() {
return error;
}
public void setError(@javax.annotation.Nullable String error) {
this.error = error;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreatePredictionData400ResponseData createPredictionData400ResponseData = (CreatePredictionData400ResponseData) o;
return Objects.equals(this.error, createPredictionData400ResponseData.error);
}
@Override
public int hashCode() {
return Objects.hash(error);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreatePredictionData400ResponseData {\n");
sb.append(" error: ").append(toIndentedString(error)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("error");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to CreatePredictionData400ResponseData
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!CreatePredictionData400ResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreatePredictionData400ResponseData is not found in the empty JSON string", CreatePredictionData400ResponseData.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!CreatePredictionData400ResponseData.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePredictionData400ResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreatePredictionData400ResponseData.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreatePredictionData400ResponseData' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreatePredictionData400ResponseData> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreatePredictionData400ResponseData.class));
return (TypeAdapter<T>) new TypeAdapter<CreatePredictionData400ResponseData>() {
@Override
public void write(JsonWriter out, CreatePredictionData400ResponseData value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreatePredictionData400ResponseData read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of CreatePredictionData400ResponseData given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreatePredictionData400ResponseData
* @throws IOException if the JSON string is invalid with respect to CreatePredictionData400ResponseData
*/
public static CreatePredictionData400ResponseData fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreatePredictionData400ResponseData.class);
}
/**
* Convert an instance of CreatePredictionData400ResponseData to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/CreatePredictionData401Response.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import java.util.Objects;
import ai.wavespeed.openapi.client.model.CreatePredictionData400ResponseData;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ai.wavespeed.openapi.client.JSON;
/**
* CreatePredictionData401Response
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class CreatePredictionData401Response {
public static final String SERIALIZED_NAME_CODE = "code";
@SerializedName(SERIALIZED_NAME_CODE)
@javax.annotation.Nullable
private Integer code;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
@javax.annotation.Nullable
private String message;
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
@javax.annotation.Nullable
private CreatePredictionData400ResponseData data;
public CreatePredictionData401Response() {
}
public CreatePredictionData401Response code(@javax.annotation.Nullable Integer code) {
this.code = code;
return this;
}
/**
* HTTP status code (e.g., 401 for unauthorized)
* @return code
*/
@javax.annotation.Nullable
public Integer getCode() {
return code;
}
public void setCode(@javax.annotation.Nullable Integer code) {
this.code = code;
}
public CreatePredictionData401Response message(@javax.annotation.Nullable String message) {
this.message = message;
return this;
}
/**
* Status message (e.g., \"Unauthorized\")
* @return message
*/
@javax.annotation.Nullable
public String getMessage() {
return message;
}
public void setMessage(@javax.annotation.Nullable String message) {
this.message = message;
}
public CreatePredictionData401Response data(@javax.annotation.Nullable CreatePredictionData400ResponseData data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
*/
@javax.annotation.Nullable
public CreatePredictionData400ResponseData getData() {
return data;
}
public void setData(@javax.annotation.Nullable CreatePredictionData400ResponseData data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreatePredictionData401Response createPredictionData401Response = (CreatePredictionData401Response) o;
return Objects.equals(this.code, createPredictionData401Response.code) &&
Objects.equals(this.message, createPredictionData401Response.message) &&
Objects.equals(this.data, createPredictionData401Response.data);
}
@Override
public int hashCode() {
return Objects.hash(code, message, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreatePredictionData401Response {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("code");
openapiFields.add("message");
openapiFields.add("data");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to CreatePredictionData401Response
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!CreatePredictionData401Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreatePredictionData401Response is not found in the empty JSON string", CreatePredictionData401Response.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!CreatePredictionData401Response.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePredictionData401Response` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
// validate the optional field `data`
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
CreatePredictionData400ResponseData.validateJsonElement(jsonObj.get("data"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreatePredictionData401Response.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreatePredictionData401Response' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreatePredictionData401Response> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreatePredictionData401Response.class));
return (TypeAdapter<T>) new TypeAdapter<CreatePredictionData401Response>() {
@Override
public void write(JsonWriter out, CreatePredictionData401Response value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreatePredictionData401Response read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of CreatePredictionData401Response given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreatePredictionData401Response
* @throws IOException if the JSON string is invalid with respect to CreatePredictionData401Response
*/
public static CreatePredictionData401Response fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreatePredictionData401Response.class);
}
/**
* Convert an instance of CreatePredictionData401Response to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/CreatePredictionData500Response.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import java.util.Objects;
import ai.wavespeed.openapi.client.model.CreatePredictionData400ResponseData;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ai.wavespeed.openapi.client.JSON;
/**
* CreatePredictionData500Response
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class CreatePredictionData500Response {
public static final String SERIALIZED_NAME_CODE = "code";
@SerializedName(SERIALIZED_NAME_CODE)
@javax.annotation.Nullable
private Integer code;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
@javax.annotation.Nullable
private String message;
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
@javax.annotation.Nullable
private CreatePredictionData400ResponseData data;
public CreatePredictionData500Response() {
}
public CreatePredictionData500Response code(@javax.annotation.Nullable Integer code) {
this.code = code;
return this;
}
/**
* HTTP status code (e.g., 500 for internal server error)
* @return code
*/
@javax.annotation.Nullable
public Integer getCode() {
return code;
}
public void setCode(@javax.annotation.Nullable Integer code) {
this.code = code;
}
public CreatePredictionData500Response message(@javax.annotation.Nullable String message) {
this.message = message;
return this;
}
/**
* Status message (e.g., \"Internal Server Error\")
* @return message
*/
@javax.annotation.Nullable
public String getMessage() {
return message;
}
public void setMessage(@javax.annotation.Nullable String message) {
this.message = message;
}
public CreatePredictionData500Response data(@javax.annotation.Nullable CreatePredictionData400ResponseData data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
*/
@javax.annotation.Nullable
public CreatePredictionData400ResponseData getData() {
return data;
}
public void setData(@javax.annotation.Nullable CreatePredictionData400ResponseData data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreatePredictionData500Response createPredictionData500Response = (CreatePredictionData500Response) o;
return Objects.equals(this.code, createPredictionData500Response.code) &&
Objects.equals(this.message, createPredictionData500Response.message) &&
Objects.equals(this.data, createPredictionData500Response.data);
}
@Override
public int hashCode() {
return Objects.hash(code, message, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreatePredictionData500Response {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("code");
openapiFields.add("message");
openapiFields.add("data");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to CreatePredictionData500Response
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!CreatePredictionData500Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in CreatePredictionData500Response is not found in the empty JSON string", CreatePredictionData500Response.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!CreatePredictionData500Response.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePredictionData500Response` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
// validate the optional field `data`
if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) {
CreatePredictionData400ResponseData.validateJsonElement(jsonObj.get("data"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!CreatePredictionData500Response.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'CreatePredictionData500Response' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<CreatePredictionData500Response> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(CreatePredictionData500Response.class));
return (TypeAdapter<T>) new TypeAdapter<CreatePredictionData500Response>() {
@Override
public void write(JsonWriter out, CreatePredictionData500Response value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public CreatePredictionData500Response read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of CreatePredictionData500Response given an JSON string
*
* @param jsonString JSON string
* @return An instance of CreatePredictionData500Response
* @throws IOException if the JSON string is invalid with respect to CreatePredictionData500Response
*/
public static CreatePredictionData500Response fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, CreatePredictionData500Response.class);
}
/**
* Convert an instance of CreatePredictionData500Response to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/Prediction.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import java.util.Objects;
import ai.wavespeed.openapi.client.model.PredictionUrls;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URI;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ai.wavespeed.openapi.client.JSON;
/**
* Prediction
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class Prediction {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
@javax.annotation.Nonnull
private String id;
public static final String SERIALIZED_NAME_MODEL = "model";
@SerializedName(SERIALIZED_NAME_MODEL)
@javax.annotation.Nullable
private String model;
public static final String SERIALIZED_NAME_OUTPUTS = "outputs";
@SerializedName(SERIALIZED_NAME_OUTPUTS)
@javax.annotation.Nullable
private List<URI> outputs;
public static final String SERIALIZED_NAME_URLS = "urls";
@SerializedName(SERIALIZED_NAME_URLS)
@javax.annotation.Nullable
private PredictionUrls urls;
public static final String SERIALIZED_NAME_HAS_NSFW_CONTENTS = "has_nsfw_contents";
@SerializedName(SERIALIZED_NAME_HAS_NSFW_CONTENTS)
@javax.annotation.Nullable
private List<Boolean> hasNsfwContents;
/**
* Status of the task
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
CREATED("created"),
PROCESSING("processing"),
COMPLETED("completed"),
FAILED("failed");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<StatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
StatusEnum.fromValue(value);
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
@javax.annotation.Nonnull
private StatusEnum status;
public static final String SERIALIZED_NAME_CREATED_AT = "created_at";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
@javax.annotation.Nullable
private OffsetDateTime createdAt;
public static final String SERIALIZED_NAME_ERROR = "error";
@SerializedName(SERIALIZED_NAME_ERROR)
@javax.annotation.Nullable
private String error;
public static final String SERIALIZED_NAME_EXECUTION_TIME = "executionTime";
@SerializedName(SERIALIZED_NAME_EXECUTION_TIME)
@javax.annotation.Nullable
private BigDecimal executionTime;
public Prediction() {
}
public Prediction id(@javax.annotation.Nonnull String id) {
this.id = id;
return this;
}
/**
* Unique identifier for the prediction
* @return id
*/
@javax.annotation.Nonnull
public String getId() {
return id;
}
public void setId(@javax.annotation.Nonnull String id) {
this.id = id;
}
public Prediction model(@javax.annotation.Nullable String model) {
this.model = model;
return this;
}
/**
* Model ID used for the prediction
* @return model
*/
@javax.annotation.Nullable
public String getModel() {
return model;
}
public void setModel(@javax.annotation.Nullable String model) {
this.model = model;
}
public Prediction outputs(@javax.annotation.Nullable List<URI> outputs) {
this.outputs = outputs;
return this;
}
public Prediction addOutputsItem(URI outputsItem) {
if (this.outputs == null) {
this.outputs = new ArrayList<>();
}
this.outputs.add(outputsItem);
return this;
}
/**
* Get outputs
* @return outputs
*/
@javax.annotation.Nullable
public List<URI> getOutputs() {
return outputs;
}
public void setOutputs(@javax.annotation.Nullable List<URI> outputs) {
this.outputs = outputs;
}
public Prediction urls(@javax.annotation.Nullable PredictionUrls urls) {
this.urls = urls;
return this;
}
/**
* Get urls
* @return urls
*/
@javax.annotation.Nullable
public PredictionUrls getUrls() {
return urls;
}
public void setUrls(@javax.annotation.Nullable PredictionUrls urls) {
this.urls = urls;
}
public Prediction hasNsfwContents(@javax.annotation.Nullable List<Boolean> hasNsfwContents) {
this.hasNsfwContents = hasNsfwContents;
return this;
}
public Prediction addHasNsfwContentsItem(Boolean hasNsfwContentsItem) {
if (this.hasNsfwContents == null) {
this.hasNsfwContents = new ArrayList<>();
}
this.hasNsfwContents.add(hasNsfwContentsItem);
return this;
}
/**
* Get hasNsfwContents
* @return hasNsfwContents
*/
@javax.annotation.Nullable
public List<Boolean> getHasNsfwContents() {
return hasNsfwContents;
}
public void setHasNsfwContents(@javax.annotation.Nullable List<Boolean> hasNsfwContents) {
this.hasNsfwContents = hasNsfwContents;
}
public Prediction status(@javax.annotation.Nonnull StatusEnum status) {
this.status = status;
return this;
}
/**
* Status of the task
* @return status
*/
@javax.annotation.Nonnull
public StatusEnum getStatus() {
return status;
}
public void setStatus(@javax.annotation.Nonnull StatusEnum status) {
this.status = status;
}
public Prediction createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Timestamp of when the request was created
* @return createdAt
*/
@javax.annotation.Nullable
public OffsetDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
public Prediction error(@javax.annotation.Nullable String error) {
this.error = error;
return this;
}
/**
* Error message (empty if no error occurred)
* @return error
*/
@javax.annotation.Nullable
public String getError() {
return error;
}
public void setError(@javax.annotation.Nullable String error) {
this.error = error;
}
public Prediction executionTime(@javax.annotation.Nullable BigDecimal executionTime) {
this.executionTime = executionTime;
return this;
}
/**
* model execution time
* @return executionTime
*/
@javax.annotation.Nullable
public BigDecimal getExecutionTime() {
return executionTime;
}
public void setExecutionTime(@javax.annotation.Nullable BigDecimal executionTime) {
this.executionTime = executionTime;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Prediction prediction = (Prediction) o;
return Objects.equals(this.id, prediction.id) &&
Objects.equals(this.model, prediction.model) &&
Objects.equals(this.outputs, prediction.outputs) &&
Objects.equals(this.urls, prediction.urls) &&
Objects.equals(this.hasNsfwContents, prediction.hasNsfwContents) &&
Objects.equals(this.status, prediction.status) &&
Objects.equals(this.createdAt, prediction.createdAt) &&
Objects.equals(this.error, prediction.error) &&
Objects.equals(this.executionTime, prediction.executionTime);
}
@Override
public int hashCode() {
return Objects.hash(id, model, outputs, urls, hasNsfwContents, status, createdAt, error, executionTime);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Prediction {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" model: ").append(toIndentedString(model)).append("\n");
sb.append(" outputs: ").append(toIndentedString(outputs)).append("\n");
sb.append(" urls: ").append(toIndentedString(urls)).append("\n");
sb.append(" hasNsfwContents: ").append(toIndentedString(hasNsfwContents)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" error: ").append(toIndentedString(error)).append("\n");
sb.append(" executionTime: ").append(toIndentedString(executionTime)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("id");
openapiFields.add("model");
openapiFields.add("outputs");
openapiFields.add("urls");
openapiFields.add("has_nsfw_contents");
openapiFields.add("status");
openapiFields.add("created_at");
openapiFields.add("error");
openapiFields.add("executionTime");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("id");
openapiRequiredFields.add("status");
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to Prediction
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!Prediction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in Prediction is not found in the empty JSON string", Prediction.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!Prediction.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Prediction` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : Prediction.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("model") != null && !jsonObj.get("model").isJsonNull()) && !jsonObj.get("model").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `model` to be a primitive type in the JSON string but got `%s`", jsonObj.get("model").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("outputs") != null && !jsonObj.get("outputs").isJsonNull() && !jsonObj.get("outputs").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `outputs` to be an array in the JSON string but got `%s`", jsonObj.get("outputs").toString()));
}
// validate the optional field `urls`
if (jsonObj.get("urls") != null && !jsonObj.get("urls").isJsonNull()) {
PredictionUrls.validateJsonElement(jsonObj.get("urls"));
}
// ensure the optional json data is an array if present
if (jsonObj.get("has_nsfw_contents") != null && !jsonObj.get("has_nsfw_contents").isJsonNull() && !jsonObj.get("has_nsfw_contents").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `has_nsfw_contents` to be an array in the JSON string but got `%s`", jsonObj.get("has_nsfw_contents").toString()));
}
if (!jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
// validate the required field `status`
StatusEnum.validateJsonElement(jsonObj.get("status"));
if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!Prediction.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'Prediction' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Prediction> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(Prediction.class));
return (TypeAdapter<T>) new TypeAdapter<Prediction>() {
@Override
public void write(JsonWriter out, Prediction value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public Prediction read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of Prediction given an JSON string
*
* @param jsonString JSON string
* @return An instance of Prediction
* @throws IOException if the JSON string is invalid with respect to Prediction
*/
public static Prediction fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, Prediction.class);
}
/**
* Convert an instance of Prediction to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/PredictionResponse.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import java.util.Objects;
import ai.wavespeed.openapi.client.model.Prediction;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ai.wavespeed.openapi.client.JSON;
/**
* PredictionResponse
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class PredictionResponse {
public static final String SERIALIZED_NAME_CODE = "code";
@SerializedName(SERIALIZED_NAME_CODE)
@javax.annotation.Nonnull
private Integer code;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
@javax.annotation.Nullable
private String message;
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
@javax.annotation.Nonnull
private Prediction data;
public PredictionResponse() {
}
public PredictionResponse code(@javax.annotation.Nonnull Integer code) {
this.code = code;
return this;
}
/**
* HTTP status code (e.g., 200 for success)
* @return code
*/
@javax.annotation.Nonnull
public Integer getCode() {
return code;
}
public void setCode(@javax.annotation.Nonnull Integer code) {
this.code = code;
}
public PredictionResponse message(@javax.annotation.Nullable String message) {
this.message = message;
return this;
}
/**
* Status message (e.g., \"success\")
* @return message
*/
@javax.annotation.Nullable
public String getMessage() {
return message;
}
public void setMessage(@javax.annotation.Nullable String message) {
this.message = message;
}
public PredictionResponse data(@javax.annotation.Nonnull Prediction data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
*/
@javax.annotation.Nonnull
public Prediction getData() {
return data;
}
public void setData(@javax.annotation.Nonnull Prediction data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PredictionResponse predictionResponse = (PredictionResponse) o;
return Objects.equals(this.code, predictionResponse.code) &&
Objects.equals(this.message, predictionResponse.message) &&
Objects.equals(this.data, predictionResponse.data);
}
@Override
public int hashCode() {
return Objects.hash(code, message, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PredictionResponse {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("code");
openapiFields.add("message");
openapiFields.add("data");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("code");
openapiRequiredFields.add("data");
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to PredictionResponse
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!PredictionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PredictionResponse is not found in the empty JSON string", PredictionResponse.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!PredictionResponse.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PredictionResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : PredictionResponse.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString()));
}
// validate the required field `data`
Prediction.validateJsonElement(jsonObj.get("data"));
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PredictionResponse.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PredictionResponse' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PredictionResponse> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PredictionResponse.class));
return (TypeAdapter<T>) new TypeAdapter<PredictionResponse>() {
@Override
public void write(JsonWriter out, PredictionResponse value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PredictionResponse read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of PredictionResponse given an JSON string
*
* @param jsonString JSON string
* @return An instance of PredictionResponse
* @throws IOException if the JSON string is invalid with respect to PredictionResponse
*/
public static PredictionResponse fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PredictionResponse.class);
}
/**
* Convert an instance of PredictionResponse to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
|
0 | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client | java-sources/ai/wavespeed/maven/wavespeed-client/0.0.1/ai/wavespeed/openapi/client/model/PredictionUrls.java | /*
* WaveSpeed AI API
* API for generating images using WaveSpeed AI
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.wavespeed.openapi.client.model;
import java.util.Objects;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ai.wavespeed.openapi.client.JSON;
/**
* PredictionUrls
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-04-09T11:04:56.988432456+08:00[Asia/Shanghai]", comments = "Generator version: 7.10.0")
public class PredictionUrls {
public static final String SERIALIZED_NAME_GET = "get";
@SerializedName(SERIALIZED_NAME_GET)
@javax.annotation.Nullable
private URI get;
public PredictionUrls() {
}
public PredictionUrls get(@javax.annotation.Nullable URI get) {
this.get = get;
return this;
}
/**
* URL to retrieve the prediction result
* @return get
*/
@javax.annotation.Nullable
public URI getGet() {
return get;
}
public void setGet(@javax.annotation.Nullable URI get) {
this.get = get;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PredictionUrls predictionUrls = (PredictionUrls) o;
return Objects.equals(this.get, predictionUrls.get);
}
@Override
public int hashCode() {
return Objects.hash(get);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PredictionUrls {\n");
sb.append(" get: ").append(toIndentedString(get)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("get");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to PredictionUrls
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!PredictionUrls.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in PredictionUrls is not found in the empty JSON string", PredictionUrls.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!PredictionUrls.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PredictionUrls` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("get") != null && !jsonObj.get("get").isJsonNull()) && !jsonObj.get("get").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `get` to be a primitive type in the JSON string but got `%s`", jsonObj.get("get").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!PredictionUrls.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'PredictionUrls' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<PredictionUrls> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(PredictionUrls.class));
return (TypeAdapter<T>) new TypeAdapter<PredictionUrls>() {
@Override
public void write(JsonWriter out, PredictionUrls value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public PredictionUrls read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of PredictionUrls given an JSON string
*
* @param jsonString JSON string
* @return An instance of PredictionUrls
* @throws IOException if the JSON string is invalid with respect to PredictionUrls
*/
public static PredictionUrls fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, PredictionUrls.class);
}
/**
* Convert an instance of PredictionUrls to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/api/AlertsApi.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.api;
import ai.whylabs.service.invoker.ApiCallback;
import ai.whylabs.service.invoker.ApiClient;
import ai.whylabs.service.invoker.ApiException;
import ai.whylabs.service.invoker.ApiResponse;
import ai.whylabs.service.invoker.Configuration;
import ai.whylabs.service.invoker.Pair;
import ai.whylabs.service.invoker.ProgressRequestBody;
import ai.whylabs.service.invoker.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import ai.whylabs.service.model.GetAlertsPathsResponse;
import ai.whylabs.service.model.SegmentTag;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AlertsApi {
private ApiClient localVarApiClient;
public AlertsApi() {
this(Configuration.getDefaultApiClient());
}
public AlertsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for getAlertsPaths
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the alert in case we have multiple schemas (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a list of AlertsPath in the given time period, de-duped with the latest updated entries </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAlertsPathsCall(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/alerts/models/{model_id}/paths"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (segmentTags != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "segment_tags", segmentTags));
}
if (startTimestamp != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_timestamp", startTimestamp));
}
if (endTimestamp != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_timestamp", endTimestamp));
}
if (version != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAlertsPathsValidateBeforeCall(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling getAlertsPaths(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling getAlertsPaths(Async)");
}
// verify the required parameter 'startTimestamp' is set
if (startTimestamp == null) {
throw new ApiException("Missing the required parameter 'startTimestamp' when calling getAlertsPaths(Async)");
}
// verify the required parameter 'endTimestamp' is set
if (endTimestamp == null) {
throw new ApiException("Missing the required parameter 'endTimestamp' when calling getAlertsPaths(Async)");
}
okhttp3.Call localVarCall = getAlertsPathsCall(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version, _callback);
return localVarCall;
}
/**
* Get the alerts for a given time period.
* Get the alerts from a given time period.
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the alert in case we have multiple schemas (optional)
* @return GetAlertsPathsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a list of AlertsPath in the given time period, de-duped with the latest updated entries </td><td> - </td></tr>
</table>
*/
public GetAlertsPathsResponse getAlertsPaths(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version) throws ApiException {
ApiResponse<GetAlertsPathsResponse> localVarResp = getAlertsPathsWithHttpInfo(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version);
return localVarResp.getData();
}
/**
* Get the alerts for a given time period.
* Get the alerts from a given time period.
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the alert in case we have multiple schemas (optional)
* @return ApiResponse<GetAlertsPathsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a list of AlertsPath in the given time period, de-duped with the latest updated entries </td><td> - </td></tr>
</table>
*/
public ApiResponse<GetAlertsPathsResponse> getAlertsPathsWithHttpInfo(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version) throws ApiException {
okhttp3.Call localVarCall = getAlertsPathsValidateBeforeCall(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version, null);
Type localVarReturnType = new TypeToken<GetAlertsPathsResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get the alerts for a given time period. (asynchronously)
* Get the alerts from a given time period.
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the alert in case we have multiple schemas (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a list of AlertsPath in the given time period, de-duped with the latest updated entries </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getAlertsPathsAsync(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version, final ApiCallback<GetAlertsPathsResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = getAlertsPathsValidateBeforeCall(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version, _callback);
Type localVarReturnType = new TypeToken<GetAlertsPathsResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/api/ApiKeyApi.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.api;
import ai.whylabs.service.invoker.ApiCallback;
import ai.whylabs.service.invoker.ApiClient;
import ai.whylabs.service.invoker.ApiException;
import ai.whylabs.service.invoker.ApiResponse;
import ai.whylabs.service.invoker.Configuration;
import ai.whylabs.service.invoker.Pair;
import ai.whylabs.service.invoker.ProgressRequestBody;
import ai.whylabs.service.invoker.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import ai.whylabs.service.model.ListUserApiKeys;
import ai.whylabs.service.model.UserApiKey;
import ai.whylabs.service.model.UserApiKeyResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ApiKeyApi {
private ApiClient localVarApiClient;
public ApiKeyApi() {
this(Configuration.getDefaultApiClient());
}
public ApiKeyApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for createApiKey
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. (required)
* @param expirationTime Expiration time in epoch milliseconds (optional)
* @param scopes Scopes of the token (optional)
* @param alias A human-friendly name for the API Key An object with key ID and other metadata about the key (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A object with key ID and other metadata about the key </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createApiKeyCall(String orgId, String userId, Long expirationTime, List<String> scopes, String alias, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/api-key"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (userId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId));
}
if (expirationTime != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiration_time", expirationTime));
}
if (scopes != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "scopes", scopes));
}
if (alias != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("alias", alias));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createApiKeyValidateBeforeCall(String orgId, String userId, Long expirationTime, List<String> scopes, String alias, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling createApiKey(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling createApiKey(Async)");
}
okhttp3.Call localVarCall = createApiKeyCall(orgId, userId, expirationTime, scopes, alias, _callback);
return localVarCall;
}
/**
* Generate an API key for a user.
* Generates an API key for a given user. Must be called either by system administrator or by the user themselves
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. (required)
* @param expirationTime Expiration time in epoch milliseconds (optional)
* @param scopes Scopes of the token (optional)
* @param alias A human-friendly name for the API Key An object with key ID and other metadata about the key (optional)
* @return UserApiKey
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A object with key ID and other metadata about the key </td><td> - </td></tr>
</table>
*/
public UserApiKey createApiKey(String orgId, String userId, Long expirationTime, List<String> scopes, String alias) throws ApiException {
ApiResponse<UserApiKey> localVarResp = createApiKeyWithHttpInfo(orgId, userId, expirationTime, scopes, alias);
return localVarResp.getData();
}
/**
* Generate an API key for a user.
* Generates an API key for a given user. Must be called either by system administrator or by the user themselves
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. (required)
* @param expirationTime Expiration time in epoch milliseconds (optional)
* @param scopes Scopes of the token (optional)
* @param alias A human-friendly name for the API Key An object with key ID and other metadata about the key (optional)
* @return ApiResponse<UserApiKey>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A object with key ID and other metadata about the key </td><td> - </td></tr>
</table>
*/
public ApiResponse<UserApiKey> createApiKeyWithHttpInfo(String orgId, String userId, Long expirationTime, List<String> scopes, String alias) throws ApiException {
okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(orgId, userId, expirationTime, scopes, alias, null);
Type localVarReturnType = new TypeToken<UserApiKey>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Generate an API key for a user. (asynchronously)
* Generates an API key for a given user. Must be called either by system administrator or by the user themselves
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. (required)
* @param expirationTime Expiration time in epoch milliseconds (optional)
* @param scopes Scopes of the token (optional)
* @param alias A human-friendly name for the API Key An object with key ID and other metadata about the key (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A object with key ID and other metadata about the key </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createApiKeyAsync(String orgId, String userId, Long expirationTime, List<String> scopes, String alias, final ApiCallback<UserApiKey> _callback) throws ApiException {
okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(orgId, userId, expirationTime, scopes, alias, _callback);
Type localVarReturnType = new TypeToken<UserApiKey>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getApiKey
* @param orgId (required)
* @param keyId (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getApiKeyCall(String orgId, String keyId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/api-key/{key_id}"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "key_id" + "\\}", localVarApiClient.escapeString(keyId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getApiKeyValidateBeforeCall(String orgId, String keyId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling getApiKey(Async)");
}
// verify the required parameter 'keyId' is set
if (keyId == null) {
throw new ApiException("Missing the required parameter 'keyId' when calling getApiKey(Async)");
}
okhttp3.Call localVarCall = getApiKeyCall(orgId, keyId, _callback);
return localVarCall;
}
/**
* Get an api key by its id
* Get an api key by its id
* @param orgId (required)
* @param keyId (required)
* @return UserApiKeyResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public UserApiKeyResponse getApiKey(String orgId, String keyId) throws ApiException {
ApiResponse<UserApiKeyResponse> localVarResp = getApiKeyWithHttpInfo(orgId, keyId);
return localVarResp.getData();
}
/**
* Get an api key by its id
* Get an api key by its id
* @param orgId (required)
* @param keyId (required)
* @return ApiResponse<UserApiKeyResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public ApiResponse<UserApiKeyResponse> getApiKeyWithHttpInfo(String orgId, String keyId) throws ApiException {
okhttp3.Call localVarCall = getApiKeyValidateBeforeCall(orgId, keyId, null);
Type localVarReturnType = new TypeToken<UserApiKeyResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get an api key by its id (asynchronously)
* Get an api key by its id
* @param orgId (required)
* @param keyId (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getApiKeyAsync(String orgId, String keyId, final ApiCallback<UserApiKeyResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = getApiKeyValidateBeforeCall(orgId, keyId, _callback);
Type localVarReturnType = new TypeToken<UserApiKeyResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for listApiKeys
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. A list of objects with key ID and other metadata about the keys, but no secret values (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listApiKeysCall(String orgId, String userId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/api-key"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (userId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listApiKeysValidateBeforeCall(String orgId, String userId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling listApiKeys(Async)");
}
okhttp3.Call localVarCall = listApiKeysCall(orgId, userId, _callback);
return localVarCall;
}
/**
* List API key metadata for a given organization and user
* Returns the API key metadata for a given organization and user
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. A list of objects with key ID and other metadata about the keys, but no secret values (optional)
* @return ListUserApiKeys
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public ListUserApiKeys listApiKeys(String orgId, String userId) throws ApiException {
ApiResponse<ListUserApiKeys> localVarResp = listApiKeysWithHttpInfo(orgId, userId);
return localVarResp.getData();
}
/**
* List API key metadata for a given organization and user
* Returns the API key metadata for a given organization and user
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. A list of objects with key ID and other metadata about the keys, but no secret values (optional)
* @return ApiResponse<ListUserApiKeys>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public ApiResponse<ListUserApiKeys> listApiKeysWithHttpInfo(String orgId, String userId) throws ApiException {
okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(orgId, userId, null);
Type localVarReturnType = new TypeToken<ListUserApiKeys>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* List API key metadata for a given organization and user (asynchronously)
* Returns the API key metadata for a given organization and user
* @param orgId Your company's unique organization ID (required)
* @param userId The unique user ID in an organization. A list of objects with key ID and other metadata about the keys, but no secret values (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of objects with key ID and other metadata about the keys, but no secret values </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listApiKeysAsync(String orgId, String userId, final ApiCallback<ListUserApiKeys> _callback) throws ApiException {
okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(orgId, userId, _callback);
Type localVarReturnType = new TypeToken<ListUserApiKeys>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for revokeApiKey
* @param orgId (required)
* @param userId (required)
* @param keyId ID of the key to revoke Metadata for the revoked API Key (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> Revoked API Key's metadata </td><td> - </td></tr>
</table>
*/
public okhttp3.Call revokeApiKeyCall(String orgId, String userId, String keyId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/api-key"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (userId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_id", userId));
}
if (keyId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("key_id", keyId));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call revokeApiKeyValidateBeforeCall(String orgId, String userId, String keyId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling revokeApiKey(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling revokeApiKey(Async)");
}
// verify the required parameter 'keyId' is set
if (keyId == null) {
throw new ApiException("Missing the required parameter 'keyId' when calling revokeApiKey(Async)");
}
okhttp3.Call localVarCall = revokeApiKeyCall(orgId, userId, keyId, _callback);
return localVarCall;
}
/**
* Revoke the given API Key, removing its ability to access WhyLabs systems
* Revokes the given API Key
* @param orgId (required)
* @param userId (required)
* @param keyId ID of the key to revoke Metadata for the revoked API Key (required)
* @return UserApiKey
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> Revoked API Key's metadata </td><td> - </td></tr>
</table>
*/
public UserApiKey revokeApiKey(String orgId, String userId, String keyId) throws ApiException {
ApiResponse<UserApiKey> localVarResp = revokeApiKeyWithHttpInfo(orgId, userId, keyId);
return localVarResp.getData();
}
/**
* Revoke the given API Key, removing its ability to access WhyLabs systems
* Revokes the given API Key
* @param orgId (required)
* @param userId (required)
* @param keyId ID of the key to revoke Metadata for the revoked API Key (required)
* @return ApiResponse<UserApiKey>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> Revoked API Key's metadata </td><td> - </td></tr>
</table>
*/
public ApiResponse<UserApiKey> revokeApiKeyWithHttpInfo(String orgId, String userId, String keyId) throws ApiException {
okhttp3.Call localVarCall = revokeApiKeyValidateBeforeCall(orgId, userId, keyId, null);
Type localVarReturnType = new TypeToken<UserApiKey>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Revoke the given API Key, removing its ability to access WhyLabs systems (asynchronously)
* Revokes the given API Key
* @param orgId (required)
* @param userId (required)
* @param keyId ID of the key to revoke Metadata for the revoked API Key (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> Revoked API Key's metadata </td><td> - </td></tr>
</table>
*/
public okhttp3.Call revokeApiKeyAsync(String orgId, String userId, String keyId, final ApiCallback<UserApiKey> _callback) throws ApiException {
okhttp3.Call localVarCall = revokeApiKeyValidateBeforeCall(orgId, userId, keyId, _callback);
Type localVarReturnType = new TypeToken<UserApiKey>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/api/EventsApi.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.api;
import ai.whylabs.service.invoker.ApiCallback;
import ai.whylabs.service.invoker.ApiClient;
import ai.whylabs.service.invoker.ApiException;
import ai.whylabs.service.invoker.ApiResponse;
import ai.whylabs.service.invoker.Configuration;
import ai.whylabs.service.invoker.Pair;
import ai.whylabs.service.invoker.ProgressRequestBody;
import ai.whylabs.service.invoker.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.io.File;
import ai.whylabs.service.model.SegmentTag;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class EventsApi {
private ApiClient localVarApiClient;
public EventsApi() {
this(Configuration.getDefaultApiClient());
}
public EventsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for getEventsData
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the event (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> A streaming JSON output in multiline JSON format </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEventsDataCall(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/events/models/{model_id}/data"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (segmentTags != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "segment_tags", segmentTags));
}
if (startTimestamp != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_timestamp", startTimestamp));
}
if (endTimestamp != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_timestamp", endTimestamp));
}
if (version != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version));
}
final String[] localVarAccepts = {
"application/x-json-stream"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getEventsDataValidateBeforeCall(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling getEventsData(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling getEventsData(Async)");
}
// verify the required parameter 'startTimestamp' is set
if (startTimestamp == null) {
throw new ApiException("Missing the required parameter 'startTimestamp' when calling getEventsData(Async)");
}
// verify the required parameter 'endTimestamp' is set
if (endTimestamp == null) {
throw new ApiException("Missing the required parameter 'endTimestamp' when calling getEventsData(Async)");
}
okhttp3.Call localVarCall = getEventsDataCall(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version, _callback);
return localVarCall;
}
/**
* Get the event data as multi-line JSON for a given time period.
* Get the events from a given time period.
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the event (optional)
* @return File
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> A streaming JSON output in multiline JSON format </td><td> - </td></tr>
</table>
*/
public File getEventsData(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version) throws ApiException {
ApiResponse<File> localVarResp = getEventsDataWithHttpInfo(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version);
return localVarResp.getData();
}
/**
* Get the event data as multi-line JSON for a given time period.
* Get the events from a given time period.
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the event (optional)
* @return ApiResponse<File>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> A streaming JSON output in multiline JSON format </td><td> - </td></tr>
</table>
*/
public ApiResponse<File> getEventsDataWithHttpInfo(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version) throws ApiException {
okhttp3.Call localVarCall = getEventsDataValidateBeforeCall(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version, null);
Type localVarReturnType = new TypeToken<File>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get the event data as multi-line JSON for a given time period. (asynchronously)
* Get the events from a given time period.
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. The model is created if it doesn't exist already. (required)
* @param startTimestamp Start time exclusive (required)
* @param endTimestamp (required)
* @param segmentTags List of (key, value) pair tags for a segment. Must not contain duplicate values (optional)
* @param version the version of the event (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> A streaming JSON output in multiline JSON format </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getEventsDataAsync(String orgId, String modelId, Long startTimestamp, Long endTimestamp, List<SegmentTag> segmentTags, String version, final ApiCallback<File> _callback) throws ApiException {
okhttp3.Call localVarCall = getEventsDataValidateBeforeCall(orgId, modelId, startTimestamp, endTimestamp, segmentTags, version, _callback);
Type localVarReturnType = new TypeToken<File>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/api/LogApi.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.api;
import ai.whylabs.service.invoker.ApiCallback;
import ai.whylabs.service.invoker.ApiClient;
import ai.whylabs.service.invoker.ApiException;
import ai.whylabs.service.invoker.ApiResponse;
import ai.whylabs.service.invoker.Configuration;
import ai.whylabs.service.invoker.Pair;
import ai.whylabs.service.invoker.ProgressRequestBody;
import ai.whylabs.service.invoker.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import ai.whylabs.service.model.AsyncLogResponse;
import java.io.File;
import ai.whylabs.service.model.LogAsyncRequest;
import ai.whylabs.service.model.LogReferenceRequest;
import ai.whylabs.service.model.LogReferenceResponse;
import ai.whylabs.service.model.LogResponse;
import ai.whylabs.service.model.SegmentTag;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class LogApi {
private ApiClient localVarApiClient;
public LogApi() {
this(Configuration.getDefaultApiClient());
}
public LogApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for log
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. (required)
* @param datasetTimestamp The dataset timestamp associated with the entry. Not required. However, this will override the whylogs dataset timestamp if specified (optional)
* @param segmentTags The segment associated with the log entry. Not required if segment tags are specified in whylogs (optional)
* @param segmentTagsJson (optional)
* @param file The Dataset Profile log entry (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a LogResponse object if succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call logCall(String orgId, String modelId, Long datasetTimestamp, List<SegmentTag> segmentTags, String segmentTagsJson, File file, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/log"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (file != null) {
localVarFormParams.put("file", file);
}
if (modelId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("model_id", modelId));
}
if (datasetTimestamp != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("dataset_timestamp", datasetTimestamp));
}
if (segmentTags != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "segment_tags", segmentTags));
}
if (segmentTagsJson != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("segment_tags_json", segmentTagsJson));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call logValidateBeforeCall(String orgId, String modelId, Long datasetTimestamp, List<SegmentTag> segmentTags, String segmentTagsJson, File file, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling log(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling log(Async)");
}
okhttp3.Call localVarCall = logCall(orgId, modelId, datasetTimestamp, segmentTags, segmentTagsJson, file, _callback);
return localVarCall;
}
/**
* Log a dataset profile entry to the backend
* This method returns a [LogResponse] object if it succeeds
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. (required)
* @param datasetTimestamp The dataset timestamp associated with the entry. Not required. However, this will override the whylogs dataset timestamp if specified (optional)
* @param segmentTags The segment associated with the log entry. Not required if segment tags are specified in whylogs (optional)
* @param segmentTagsJson (optional)
* @param file The Dataset Profile log entry (optional)
* @return LogResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a LogResponse object if succeeds </td><td> - </td></tr>
</table>
*/
public LogResponse log(String orgId, String modelId, Long datasetTimestamp, List<SegmentTag> segmentTags, String segmentTagsJson, File file) throws ApiException {
ApiResponse<LogResponse> localVarResp = logWithHttpInfo(orgId, modelId, datasetTimestamp, segmentTags, segmentTagsJson, file);
return localVarResp.getData();
}
/**
* Log a dataset profile entry to the backend
* This method returns a [LogResponse] object if it succeeds
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. (required)
* @param datasetTimestamp The dataset timestamp associated with the entry. Not required. However, this will override the whylogs dataset timestamp if specified (optional)
* @param segmentTags The segment associated with the log entry. Not required if segment tags are specified in whylogs (optional)
* @param segmentTagsJson (optional)
* @param file The Dataset Profile log entry (optional)
* @return ApiResponse<LogResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a LogResponse object if succeeds </td><td> - </td></tr>
</table>
*/
public ApiResponse<LogResponse> logWithHttpInfo(String orgId, String modelId, Long datasetTimestamp, List<SegmentTag> segmentTags, String segmentTagsJson, File file) throws ApiException {
okhttp3.Call localVarCall = logValidateBeforeCall(orgId, modelId, datasetTimestamp, segmentTags, segmentTagsJson, file, null);
Type localVarReturnType = new TypeToken<LogResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Log a dataset profile entry to the backend (asynchronously)
* This method returns a [LogResponse] object if it succeeds
* @param orgId Your company's unique organization ID (required)
* @param modelId The unique model ID in your company. (required)
* @param datasetTimestamp The dataset timestamp associated with the entry. Not required. However, this will override the whylogs dataset timestamp if specified (optional)
* @param segmentTags The segment associated with the log entry. Not required if segment tags are specified in whylogs (optional)
* @param segmentTagsJson (optional)
* @param file The Dataset Profile log entry (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> a LogResponse object if succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call logAsync(String orgId, String modelId, Long datasetTimestamp, List<SegmentTag> segmentTags, String segmentTagsJson, File file, final ApiCallback<LogResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = logValidateBeforeCall(orgId, modelId, datasetTimestamp, segmentTags, segmentTagsJson, file, _callback);
Type localVarReturnType = new TypeToken<LogResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for logAsync
* @param orgId (required)
* @param datasetId (required)
* @param logAsyncRequest (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogAsync default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call logAsyncCall(String orgId, String datasetId, LogAsyncRequest logAsyncRequest, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = logAsyncRequest;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/log/async/{dataset_id}"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "dataset_id" + "\\}", localVarApiClient.escapeString(datasetId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call logAsyncValidateBeforeCall(String orgId, String datasetId, LogAsyncRequest logAsyncRequest, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling logAsync(Async)");
}
// verify the required parameter 'datasetId' is set
if (datasetId == null) {
throw new ApiException("Missing the required parameter 'datasetId' when calling logAsync(Async)");
}
// verify the required parameter 'logAsyncRequest' is set
if (logAsyncRequest == null) {
throw new ApiException("Missing the required parameter 'logAsyncRequest' when calling logAsync(Async)");
}
okhttp3.Call localVarCall = logAsyncCall(orgId, datasetId, logAsyncRequest, _callback);
return localVarCall;
}
/**
* Like /log, except this api doesn't take the actual profile content. It returns an upload link that can be used to upload the profile to.
* Like /log, except this api doesn't take the actual profile content. It returns an upload link that can be used to upload the profile to.
* @param orgId (required)
* @param datasetId (required)
* @param logAsyncRequest (required)
* @return AsyncLogResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogAsync default response </td><td> - </td></tr>
</table>
*/
public AsyncLogResponse logAsync(String orgId, String datasetId, LogAsyncRequest logAsyncRequest) throws ApiException {
ApiResponse<AsyncLogResponse> localVarResp = logAsyncWithHttpInfo(orgId, datasetId, logAsyncRequest);
return localVarResp.getData();
}
/**
* Like /log, except this api doesn't take the actual profile content. It returns an upload link that can be used to upload the profile to.
* Like /log, except this api doesn't take the actual profile content. It returns an upload link that can be used to upload the profile to.
* @param orgId (required)
* @param datasetId (required)
* @param logAsyncRequest (required)
* @return ApiResponse<AsyncLogResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogAsync default response </td><td> - </td></tr>
</table>
*/
public ApiResponse<AsyncLogResponse> logAsyncWithHttpInfo(String orgId, String datasetId, LogAsyncRequest logAsyncRequest) throws ApiException {
okhttp3.Call localVarCall = logAsyncValidateBeforeCall(orgId, datasetId, logAsyncRequest, null);
Type localVarReturnType = new TypeToken<AsyncLogResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Like /log, except this api doesn't take the actual profile content. It returns an upload link that can be used to upload the profile to. (asynchronously)
* Like /log, except this api doesn't take the actual profile content. It returns an upload link that can be used to upload the profile to.
* @param orgId (required)
* @param datasetId (required)
* @param logAsyncRequest (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogAsync default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call logAsyncAsync(String orgId, String datasetId, LogAsyncRequest logAsyncRequest, final ApiCallback<AsyncLogResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = logAsyncValidateBeforeCall(orgId, datasetId, logAsyncRequest, _callback);
Type localVarReturnType = new TypeToken<AsyncLogResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for logReference
* @param orgId (required)
* @param modelId (required)
* @param logReferenceRequest (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogReference default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call logReferenceCall(String orgId, String modelId, LogReferenceRequest logReferenceRequest, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = logReferenceRequest;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/log/reference/{model_id}"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call logReferenceValidateBeforeCall(String orgId, String modelId, LogReferenceRequest logReferenceRequest, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling logReference(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling logReference(Async)");
}
// verify the required parameter 'logReferenceRequest' is set
if (logReferenceRequest == null) {
throw new ApiException("Missing the required parameter 'logReferenceRequest' when calling logReference(Async)");
}
okhttp3.Call localVarCall = logReferenceCall(orgId, modelId, logReferenceRequest, _callback);
return localVarCall;
}
/**
* Returns a presigned URL for uploading the reference profile to.
* Reference profiles can be used for.
* @param orgId (required)
* @param modelId (required)
* @param logReferenceRequest (required)
* @return LogReferenceResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogReference default response </td><td> - </td></tr>
</table>
*/
public LogReferenceResponse logReference(String orgId, String modelId, LogReferenceRequest logReferenceRequest) throws ApiException {
ApiResponse<LogReferenceResponse> localVarResp = logReferenceWithHttpInfo(orgId, modelId, logReferenceRequest);
return localVarResp.getData();
}
/**
* Returns a presigned URL for uploading the reference profile to.
* Reference profiles can be used for.
* @param orgId (required)
* @param modelId (required)
* @param logReferenceRequest (required)
* @return ApiResponse<LogReferenceResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogReference default response </td><td> - </td></tr>
</table>
*/
public ApiResponse<LogReferenceResponse> logReferenceWithHttpInfo(String orgId, String modelId, LogReferenceRequest logReferenceRequest) throws ApiException {
okhttp3.Call localVarCall = logReferenceValidateBeforeCall(orgId, modelId, logReferenceRequest, null);
Type localVarReturnType = new TypeToken<LogReferenceResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Returns a presigned URL for uploading the reference profile to. (asynchronously)
* Reference profiles can be used for.
* @param orgId (required)
* @param modelId (required)
* @param logReferenceRequest (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> LogReference default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call logReferenceAsync(String orgId, String modelId, LogReferenceRequest logReferenceRequest, final ApiCallback<LogReferenceResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = logReferenceValidateBeforeCall(orgId, modelId, logReferenceRequest, _callback);
Type localVarReturnType = new TypeToken<LogReferenceResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for removeStagedLogEntry
* @param orgId Your company's unique organization ID (required)
* @param logEntryId The unique ID for the log entry (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [LogResponse] object with summary information about the log entry </td><td> - </td></tr>
</table>
*/
public okhttp3.Call removeStagedLogEntryCall(String orgId, String logEntryId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/log/log-entry-id/{log_entry_id}"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "log_entry_id" + "\\}", localVarApiClient.escapeString(logEntryId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call removeStagedLogEntryValidateBeforeCall(String orgId, String logEntryId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling removeStagedLogEntry(Async)");
}
// verify the required parameter 'logEntryId' is set
if (logEntryId == null) {
throw new ApiException("Missing the required parameter 'logEntryId' when calling removeStagedLogEntry(Async)");
}
okhttp3.Call localVarCall = removeStagedLogEntryCall(orgId, logEntryId, _callback);
return localVarCall;
}
/**
* Remove a log entry from 'staging' - effectively remove it from being included in [CreateMergeJob] API calls
* This method returns a [LogResponse] object if it succeeds
* @param orgId Your company's unique organization ID (required)
* @param logEntryId The unique ID for the log entry (required)
* @return LogResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [LogResponse] object with summary information about the log entry </td><td> - </td></tr>
</table>
*/
public LogResponse removeStagedLogEntry(String orgId, String logEntryId) throws ApiException {
ApiResponse<LogResponse> localVarResp = removeStagedLogEntryWithHttpInfo(orgId, logEntryId);
return localVarResp.getData();
}
/**
* Remove a log entry from 'staging' - effectively remove it from being included in [CreateMergeJob] API calls
* This method returns a [LogResponse] object if it succeeds
* @param orgId Your company's unique organization ID (required)
* @param logEntryId The unique ID for the log entry (required)
* @return ApiResponse<LogResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [LogResponse] object with summary information about the log entry </td><td> - </td></tr>
</table>
*/
public ApiResponse<LogResponse> removeStagedLogEntryWithHttpInfo(String orgId, String logEntryId) throws ApiException {
okhttp3.Call localVarCall = removeStagedLogEntryValidateBeforeCall(orgId, logEntryId, null);
Type localVarReturnType = new TypeToken<LogResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Remove a log entry from 'staging' - effectively remove it from being included in [CreateMergeJob] API calls (asynchronously)
* This method returns a [LogResponse] object if it succeeds
* @param orgId Your company's unique organization ID (required)
* @param logEntryId The unique ID for the log entry (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [LogResponse] object with summary information about the log entry </td><td> - </td></tr>
</table>
*/
public okhttp3.Call removeStagedLogEntryAsync(String orgId, String logEntryId, final ApiCallback<LogResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = removeStagedLogEntryValidateBeforeCall(orgId, logEntryId, _callback);
Type localVarReturnType = new TypeToken<LogResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/api/ModelsApi.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.api;
import ai.whylabs.service.invoker.ApiCallback;
import ai.whylabs.service.invoker.ApiClient;
import ai.whylabs.service.invoker.ApiException;
import ai.whylabs.service.invoker.ApiResponse;
import ai.whylabs.service.invoker.Configuration;
import ai.whylabs.service.invoker.Pair;
import ai.whylabs.service.invoker.ProgressRequestBody;
import ai.whylabs.service.invoker.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import ai.whylabs.service.model.ListModelsResponse;
import ai.whylabs.service.model.ListSegmentsResponse;
import ai.whylabs.service.model.ModelMetadata;
import ai.whylabs.service.model.ModelType;
import ai.whylabs.service.model.SegmentMetadata;
import ai.whylabs.service.model.SegmentTag;
import ai.whylabs.service.model.TimePeriod;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ModelsApi {
private ApiClient localVarApiClient;
public ModelsApi() {
this(Configuration.getDefaultApiClient());
}
public ModelsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for createModel
* @param orgId The organization ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createModelCall(String orgId, String modelName, TimePeriod timePeriod, ModelType modelType, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/models"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (modelName != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("model_name", modelName));
}
if (timePeriod != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("time_period", timePeriod));
}
if (modelType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("model_type", modelType));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createModelValidateBeforeCall(String orgId, String modelName, TimePeriod timePeriod, ModelType modelType, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling createModel(Async)");
}
// verify the required parameter 'modelName' is set
if (modelName == null) {
throw new ApiException("Missing the required parameter 'modelName' when calling createModel(Async)");
}
// verify the required parameter 'timePeriod' is set
if (timePeriod == null) {
throw new ApiException("Missing the required parameter 'timePeriod' when calling createModel(Async)");
}
okhttp3.Call localVarCall = createModelCall(orgId, modelName, timePeriod, modelType, _callback);
return localVarCall;
}
/**
* Create a model with a given name and a time period
* Create a model
* @param orgId The organization ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @return ModelMetadata
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public ModelMetadata createModel(String orgId, String modelName, TimePeriod timePeriod, ModelType modelType) throws ApiException {
ApiResponse<ModelMetadata> localVarResp = createModelWithHttpInfo(orgId, modelName, timePeriod, modelType);
return localVarResp.getData();
}
/**
* Create a model with a given name and a time period
* Create a model
* @param orgId The organization ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @return ApiResponse<ModelMetadata>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public ApiResponse<ModelMetadata> createModelWithHttpInfo(String orgId, String modelName, TimePeriod timePeriod, ModelType modelType) throws ApiException {
okhttp3.Call localVarCall = createModelValidateBeforeCall(orgId, modelName, timePeriod, modelType, null);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a model with a given name and a time period (asynchronously)
* Create a model
* @param orgId The organization ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createModelAsync(String orgId, String modelName, TimePeriod timePeriod, ModelType modelType, final ApiCallback<ModelMetadata> _callback) throws ApiException {
okhttp3.Call localVarCall = createModelValidateBeforeCall(orgId, modelName, timePeriod, modelType, _callback);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for deactivateModel
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deactivateModelCall(String orgId, String modelId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/models/{model_id}"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deactivateModelValidateBeforeCall(String orgId, String modelId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling deactivateModel(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling deactivateModel(Async)");
}
okhttp3.Call localVarCall = deactivateModelCall(orgId, modelId, _callback);
return localVarCall;
}
/**
* Mark a model as inactive
* Mark a model as inactive
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @return ModelMetadata
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public ModelMetadata deactivateModel(String orgId, String modelId) throws ApiException {
ApiResponse<ModelMetadata> localVarResp = deactivateModelWithHttpInfo(orgId, modelId);
return localVarResp.getData();
}
/**
* Mark a model as inactive
* Mark a model as inactive
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @return ApiResponse<ModelMetadata>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public ApiResponse<ModelMetadata> deactivateModelWithHttpInfo(String orgId, String modelId) throws ApiException {
okhttp3.Call localVarCall = deactivateModelValidateBeforeCall(orgId, modelId, null);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Mark a model as inactive (asynchronously)
* Mark a model as inactive
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call deactivateModelAsync(String orgId, String modelId, final ApiCallback<ModelMetadata> _callback) throws ApiException {
okhttp3.Call localVarCall = deactivateModelValidateBeforeCall(orgId, modelId, _callback);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getModel
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ModelMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getModelCall(String orgId, String modelId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/models/{model_id}"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getModelValidateBeforeCall(String orgId, String modelId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling getModel(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling getModel(Async)");
}
okhttp3.Call localVarCall = getModelCall(orgId, modelId, _callback);
return localVarCall;
}
/**
* Get a model metadata
* Returns various metadata about a model
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @return ModelMetadata
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ModelMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public ModelMetadata getModel(String orgId, String modelId) throws ApiException {
ApiResponse<ModelMetadata> localVarResp = getModelWithHttpInfo(orgId, modelId);
return localVarResp.getData();
}
/**
* Get a model metadata
* Returns various metadata about a model
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @return ApiResponse<ModelMetadata>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ModelMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public ApiResponse<ModelMetadata> getModelWithHttpInfo(String orgId, String modelId) throws ApiException {
okhttp3.Call localVarCall = getModelValidateBeforeCall(orgId, modelId, null);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a model metadata (asynchronously)
* Returns various metadata about a model
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ModelMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getModelAsync(String orgId, String modelId, final ApiCallback<ModelMetadata> _callback) throws ApiException {
okhttp3.Call localVarCall = getModelValidateBeforeCall(orgId, modelId, _callback);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for listModels
* @param orgId Your company's unique organization ID (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of model summary items </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listModelsCall(String orgId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/models"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listModelsValidateBeforeCall(String orgId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling listModels(Async)");
}
okhttp3.Call localVarCall = listModelsCall(orgId, _callback);
return localVarCall;
}
/**
* Get a list of all of the model ids for an organization.
* Get a list of all of the model ids for an organization.
* @param orgId Your company's unique organization ID (required)
* @return ListModelsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of model summary items </td><td> - </td></tr>
</table>
*/
public ListModelsResponse listModels(String orgId) throws ApiException {
ApiResponse<ListModelsResponse> localVarResp = listModelsWithHttpInfo(orgId);
return localVarResp.getData();
}
/**
* Get a list of all of the model ids for an organization.
* Get a list of all of the model ids for an organization.
* @param orgId Your company's unique organization ID (required)
* @return ApiResponse<ListModelsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of model summary items </td><td> - </td></tr>
</table>
*/
public ApiResponse<ListModelsResponse> listModelsWithHttpInfo(String orgId) throws ApiException {
okhttp3.Call localVarCall = listModelsValidateBeforeCall(orgId, null);
Type localVarReturnType = new TypeToken<ListModelsResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a list of all of the model ids for an organization. (asynchronously)
* Get a list of all of the model ids for an organization.
* @param orgId Your company's unique organization ID (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A list of model summary items </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listModelsAsync(String orgId, final ApiCallback<ListModelsResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = listModelsValidateBeforeCall(orgId, _callback);
Type localVarReturnType = new TypeToken<ListModelsResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for listSegments
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ListSegmentsResponse] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listSegmentsCall(String orgId, String modelId, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/models/{model_id}/segments"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listSegmentsValidateBeforeCall(String orgId, String modelId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling listSegments(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling listSegments(Async)");
}
okhttp3.Call localVarCall = listSegmentsCall(orgId, modelId, _callback);
return localVarCall;
}
/**
* Get a model metadata
* Returns the list of Segments for a given model
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @return ListSegmentsResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ListSegmentsResponse] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public ListSegmentsResponse listSegments(String orgId, String modelId) throws ApiException {
ApiResponse<ListSegmentsResponse> localVarResp = listSegmentsWithHttpInfo(orgId, modelId);
return localVarResp.getData();
}
/**
* Get a model metadata
* Returns the list of Segments for a given model
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @return ApiResponse<ListSegmentsResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ListSegmentsResponse] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public ApiResponse<ListSegmentsResponse> listSegmentsWithHttpInfo(String orgId, String modelId) throws ApiException {
okhttp3.Call localVarCall = listSegmentsValidateBeforeCall(orgId, modelId, null);
Type localVarReturnType = new TypeToken<ListSegmentsResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a model metadata (asynchronously)
* Returns the list of Segments for a given model
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [ListSegmentsResponse] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call listSegmentsAsync(String orgId, String modelId, final ApiCallback<ListSegmentsResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = listSegmentsValidateBeforeCall(orgId, modelId, _callback);
Type localVarReturnType = new TypeToken<ListSegmentsResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for putSegments
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param segmentTag List of segment tags to create the segment for (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [SegmentMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call putSegmentsCall(String orgId, String modelId, List<SegmentTag> segmentTag, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = segmentTag;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/models/{model_id}/segments"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call putSegmentsValidateBeforeCall(String orgId, String modelId, List<SegmentTag> segmentTag, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling putSegments(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling putSegments(Async)");
}
// verify the required parameter 'segmentTag' is set
if (segmentTag == null) {
throw new ApiException("Missing the required parameter 'segmentTag' when calling putSegments(Async)");
}
okhttp3.Call localVarCall = putSegmentsCall(orgId, modelId, segmentTag, _callback);
return localVarCall;
}
/**
* Add a segment to the dataset
* Return 200 if succeeds
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param segmentTag List of segment tags to create the segment for (required)
* @return SegmentMetadata
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [SegmentMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public SegmentMetadata putSegments(String orgId, String modelId, List<SegmentTag> segmentTag) throws ApiException {
ApiResponse<SegmentMetadata> localVarResp = putSegmentsWithHttpInfo(orgId, modelId, segmentTag);
return localVarResp.getData();
}
/**
* Add a segment to the dataset
* Return 200 if succeeds
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param segmentTag List of segment tags to create the segment for (required)
* @return ApiResponse<SegmentMetadata>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [SegmentMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public ApiResponse<SegmentMetadata> putSegmentsWithHttpInfo(String orgId, String modelId, List<SegmentTag> segmentTag) throws ApiException {
okhttp3.Call localVarCall = putSegmentsValidateBeforeCall(orgId, modelId, segmentTag, null);
Type localVarReturnType = new TypeToken<SegmentMetadata>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Add a segment to the dataset (asynchronously)
* Return 200 if succeeds
* @param orgId The name of an organization (required)
* @param modelId The ID of a model (required)
* @param segmentTag List of segment tags to create the segment for (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A [SegmentMetadata] object if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call putSegmentsAsync(String orgId, String modelId, List<SegmentTag> segmentTag, final ApiCallback<SegmentMetadata> _callback) throws ApiException {
okhttp3.Call localVarCall = putSegmentsValidateBeforeCall(orgId, modelId, segmentTag, _callback);
Type localVarReturnType = new TypeToken<SegmentMetadata>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateModel
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateModelCall(String orgId, String modelId, String modelName, TimePeriod timePeriod, ModelType modelType, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/organizations/{org_id}/models/{model_id}"
.replaceAll("\\{" + "org_id" + "\\}", localVarApiClient.escapeString(orgId.toString()))
.replaceAll("\\{" + "model_id" + "\\}", localVarApiClient.escapeString(modelId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (modelName != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("model_name", modelName));
}
if (timePeriod != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("time_period", timePeriod));
}
if (modelType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("model_type", modelType));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateModelValidateBeforeCall(String orgId, String modelId, String modelName, TimePeriod timePeriod, ModelType modelType, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orgId' is set
if (orgId == null) {
throw new ApiException("Missing the required parameter 'orgId' when calling updateModel(Async)");
}
// verify the required parameter 'modelId' is set
if (modelId == null) {
throw new ApiException("Missing the required parameter 'modelId' when calling updateModel(Async)");
}
// verify the required parameter 'modelName' is set
if (modelName == null) {
throw new ApiException("Missing the required parameter 'modelName' when calling updateModel(Async)");
}
// verify the required parameter 'timePeriod' is set
if (timePeriod == null) {
throw new ApiException("Missing the required parameter 'timePeriod' when calling updateModel(Async)");
}
okhttp3.Call localVarCall = updateModelCall(orgId, modelId, modelName, timePeriod, modelType, _callback);
return localVarCall;
}
/**
* Update a model's metadata
* Update a model's metadata
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @return ModelMetadata
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public ModelMetadata updateModel(String orgId, String modelId, String modelName, TimePeriod timePeriod, ModelType modelType) throws ApiException {
ApiResponse<ModelMetadata> localVarResp = updateModelWithHttpInfo(orgId, modelId, modelName, timePeriod, modelType);
return localVarResp.getData();
}
/**
* Update a model's metadata
* Update a model's metadata
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @return ApiResponse<ModelMetadata>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public ApiResponse<ModelMetadata> updateModelWithHttpInfo(String orgId, String modelId, String modelName, TimePeriod timePeriod, ModelType modelType) throws ApiException {
okhttp3.Call localVarCall = updateModelValidateBeforeCall(orgId, modelId, modelName, timePeriod, modelType, null);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update a model's metadata (asynchronously)
* Update a model's metadata
* @param orgId The organization ID (required)
* @param modelId The model ID (required)
* @param modelName The name of a model (required)
* @param timePeriod The [TimePeriod] for data aggregation/alerting for a model (required)
* @param modelType The [ModelType] of the dataset (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> The [ModelMetadata] if operation succeeds </td><td> - </td></tr>
</table>
*/
public okhttp3.Call updateModelAsync(String orgId, String modelId, String modelName, TimePeriod timePeriod, ModelType modelType, final ApiCallback<ModelMetadata> _callback) throws ApiException {
okhttp3.Call localVarCall = updateModelValidateBeforeCall(orgId, modelId, modelName, timePeriod, modelType, _callback);
Type localVarReturnType = new TypeToken<ModelMetadata>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/api/SessionsApi.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.api;
import ai.whylabs.service.invoker.ApiCallback;
import ai.whylabs.service.invoker.ApiClient;
import ai.whylabs.service.invoker.ApiException;
import ai.whylabs.service.invoker.ApiResponse;
import ai.whylabs.service.invoker.Configuration;
import ai.whylabs.service.invoker.Pair;
import ai.whylabs.service.invoker.ProgressRequestBody;
import ai.whylabs.service.invoker.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import ai.whylabs.service.model.CloseSessionResponse;
import ai.whylabs.service.model.CreateSessionResponse;
import ai.whylabs.service.model.CreateSessionUploadResponse;
import ai.whylabs.service.model.GetSessionResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SessionsApi {
private ApiClient localVarApiClient;
public SessionsApi() {
this(Configuration.getDefaultApiClient());
}
public SessionsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for closeSession
* @param sessionToken (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> CloseSession default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call closeSessionCall(String sessionToken, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/sessions/{session_token}/close"
.replaceAll("\\{" + "session_token" + "\\}", localVarApiClient.escapeString(sessionToken.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call closeSessionValidateBeforeCall(String sessionToken, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException("Missing the required parameter 'sessionToken' when calling closeSession(Async)");
}
okhttp3.Call localVarCall = closeSessionCall(sessionToken, _callback);
return localVarCall;
}
/**
* naddeo Close a session, triggering its display in whylabs and making it no longer accept any additional data.
* naddeo Close a session, triggering its display in whylabs and making it no longer accept any additional data.
* @param sessionToken (required)
* @return CloseSessionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> CloseSession default response </td><td> - </td></tr>
</table>
*/
public CloseSessionResponse closeSession(String sessionToken) throws ApiException {
ApiResponse<CloseSessionResponse> localVarResp = closeSessionWithHttpInfo(sessionToken);
return localVarResp.getData();
}
/**
* naddeo Close a session, triggering its display in whylabs and making it no longer accept any additional data.
* naddeo Close a session, triggering its display in whylabs and making it no longer accept any additional data.
* @param sessionToken (required)
* @return ApiResponse<CloseSessionResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> CloseSession default response </td><td> - </td></tr>
</table>
*/
public ApiResponse<CloseSessionResponse> closeSessionWithHttpInfo(String sessionToken) throws ApiException {
okhttp3.Call localVarCall = closeSessionValidateBeforeCall(sessionToken, null);
Type localVarReturnType = new TypeToken<CloseSessionResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* naddeo Close a session, triggering its display in whylabs and making it no longer accept any additional data. (asynchronously)
* naddeo Close a session, triggering its display in whylabs and making it no longer accept any additional data.
* @param sessionToken (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> CloseSession default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call closeSessionAsync(String sessionToken, final ApiCallback<CloseSessionResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = closeSessionValidateBeforeCall(sessionToken, _callback);
Type localVarReturnType = new TypeToken<CloseSessionResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createDatasetProfileUpload
* @param sessionToken (required)
* @param datasetTimestamp (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A url that a dataset profile can be uploaded to. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createDatasetProfileUploadCall(String sessionToken, Long datasetTimestamp, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/sessions/{session_token}/upload"
.replaceAll("\\{" + "session_token" + "\\}", localVarApiClient.escapeString(sessionToken.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (datasetTimestamp != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("dataset_timestamp", datasetTimestamp));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createDatasetProfileUploadValidateBeforeCall(String sessionToken, Long datasetTimestamp, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException("Missing the required parameter 'sessionToken' when calling createDatasetProfileUpload(Async)");
}
okhttp3.Call localVarCall = createDatasetProfileUploadCall(sessionToken, datasetTimestamp, _callback);
return localVarCall;
}
/**
* Create an upload for a given session.
* Create an upload for a given session.
* @param sessionToken (required)
* @param datasetTimestamp (optional)
* @return CreateSessionUploadResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A url that a dataset profile can be uploaded to. </td><td> - </td></tr>
</table>
*/
public CreateSessionUploadResponse createDatasetProfileUpload(String sessionToken, Long datasetTimestamp) throws ApiException {
ApiResponse<CreateSessionUploadResponse> localVarResp = createDatasetProfileUploadWithHttpInfo(sessionToken, datasetTimestamp);
return localVarResp.getData();
}
/**
* Create an upload for a given session.
* Create an upload for a given session.
* @param sessionToken (required)
* @param datasetTimestamp (optional)
* @return ApiResponse<CreateSessionUploadResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A url that a dataset profile can be uploaded to. </td><td> - </td></tr>
</table>
*/
public ApiResponse<CreateSessionUploadResponse> createDatasetProfileUploadWithHttpInfo(String sessionToken, Long datasetTimestamp) throws ApiException {
okhttp3.Call localVarCall = createDatasetProfileUploadValidateBeforeCall(sessionToken, datasetTimestamp, null);
Type localVarReturnType = new TypeToken<CreateSessionUploadResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create an upload for a given session. (asynchronously)
* Create an upload for a given session.
* @param sessionToken (required)
* @param datasetTimestamp (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A url that a dataset profile can be uploaded to. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createDatasetProfileUploadAsync(String sessionToken, Long datasetTimestamp, final ApiCallback<CreateSessionUploadResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = createDatasetProfileUploadValidateBeforeCall(sessionToken, datasetTimestamp, _callback);
Type localVarReturnType = new TypeToken<CreateSessionUploadResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for createSession
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A new session id that can be used to upload dataset profiles. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createSessionCall(final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/sessions";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createSessionValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createSessionCall(_callback);
return localVarCall;
}
/**
* Create a new session that can be used to upload dataset profiles from whylogs for display in whylabs.
* Create a new session that can be used to upload dataset profiles from whylogs for display in whylabs.
* @return CreateSessionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A new session id that can be used to upload dataset profiles. </td><td> - </td></tr>
</table>
*/
public CreateSessionResponse createSession() throws ApiException {
ApiResponse<CreateSessionResponse> localVarResp = createSessionWithHttpInfo();
return localVarResp.getData();
}
/**
* Create a new session that can be used to upload dataset profiles from whylogs for display in whylabs.
* Create a new session that can be used to upload dataset profiles from whylogs for display in whylabs.
* @return ApiResponse<CreateSessionResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A new session id that can be used to upload dataset profiles. </td><td> - </td></tr>
</table>
*/
public ApiResponse<CreateSessionResponse> createSessionWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = createSessionValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<CreateSessionResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Create a new session that can be used to upload dataset profiles from whylogs for display in whylabs. (asynchronously)
* Create a new session that can be used to upload dataset profiles from whylogs for display in whylabs.
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> A new session id that can be used to upload dataset profiles. </td><td> - </td></tr>
</table>
*/
public okhttp3.Call createSessionAsync(final ApiCallback<CreateSessionResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = createSessionValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<CreateSessionResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getSession
* @param sessionToken (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> GetSession default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSessionCall(String sessionToken, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v0/sessions/{session_token}"
.replaceAll("\\{" + "session_token" + "\\}", localVarApiClient.escapeString(sessionToken.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getSessionValidateBeforeCall(String sessionToken, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException("Missing the required parameter 'sessionToken' when calling getSession(Async)");
}
okhttp3.Call localVarCall = getSessionCall(sessionToken, _callback);
return localVarCall;
}
/**
* Get information about a session.
* Get information about a session.
* @param sessionToken (required)
* @return GetSessionResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> GetSession default response </td><td> - </td></tr>
</table>
*/
public GetSessionResponse getSession(String sessionToken) throws ApiException {
ApiResponse<GetSessionResponse> localVarResp = getSessionWithHttpInfo(sessionToken);
return localVarResp.getData();
}
/**
* Get information about a session.
* Get information about a session.
* @param sessionToken (required)
* @return ApiResponse<GetSessionResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> GetSession default response </td><td> - </td></tr>
</table>
*/
public ApiResponse<GetSessionResponse> getSessionWithHttpInfo(String sessionToken) throws ApiException {
okhttp3.Call localVarCall = getSessionValidateBeforeCall(sessionToken, null);
Type localVarReturnType = new TypeToken<GetSessionResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get information about a session. (asynchronously)
* Get information about a session.
* @param sessionToken (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 0 </td><td> GetSession default response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getSessionAsync(String sessionToken, final ApiCallback<GetSessionResponse> _callback) throws ApiException {
okhttp3.Call localVarCall = getSessionValidateBeforeCall(sessionToken, _callback);
Type localVarReturnType = new TypeToken<GetSessionResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ApiCallback.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import java.io.IOException;
import java.util.Map;
import java.util.List;
/**
* Callback for asynchronous API call.
*
* @param <T> The return type
*/
public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it would be 0
* @param responseHeaders Headers of the response if available, otherwise it would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
/**
* This is called when the API downlond processing.
*
* @param bytesRead bytes Read
* @param contentLength content lenngth of the response
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ApiClient.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import okhttp3.*;
import okhttp3.internal.http.HttpMethod;
import okhttp3.internal.tls.OkHostnameVerifier;
import okhttp3.logging.HttpLoggingInterceptor;
import okhttp3.logging.HttpLoggingInterceptor.Level;
import okio.BufferedSink;
import okio.Okio;
import javax.net.ssl.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.text.DateFormat;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import ai.whylabs.service.invoker.auth.Authentication;
import ai.whylabs.service.invoker.auth.HttpBasicAuth;
import ai.whylabs.service.invoker.auth.HttpBearerAuth;
import ai.whylabs.service.invoker.auth.ApiKeyAuth;
public class ApiClient {
private String basePath = "http://localhost";
private boolean debugging = false;
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
private String tempFolderPath = null;
private Map<String, Authentication> authentications;
private DateFormat dateFormat;
private DateFormat datetimeFormat;
private boolean lenientDatetimeFormat;
private int dateLength;
private InputStream sslCaCert;
private boolean verifyingSsl;
private KeyManager[] keyManagers;
private OkHttpClient httpClient;
private JSON json;
private HttpLoggingInterceptor loggingInterceptor;
/*
* Basic constructor for ApiClient
*/
public ApiClient() {
init();
initHttpClient();
// Setup authentications (key: authentication name, value: authentication).
authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-API-Key"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
/*
* Basic constructor with custom OkHttpClient
*/
public ApiClient(OkHttpClient client) {
init();
httpClient = client;
// Setup authentications (key: authentication name, value: authentication).
authentications.put("ApiKeyAuth", new ApiKeyAuth("header", "X-API-Key"));
// Prevent the authentications from being modified.
authentications = Collections.unmodifiableMap(authentications);
}
private void initHttpClient() {
initHttpClient(Collections.<Interceptor>emptyList());
}
private void initHttpClient(List<Interceptor> interceptors) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.addNetworkInterceptor(getProgressInterceptor());
for (Interceptor interceptor: interceptors) {
builder.addInterceptor(interceptor);
}
httpClient = builder.build();
}
private void init() {
verifyingSsl = true;
json = new JSON();
// Set default User-Agent.
setUserAgent("whylabs-service-api/1.0/java");
authentications = new HashMap<String, Authentication>();
}
/**
* Get base path
*
* @return Base path
*/
public String getBasePath() {
return basePath;
}
/**
* Set base path
*
* @param basePath Base path of the URL (e.g http://localhost
* @return An instance of OkHttpClient
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
return this;
}
/**
* Get HTTP client
*
* @return An instance of OkHttpClient
*/
public OkHttpClient getHttpClient() {
return httpClient;
}
/**
* Set HTTP client, which must never be null.
*
* @param newHttpClient An instance of OkHttpClient
* @return Api Client
* @throws NullPointerException when newHttpClient is null
*/
public ApiClient setHttpClient(OkHttpClient newHttpClient) {
this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!");
return this;
}
/**
* Get JSON
*
* @return JSON object
*/
public JSON getJSON() {
return json;
}
/**
* Set JSON
*
* @param json JSON object
* @return Api client
*/
public ApiClient setJSON(JSON json) {
this.json = json;
return this;
}
/**
* True if isVerifyingSsl flag is on
*
* @return True if isVerifySsl flag is on
*/
public boolean isVerifyingSsl() {
return verifyingSsl;
}
/**
* Configure whether to verify certificate and hostname when making https requests.
* Default to true.
* NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks.
*
* @param verifyingSsl True to verify TLS/SSL connection
* @return ApiClient
*/
public ApiClient setVerifyingSsl(boolean verifyingSsl) {
this.verifyingSsl = verifyingSsl;
applySslSettings();
return this;
}
/**
* Get SSL CA cert.
*
* @return Input stream to the SSL CA cert
*/
public InputStream getSslCaCert() {
return sslCaCert;
}
/**
* Configure the CA certificate to be trusted when making https requests.
* Use null to reset to default.
*
* @param sslCaCert input stream for SSL CA cert
* @return ApiClient
*/
public ApiClient setSslCaCert(InputStream sslCaCert) {
this.sslCaCert = sslCaCert;
applySslSettings();
return this;
}
public KeyManager[] getKeyManagers() {
return keyManagers;
}
/**
* Configure client keys to use for authorization in an SSL session.
* Use null to reset to default.
*
* @param managers The KeyManagers to use
* @return ApiClient
*/
public ApiClient setKeyManagers(KeyManager[] managers) {
this.keyManagers = managers;
applySslSettings();
return this;
}
public DateFormat getDateFormat() {
return dateFormat;
}
public ApiClient setDateFormat(DateFormat dateFormat) {
this.json.setDateFormat(dateFormat);
return this;
}
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
this.json.setSqlDateFormat(dateFormat);
return this;
}
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
this.json.setOffsetDateTimeFormat(dateFormat);
return this;
}
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
this.json.setLocalDateFormat(dateFormat);
return this;
}
public ApiClient setLenientOnJson(boolean lenientOnJson) {
this.json.setLenientOnJson(lenientOnJson);
return this;
}
/**
* Get authentications (key: authentication name, value: authentication).
*
* @return Map of authentication objects
*/
public Map<String, Authentication> getAuthentications() {
return authentications;
}
/**
* Get authentication for the given name.
*
* @param authName The authentication name
* @return The authentication, null if not found
*/
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
/**
* Helper method to set username for the first HTTP basic authentication.
*
* @param username Username
*/
public void setUsername(String username) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setUsername(username);
return;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
/**
* Helper method to set password for the first HTTP basic authentication.
*
* @param password Password
*/
public void setPassword(String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setPassword(password);
return;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
/**
* Helper method to set API key value for the first API key authentication.
*
* @param apiKey API key
*/
public void setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set API key prefix for the first API key authentication.
*
* @param apiKeyPrefix API key prefix
*/
public void setApiKeyPrefix(String apiKeyPrefix) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
return;
}
}
throw new RuntimeException("No API key authentication configured!");
}
/**
* Helper method to set access token for the first OAuth2 authentication.
*
* @param accessToken Access token
*/
public void setAccessToken(String accessToken) {
throw new RuntimeException("No OAuth2 authentication configured!");
}
/**
* Set the User-Agent header's value (by adding to the default header map).
*
* @param userAgent HTTP request's user agent
* @return ApiClient
*/
public ApiClient setUserAgent(String userAgent) {
addDefaultHeader("User-Agent", userAgent);
return this;
}
/**
* Add a default header.
*
* @param key The header's key
* @param value The header's value
* @return ApiClient
*/
public ApiClient addDefaultHeader(String key, String value) {
defaultHeaderMap.put(key, value);
return this;
}
/**
* Add a default cookie.
*
* @param key The cookie's key
* @param value The cookie's value
* @return ApiClient
*/
public ApiClient addDefaultCookie(String key, String value) {
defaultCookieMap.put(key, value);
return this;
}
/**
* Check that whether debugging is enabled for this API client.
*
* @return True if debugging is enabled, false otherwise.
*/
public boolean isDebugging() {
return debugging;
}
/**
* Enable/disable debugging for this API client.
*
* @param debugging To enable (true) or disable (false) debugging
* @return ApiClient
*/
public ApiClient setDebugging(boolean debugging) {
if (debugging != this.debugging) {
if (debugging) {
loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(Level.BODY);
httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build();
} else {
final OkHttpClient.Builder builder = httpClient.newBuilder();
builder.interceptors().remove(loggingInterceptor);
httpClient = builder.build();
loggingInterceptor = null;
}
}
this.debugging = debugging;
return this;
}
/**
* The path of temporary folder used to store downloaded files from endpoints
* with file response. The default value is <code>null</code>, i.e. using
* the system's default tempopary folder.
*
* @see <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempFile(java.lang.String,%20java.lang.String,%20java.nio.file.attribute.FileAttribute...)">createTempFile</a>
* @return Temporary folder path
*/
public String getTempFolderPath() {
return tempFolderPath;
}
/**
* Set the temporary folder path (for downloading files)
*
* @param tempFolderPath Temporary folder path
* @return ApiClient
*/
public ApiClient setTempFolderPath(String tempFolderPath) {
this.tempFolderPath = tempFolderPath;
return this;
}
/**
* Get connection timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getConnectTimeout() {
return httpClient.connectTimeoutMillis();
}
/**
* Sets the connect timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link Integer#MAX_VALUE}.
*
* @param connectionTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setConnectTimeout(int connectionTimeout) {
httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Get read timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getReadTimeout() {
return httpClient.readTimeoutMillis();
}
/**
* Sets the read timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link Integer#MAX_VALUE}.
*
* @param readTimeout read timeout in milliseconds
* @return Api client
*/
public ApiClient setReadTimeout(int readTimeout) {
httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Get write timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getWriteTimeout() {
return httpClient.writeTimeoutMillis();
}
/**
* Sets the write timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link Integer#MAX_VALUE}.
*
* @param writeTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setWriteTimeout(int writeTimeout) {
httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build();
return this;
}
/**
* Format the given parameter object into string.
*
* @param param Parameter
* @return String representation of the parameter
*/
public String parameterToString(Object param) {
if (param == null) {
return "";
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
//Serialize to json string and remove the " enclosing characters
String jsonStr = json.serialize(param);
return jsonStr.substring(1, jsonStr.length() - 1);
} else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
for (Object o : (Collection) param) {
if (b.length() > 0) {
b.append(",");
}
b.append(String.valueOf(o));
}
return b.toString();
} else {
return String.valueOf(param);
}
}
/**
* Formats the specified query parameter to a list containing a single {@code Pair} object.
*
* Note that {@code value} must not be a collection.
*
* @param name The name of the parameter.
* @param value The value of the parameter.
* @return A list containing a single {@code Pair} object.
*/
public List<Pair> parameterToPair(String name, Object value) {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
return params;
}
params.add(new Pair(name, parameterToString(value)));
return params;
}
/**
* Formats the specified collection query parameters to a list of {@code Pair} objects.
*
* Note that the values of each of the returned Pair objects are percent-encoded.
*
* @param collectionFormat The collection format of the parameter.
* @param name The name of the parameter.
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}
// create the params based on the collection format
if ("multi".equals(collectionFormat)) {
for (Object item : value) {
params.add(new Pair(name, escapeString(parameterToString(item))));
}
return params;
}
// collectionFormat is assumed to be "csv" by default
String delimiter = ",";
// escape all delimiters except commas, which are URI reserved
// characters
if ("ssv".equals(collectionFormat)) {
delimiter = escapeString(" ");
} else if ("tsv".equals(collectionFormat)) {
delimiter = escapeString("\t");
} else if ("pipes".equals(collectionFormat)) {
delimiter = escapeString("|");
}
StringBuilder sb = new StringBuilder();
for (Object item : value) {
sb.append(delimiter);
sb.append(escapeString(parameterToString(item)));
}
params.add(new Pair(name, sb.substring(delimiter.length())));
return params;
}
/**
* Formats the specified collection path parameter to a string value.
*
* @param collectionFormat The collection format of the parameter.
* @param value The value of the parameter.
* @return String representation of the parameter
*/
public String collectionPathParameterToString(String collectionFormat, Collection value) {
// create the value based on the collection format
if ("multi".equals(collectionFormat)) {
// not valid for path params
return parameterToString(value);
}
// collectionFormat is assumed to be "csv" by default
String delimiter = ",";
if ("ssv".equals(collectionFormat)) {
delimiter = " ";
} else if ("tsv".equals(collectionFormat)) {
delimiter = "\t";
} else if ("pipes".equals(collectionFormat)) {
delimiter = "|";
}
StringBuilder sb = new StringBuilder() ;
for (Object item : value) {
sb.append(delimiter);
sb.append(parameterToString(item));
}
return sb.substring(delimiter.length());
}
/**
* Sanitize filename by removing path.
* e.g. ../../sun.gif becomes sun.gif
*
* @param filename The filename to be sanitized
* @return The sanitized filename
*/
public String sanitizeFilename(String filename) {
return filename.replaceAll(".*[/\\\\]", "");
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* "* / *" is also default to JSON
* @param mime MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**
* Select the Accept header's value from the given accepts array:
* if JSON exists in the given array, use it;
* otherwise use all of them (joining into a string)
*
* @param accepts The accepts array to select from
* @return The Accept header to use. If the given array is empty,
* null will be returned (not to set the Accept header explicitly).
*/
public String selectHeaderAccept(String[] accepts) {
if (accepts.length == 0) {
return null;
}
for (String accept : accepts) {
if (isJsonMime(accept)) {
return accept;
}
}
return StringUtil.join(accepts, ",");
}
/**
* Select the Content-Type header's value from the given array:
* if JSON exists in the given array, use it;
* otherwise use the first one of the array.
*
* @param contentTypes The Content-Type array to select from
* @return The Content-Type header to use. If the given array is empty,
* or matches "any", JSON will be used.
*/
public String selectHeaderContentType(String[] contentTypes) {
if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) {
return "application/json";
}
for (String contentType : contentTypes) {
if (isJsonMime(contentType)) {
return contentType;
}
}
return contentTypes[0];
}
/**
* Escape the given string to be used as URL query value.
*
* @param str String to be escaped
* @return Escaped string
*/
public String escapeString(String str) {
try {
return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
} catch (UnsupportedEncodingException e) {
return str;
}
}
/**
* Deserialize response body to Java object, according to the return type and
* the Content-Type response header.
*
* @param <T> Type
* @param response HTTP response
* @param returnType The type of the Java object
* @return The deserialized Java object
* @throws ApiException If fail to deserialize response body, i.e. cannot read response body
* or the Content-Type of the response is not supported.
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, Type returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
}
if ("byte[]".equals(returnType.toString())) {
// Handle binary response (byte array).
try {
return (T) response.body().bytes();
} catch (IOException e) {
throw new ApiException(e);
}
} else if (returnType.equals(File.class)) {
// Handle file downloading.
return (T) downloadFileFromResponse(response);
}
String respBody;
try {
if (response.body() != null)
respBody = response.body().string();
else
respBody = null;
} catch (IOException e) {
throw new ApiException(e);
}
if (respBody == null || "".equals(respBody)) {
return null;
}
String contentType = response.headers().get("Content-Type");
if (contentType == null) {
// ensuring a default content type
contentType = "application/json";
}
if (isJsonMime(contentType)) {
return json.deserialize(respBody, returnType);
} else if (returnType.equals(String.class)) {
// Expecting string, return the raw response body.
return (T) respBody;
} else {
throw new ApiException(
"Content type \"" + contentType + "\" is not supported for type: " + returnType,
response.code(),
response.headers().toMultimap(),
respBody);
}
}
/**
* Serialize the given Java object into request body according to the object's
* class and the request Content-Type.
*
* @param obj The Java object
* @param contentType The request Content-Type
* @return The serialized request body
* @throws ApiException If fail to serialize the given object
*/
public RequestBody serialize(Object obj, String contentType) throws ApiException {
if (obj instanceof byte[]) {
// Binary (byte array) body parameter support.
return RequestBody.create((byte[]) obj, MediaType.parse(contentType));
} else if (obj instanceof File) {
// File body parameter support.
return RequestBody.create((File) obj, MediaType.parse(contentType));
} else if (isJsonMime(contentType)) {
String content;
if (obj != null) {
content = json.serialize(obj);
} else {
content = null;
}
return RequestBody.create(content, MediaType.parse(contentType));
} else {
throw new ApiException("Content type \"" + contentType + "\" is not supported");
}
}
/**
* Download file from the given response.
*
* @param response An instance of the Response object
* @throws ApiException If fail to read file content from response and write to disk
* @return Downloaded file
*/
public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
BufferedSink sink = Okio.buffer(Okio.sink(file));
sink.writeAll(response.body().source());
sink.close();
return file;
} catch (IOException e) {
throw new ApiException(e);
}
}
/**
* Prepare file for download
*
* @param response An instance of the Response object
* @return Prepared file for the download
* @throws IOException If fail to prepare file for download
*/
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
String contentDisposition = response.header("Content-Disposition");
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find()) {
filename = sanitizeFilename(matcher.group(1));
}
}
String prefix = null;
String suffix = null;
if (filename == null) {
prefix = "download-";
suffix = "";
} else {
int pos = filename.lastIndexOf(".");
if (pos == -1) {
prefix = filename + "-";
} else {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// Files.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return Files.createTempFile(prefix, suffix).toFile();
else
return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
}
/**
* {@link #execute(Call, Type)}
*
* @param <T> Type
* @param call An instance of the Call object
* @return ApiResponse<T>
* @throws ApiException If fail to execute the call
*/
public <T> ApiResponse<T> execute(Call call) throws ApiException {
return execute(call, null);
}
/**
* Execute HTTP call and deserialize the HTTP response body into the given return type.
*
* @param returnType The return type used to deserialize HTTP response body
* @param <T> The return type corresponding to (same with) returnType
* @param call Call
* @return ApiResponse object containing response status, headers and
* data, which is a Java object deserialized from response body and would be null
* when returnType is null.
* @throws ApiException If fail to execute the call
*/
public <T> ApiResponse<T> execute(Call call, Type returnType) throws ApiException {
try {
Response response = call.execute();
T data = handleResponse(response, returnType);
return new ApiResponse<T>(response.code(), response.headers().toMultimap(), data);
} catch (IOException e) {
throw new ApiException(e);
}
}
/**
* {@link #executeAsync(Call, Type, ApiCallback)}
*
* @param <T> Type
* @param call An instance of the Call object
* @param callback ApiCallback<T>
*/
public <T> void executeAsync(Call call, ApiCallback<T> callback) {
executeAsync(call, null, callback);
}
/**
* Execute HTTP call asynchronously.
*
* @param <T> Type
* @param call The callback to be executed when the API call finishes
* @param returnType Return type
* @param callback ApiCallback
* @see #execute(Call, Type)
*/
@SuppressWarnings("unchecked")
public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
callback.onFailure(new ApiException(e), 0, null);
}
@Override
public void onResponse(Call call, Response response) throws IOException {
T result;
try {
result = (T) handleResponse(response, returnType);
} catch (ApiException e) {
callback.onFailure(e, response.code(), response.headers().toMultimap());
return;
} catch (Exception e) {
callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap());
return;
}
callback.onSuccess(result, response.code(), response.headers().toMultimap());
}
});
}
/**
* Handle the given response, return the deserialized object when the response is successful.
*
* @param <T> Type
* @param response Response
* @param returnType Return type
* @return Type
* @throws ApiException If the response has an unsuccessful status code or
* fail to deserialize the response body
*/
public <T> T handleResponse(Response response, Type returnType) throws ApiException {
if (response.isSuccessful()) {
if (returnType == null || response.code() == 204) {
// returning null if the returnType is not defined,
// or the status code is 204 (No Content)
if (response.body() != null) {
try {
response.body().close();
} catch (Exception e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
return null;
} else {
return deserialize(response, returnType);
}
} else {
String respBody = null;
if (response.body() != null) {
try {
respBody = response.body().string();
} catch (IOException e) {
throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
}
}
throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody);
}
}
/**
* Build HTTP call with the given options.
*
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param cookieParams The cookie parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
* @param callback Callback for upload/download progress
* @return The HTTP call
* @throws ApiException If fail to serialize the request body object
*/
public Call buildCall(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException {
Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback);
return httpClient.newCall(request);
}
/**
* Build an HTTP request with the given options.
*
* @param path The sub-path of the HTTP URL
* @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @param body The request body object
* @param headerParams The header parameters
* @param cookieParams The cookie parameters
* @param formParams The form parameters
* @param authNames The authentications to apply
* @param callback Callback for upload/download progress
* @return The HTTP request
* @throws ApiException If fail to serialize the request body object
*/
public Request buildRequest(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException {
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
final String url = buildUrl(path, queryParams, collectionQueryParams);
final Request.Builder reqBuilder = new Request.Builder().url(url);
processHeaderParams(headerParams, reqBuilder);
processCookieParams(cookieParams, reqBuilder);
String contentType = (String) headerParams.get("Content-Type");
// ensuring a default content type
if (contentType == null) {
contentType = "application/json";
}
RequestBody reqBody;
if (!HttpMethod.permitsRequestBody(method)) {
reqBody = null;
} else if ("application/x-www-form-urlencoded".equals(contentType)) {
reqBody = buildRequestBodyFormEncoding(formParams);
} else if ("multipart/form-data".equals(contentType)) {
reqBody = buildRequestBodyMultipart(formParams);
} else if (body == null) {
if ("DELETE".equals(method)) {
// allow calling DELETE without sending a request body
reqBody = null;
} else {
// use an empty request body (for POST, PUT and PATCH)
reqBody = RequestBody.create("", MediaType.parse(contentType));
}
} else {
reqBody = serialize(body, contentType);
}
// Associate callback with request (if not null) so interceptor can
// access it when creating ProgressResponseBody
reqBuilder.tag(callback);
Request request = null;
if (callback != null && reqBody != null) {
ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback);
request = reqBuilder.method(method, progressRequestBody).build();
} else {
request = reqBuilder.method(method, reqBody).build();
}
return request;
}
/**
* Build full URL by concatenating base path, the given sub path and query parameters.
*
* @param path The sub path
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @return The full URL
*/
public String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams) {
final StringBuilder url = new StringBuilder();
url.append(basePath).append(path);
if (queryParams != null && !queryParams.isEmpty()) {
// support (constant) query string in `path`, e.g. "/posts?draft=1"
String prefix = path.contains("?") ? "&" : "?";
for (Pair param : queryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
prefix = null;
} else {
url.append("&");
}
String value = parameterToString(param.getValue());
url.append(escapeString(param.getName())).append("=").append(escapeString(value));
}
}
}
if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
String prefix = url.toString().contains("?") ? "&" : "?";
for (Pair param : collectionQueryParams) {
if (param.getValue() != null) {
if (prefix != null) {
url.append(prefix);
prefix = null;
} else {
url.append("&");
}
String value = parameterToString(param.getValue());
// collection query parameter value already escaped as part of parameterToPairs
url.append(escapeString(param.getName())).append("=").append(value);
}
}
}
return url.toString();
}
/**
* Set header parameters to the request builder, including default headers.
*
* @param headerParams Header parameters in the form of Map
* @param reqBuilder Request.Builder
*/
public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : headerParams.entrySet()) {
reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
}
for (Entry<String, String> header : defaultHeaderMap.entrySet()) {
if (!headerParams.containsKey(header.getKey())) {
reqBuilder.header(header.getKey(), parameterToString(header.getValue()));
}
}
}
/**
* Set cookie parameters to the request builder, including default cookies.
*
* @param cookieParams Cookie parameters in the form of Map
* @param reqBuilder Request.Builder
*/
public void processCookieParams(Map<String, String> cookieParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : cookieParams.entrySet()) {
reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
}
for (Entry<String, String> param : defaultCookieMap.entrySet()) {
if (!cookieParams.containsKey(param.getKey())) {
reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
}
}
}
/**
* Update query and header parameters based on authentication settings.
*
* @param authNames The authentications to apply
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
*/
public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) {
throw new RuntimeException("Authentication undefined: " + authName);
}
auth.applyToParams(queryParams, headerParams, cookieParams);
}
}
/**
* Build a form-encoding request body with the given form parameters.
*
* @param formParams Form parameters in the form of Map
* @return RequestBody
*/
public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams) {
okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder();
for (Entry<String, Object> param : formParams.entrySet()) {
formBuilder.add(param.getKey(), parameterToString(param.getValue()));
}
return formBuilder.build();
}
/**
* Build a multipart (file uploading) request body with the given form parameters,
* which could contain text fields and file fields.
*
* @param formParams Form parameters in the form of Map
* @return RequestBody
*/
public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
for (Entry<String, Object> param : formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (File) param.getValue();
Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\"");
MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType));
} else {
Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"");
mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null));
}
}
return mpBuilder.build();
}
/**
* Guess Content-Type header from the given file (defaults to "application/octet-stream").
*
* @param file The given file
* @return The guessed Content-Type
*/
public String guessContentTypeFromFile(File file) {
String contentType = URLConnection.guessContentTypeFromName(file.getName());
if (contentType == null) {
return "application/octet-stream";
} else {
return contentType;
}
}
/**
* Get network interceptor to add it to the httpClient to track download progress for
* async requests.
*/
private Interceptor getProgressInterceptor() {
return new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
final Request request = chain.request();
final Response originalResponse = chain.proceed(request);
if (request.tag() instanceof ApiCallback) {
final ApiCallback callback = (ApiCallback) request.tag();
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), callback))
.build();
}
return originalResponse;
}
};
}
/**
* Apply SSL related settings to httpClient according to the current values of
* verifyingSsl and sslCaCert.
*/
private void applySslSettings() {
try {
TrustManager[] trustManagers;
HostnameVerifier hostnameVerifier;
if (!verifyingSsl) {
trustManagers = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
}
};
hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
} else {
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
if (sslCaCert == null) {
trustManagerFactory.init((KeyStore) null);
} else {
char[] password = null; // Any password will work.
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
Collection<? extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert);
if (certificates.isEmpty()) {
throw new IllegalArgumentException("expected non-empty set of trusted certificates");
}
KeyStore caKeyStore = newEmptyKeyStore(password);
int index = 0;
for (Certificate certificate : certificates) {
String certificateAlias = "ca" + Integer.toString(index++);
caKeyStore.setCertificateEntry(certificateAlias, certificate);
}
trustManagerFactory.init(caKeyStore);
}
trustManagers = trustManagerFactory.getTrustManagers();
hostnameVerifier = OkHostnameVerifier.INSTANCE;
}
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagers, trustManagers, new SecureRandom());
httpClient = httpClient.newBuilder()
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0])
.hostnameVerifier(hostnameVerifier)
.build();
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
}
private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException {
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, password);
return keyStore;
} catch (IOException e) {
throw new AssertionError(e);
}
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ApiException.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
private String responseBody = null;
public ApiException() {}
public ApiException(Throwable throwable) {
super(throwable);
}
public ApiException(String message) {
super(message);
}
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) {
super(message, throwable);
this.code = code;
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) {
this(message, (Throwable) null, code, responseHeaders, responseBody);
}
public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) {
this(message, throwable, code, responseHeaders, null);
}
public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) {
this((String) null, (Throwable) null, code, responseHeaders, responseBody);
}
public ApiException(int code, String message) {
super(message);
this.code = code;
}
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
this(code, message);
this.responseHeaders = responseHeaders;
this.responseBody = responseBody;
}
/**
* Get the HTTP status code.
*
* @return HTTP status code
*/
public int getCode() {
return code;
}
/**
* Get the HTTP response headers.
*
* @return A map of list of string
*/
public Map<String, List<String>> getResponseHeaders() {
return responseHeaders;
}
/**
* Get the HTTP response body.
*
* @return Response body in the form of string
*/
public String getResponseBody() {
return responseBody;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ApiResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import java.util.List;
import java.util.Map;
/**
* API response returned by API call.
*
* @param <T> The type of data that is deserialized from response body
*/
public class ApiResponse<T> {
final private int statusCode;
final private Map<String, List<String>> headers;
final private T data;
/**
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
}
/**
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
this.headers = headers;
this.data = data;
}
public int getStatusCode() {
return statusCode;
}
public Map<String, List<String>> getHeaders() {
return headers;
}
public T getData() {
return data;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/Configuration.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class Configuration {
private static ApiClient defaultApiClient = new ApiClient();
/**
* Get the default API client, which would be used when creating API
* instances without providing an API client.
*
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
return defaultApiClient;
}
/**
* Set the default API client, which would be used when creating API
* instances without providing an API client.
*
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient = apiClient;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/GzipRequestInterceptor.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import okhttp3.*;
import okio.Buffer;
import okio.BufferedSink;
import okio.GzipSink;
import okio.Okio;
import java.io.IOException;
/**
* Encodes request bodies using gzip.
*
* Taken from https://github.com/square/okhttp/issues/350
*/
class GzipRequestInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
return chain.proceed(originalRequest);
}
Request compressedRequest = originalRequest.newBuilder()
.header("Content-Encoding", "gzip")
.method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
.build();
return chain.proceed(compressedRequest);
}
private RequestBody forceContentLength(final RequestBody requestBody) throws IOException {
final Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
return new RequestBody() {
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() {
return buffer.size();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
sink.write(buffer.snapshot());
}
};
}
private RequestBody gzip(final RequestBody body) {
return new RequestBody() {
@Override
public MediaType contentType() {
return body.contentType();
}
@Override
public long contentLength() {
return -1; // We don't know the compressed length in advance!
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
body.writeTo(gzipSink);
gzipSink.close();
}
};
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/JSON.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
import io.gsonfire.TypeSelector;
import ai.whylabs.service.model.*;
import okio.ByteString;
import java.io.IOException;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
public class JSON {
private Gson gson;
private boolean isLenientOnJson = false;
private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
@SuppressWarnings("unchecked")
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
}
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
}
return element.getAsString();
}
/**
* Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
*
* @param classByDiscriminatorValue The map of discriminator values to Java classes.
* @param discriminatorValue The value of the OpenAPI discriminator in the input data.
* @return The Java class that implements the OpenAPI schema
*/
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}
return clazz;
}
public JSON() {
gson = createGson()
.registerTypeAdapter(Date.class, dateTypeAdapter)
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
.registerTypeAdapter(byte[].class, byteArrayAdapter)
.create();
}
/**
* Get Gson.
*
* @return Gson
*/
public Gson getGson() {
return gson;
}
/**
* Set Gson.
*
* @param gson Gson
* @return JSON
*/
public JSON setGson(Gson gson) {
this.gson = gson;
return this;
}
public JSON setLenientOnJson(boolean lenientOnJson) {
isLenientOnJson = lenientOnJson;
return this;
}
/**
* Serialize the given Java object into JSON string.
*
* @param obj Object
* @return String representation of the JSON
*/
public String serialize(Object obj) {
return gson.toJson(obj);
}
/**
* Deserialize the given JSON string to Java object.
*
* @param <T> Type
* @param body The JSON string
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(String body, Type returnType) {
try {
if (isLenientOnJson) {
JsonReader jsonReader = new JsonReader(new StringReader(body));
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(body, returnType);
}
} catch (JsonParseException e) {
// Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type;
if (returnType.equals(String.class)) {
return (T) body;
} else {
throw (e);
}
}
}
/**
* Gson TypeAdapter for Byte Array type
*/
public class ByteArrayAdapter extends TypeAdapter<byte[]> {
@Override
public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
}
}
@Override
public byte[] read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String bytesAsBase64 = in.nextString();
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
return byteString.toByteArray();
}
}
}
/**
* Gson TypeAdapter for JSR310 OffsetDateTime type
*/
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
private DateTimeFormatter formatter;
public OffsetDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
}
public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, OffsetDateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public OffsetDateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
if (date.endsWith("+0000")) {
date = date.substring(0, date.length()-5) + "Z";
}
return OffsetDateTime.parse(date, formatter);
}
}
}
/**
* Gson TypeAdapter for JSR310 LocalDate type
*/
public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private DateTimeFormatter formatter;
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return LocalDate.parse(date, formatter);
}
}
}
public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
return this;
}
public JSON setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
return this;
}
/**
* Gson TypeAdapter for java.sql.Date type
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
* (more efficient than SimpleDateFormat).
*/
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
private DateFormat dateFormat;
public SqlDateTypeAdapter() {}
public SqlDateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, java.sql.Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = date.toString();
}
out.value(value);
}
}
@Override
public java.sql.Date read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return new java.sql.Date(dateFormat.parse(date).getTime());
}
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
}
}
/**
* Gson TypeAdapter for java.util.Date type
* If the dateFormat is null, ISO8601Utils will be used.
*/
public static class DateTypeAdapter extends TypeAdapter<Date> {
private DateFormat dateFormat;
public DateTypeAdapter() {}
public DateTypeAdapter(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
public void setFormat(DateFormat dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public void write(JsonWriter out, Date date) throws IOException {
if (date == null) {
out.nullValue();
} else {
String value;
if (dateFormat != null) {
value = dateFormat.format(date);
} else {
value = ISO8601Utils.format(date, true);
}
out.value(value);
}
}
@Override
public Date read(JsonReader in) throws IOException {
try {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
if (dateFormat != null) {
return dateFormat.parse(date);
}
return ISO8601Utils.parse(date, new ParsePosition(0));
} catch (ParseException e) {
throw new JsonParseException(e);
}
}
} catch (IllegalArgumentException e) {
throw new JsonParseException(e);
}
}
}
public JSON setDateFormat(DateFormat dateFormat) {
dateTypeAdapter.setFormat(dateFormat);
return this;
}
public JSON setSqlDateFormat(DateFormat dateFormat) {
sqlDateTypeAdapter.setFormat(dateFormat);
return this;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/Pair.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class Pair {
private String name = "";
private String value = "";
public Pair (String name, String value) {
setName(name);
setValue(value);
}
private void setName(String name) {
if (!isValidString(name)) {
return;
}
this.name = name;
}
private void setValue(String value) {
if (!isValidString(value)) {
return;
}
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private boolean isValidString(String arg) {
if (arg == null) {
return false;
}
if (arg.trim().isEmpty()) {
return false;
}
return true;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ProgressRequestBody.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;
public class ProgressRequestBody extends RequestBody {
private final RequestBody requestBody;
private final ApiCallback callback;
public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
this.requestBody = requestBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return requestBody.contentType();
}
@Override
public long contentLength() throws IOException {
return requestBody.contentLength();
}
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink bufferedSink = Okio.buffer(sink(sink));
requestBody.writeTo(bufferedSink);
bufferedSink.flush();
}
private Sink sink(Sink sink) {
return new ForwardingSink(sink) {
long bytesWritten = 0L;
long contentLength = 0L;
@Override
public void write(Buffer source, long byteCount) throws IOException {
super.write(source, byteCount);
if (contentLength == 0) {
contentLength = contentLength();
}
bytesWritten += byteCount;
callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
}
};
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ProgressResponseBody.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import okhttp3.MediaType;
import okhttp3.ResponseBody;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;
import okio.Source;
public class ProgressResponseBody extends ResponseBody {
private final ResponseBody responseBody;
private final ApiCallback callback;
private BufferedSource bufferedSource;
public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
this.responseBody = responseBody;
this.callback = callback;
}
@Override
public MediaType contentType() {
return responseBody.contentType();
}
@Override
public long contentLength() {
return responseBody.contentLength();
}
@Override
public BufferedSource source() {
if (bufferedSource == null) {
bufferedSource = Okio.buffer(source(responseBody.source()));
}
return bufferedSource;
}
private Source source(Source source) {
return new ForwardingSource(source) {
long totalBytesRead = 0L;
@Override
public long read(Buffer sink, long byteCount) throws IOException {
long bytesRead = super.read(sink, byteCount);
// read() returns the number of bytes read, or -1 if this source is exhausted.
totalBytesRead += bytesRead != -1 ? bytesRead : 0;
callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
return bytesRead;
}
};
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ServerConfiguration.java | package ai.whylabs.service.invoker;
import java.util.Map;
/**
* Representing a Server configuration.
*/
public class ServerConfiguration {
public String URL;
public String description;
public Map<String, ServerVariable> variables;
/**
* @param URL A URL to the target host.
* @param description A describtion of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
this.URL = URL;
this.description = description;
this.variables = variables;
}
/**
* Format URL template using given variables.
*
* @param variables A map between a variable name and its value.
* @return Formatted URL.
*/
public String URL(Map<String, String> variables) {
String url = this.URL;
// go through variables and replace placeholders
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
String name = variable.getKey();
ServerVariable serverVariable = variable.getValue();
String value = serverVariable.defaultValue;
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replaceAll("\\{" + name + "\\}", value);
}
return url;
}
/**
* Format URL template using default server variables.
*
* @return Formatted URL.
*/
public String URL() {
return URL(null);
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/ServerVariable.java | package ai.whylabs.service.invoker;
import java.util.HashSet;
/**
* Representing a Server Variable for server URL template substitution.
*/
public class ServerVariable {
public String description;
public String defaultValue;
public HashSet<String> enumValues = null;
/**
* @param description A description for the server variable.
* @param defaultValue The default value to use for substitution.
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
*/
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
this.description = description;
this.defaultValue = defaultValue;
this.enumValues = enumValues;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/StringUtil.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker;
import java.util.Collection;
import java.util.Iterator;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) {
return true;
}
if (value != null && value.equalsIgnoreCase(str)) {
return true;
}
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) {
return "";
}
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
/**
* Join a list of strings with the given separator.
*
* @param list The list of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(Collection<String> list, String separator) {
Iterator<String> iterator = list.iterator();
StringBuilder out = new StringBuilder();
if (iterator.hasNext()) {
out.append(iterator.next());
}
while (iterator.hasNext()) {
out.append(separator).append(iterator.next());
}
return out.toString();
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/auth/ApiKeyAuth.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker.auth;
import ai.whylabs.service.invoker.Pair;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
} else if ("cookie".equals(location)) {
cookieParams.put(paramName, value);
}
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/auth/Authentication.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker.auth;
import ai.whylabs.service.invoker.Pair;
import java.util.Map;
import java.util.List;
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams);
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/auth/HttpBasicAuth.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker.auth;
import ai.whylabs.service.invoker.Pair;
import okhttp3.Credentials;
import java.util.Map;
import java.util.List;
import java.io.UnsupportedEncodingException;
public class HttpBasicAuth implements Authentication {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) {
if (username == null && password == null) {
return;
}
headerParams.put("Authorization", Credentials.basic(
username == null ? "" : username,
password == null ? "" : password));
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/invoker/auth/HttpBearerAuth.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.invoker.auth;
import ai.whylabs.service.invoker.Pair;
import java.util.Map;
import java.util.List;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class HttpBearerAuth implements Authentication {
private final String scheme;
private String bearerToken;
public HttpBearerAuth(String scheme) {
this.scheme = scheme;
}
/**
* Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @return The bearer token
*/
public String getBearerToken() {
return bearerToken;
}
/**
* Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
*
* @param bearerToken The bearer token to send in the Authorization header
*/
public void setBearerToken(String bearerToken) {
this.bearerToken = bearerToken;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) {
if(bearerToken == null) {
return;
}
headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
}
private static String upperCaseBearer(String scheme) {
return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/AddMembershipRequest.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Role;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* AddMembershipRequest
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class AddMembershipRequest {
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
private String email;
public static final String SERIALIZED_NAME_ROLE = "role";
@SerializedName(SERIALIZED_NAME_ROLE)
private Role role;
public static final String SERIALIZED_NAME_DEFAULT = "default";
@SerializedName(SERIALIZED_NAME_DEFAULT)
private Boolean _default;
public AddMembershipRequest orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@ApiModelProperty(required = true, value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public AddMembershipRequest email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
**/
@ApiModelProperty(required = true, value = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public AddMembershipRequest role(Role role) {
this.role = role;
return this;
}
/**
* Get role
* @return role
**/
@ApiModelProperty(required = true, value = "")
public Role getRole() {
return role;
}
public void setRole(Role role) {
this.role = role;
}
public AddMembershipRequest _default(Boolean _default) {
this._default = _default;
return this;
}
/**
* Get _default
* @return _default
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getDefault() {
return _default;
}
public void setDefault(Boolean _default) {
this._default = _default;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AddMembershipRequest addMembershipRequest = (AddMembershipRequest) o;
return Objects.equals(this.orgId, addMembershipRequest.orgId) &&
Objects.equals(this.email, addMembershipRequest.email) &&
Objects.equals(this.role, addMembershipRequest.role) &&
Objects.equals(this._default, addMembershipRequest._default);
}
@Override
public int hashCode() {
return Objects.hash(orgId, email, role, _default);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AddMembershipRequest {\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" role: ").append(toIndentedString(role)).append("\n");
sb.append(" _default: ").append(toIndentedString(_default)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/AlertsPath.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Segment;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Metadata for an event
*/
@ApiModel(description = "Metadata for an event")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class AlertsPath {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_SEGMENT = "segment";
@SerializedName(SERIALIZED_NAME_SEGMENT)
private Segment segment;
public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp";
@SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP)
private Long creationTimestamp;
public static final String SERIALIZED_NAME_DATASET_TIMESTAMP = "datasetTimestamp";
@SerializedName(SERIALIZED_NAME_DATASET_TIMESTAMP)
private Long datasetTimestamp;
public static final String SERIALIZED_NAME_S3_PATH = "s3Path";
@SerializedName(SERIALIZED_NAME_S3_PATH)
private String s3Path;
public static final String SERIALIZED_NAME_ETAG = "etag";
@SerializedName(SERIALIZED_NAME_ETAG)
private String etag;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private String version;
public AlertsPath id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public AlertsPath orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public AlertsPath modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public AlertsPath segment(Segment segment) {
this.segment = segment;
return this;
}
/**
* Get segment
* @return segment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Segment getSegment() {
return segment;
}
public void setSegment(Segment segment) {
this.segment = segment;
}
public AlertsPath creationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
return this;
}
/**
* Get creationTimestamp
* @return creationTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getCreationTimestamp() {
return creationTimestamp;
}
public void setCreationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
}
public AlertsPath datasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
return this;
}
/**
* Get datasetTimestamp
* @return datasetTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDatasetTimestamp() {
return datasetTimestamp;
}
public void setDatasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
}
public AlertsPath s3Path(String s3Path) {
this.s3Path = s3Path;
return this;
}
/**
* Get s3Path
* @return s3Path
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getS3Path() {
return s3Path;
}
public void setS3Path(String s3Path) {
this.s3Path = s3Path;
}
public AlertsPath etag(String etag) {
this.etag = etag;
return this;
}
/**
* Get etag
* @return etag
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getEtag() {
return etag;
}
public void setEtag(String etag) {
this.etag = etag;
}
public AlertsPath version(String version) {
this.version = version;
return this;
}
/**
* Get version
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AlertsPath alertsPath = (AlertsPath) o;
return Objects.equals(this.id, alertsPath.id) &&
Objects.equals(this.orgId, alertsPath.orgId) &&
Objects.equals(this.modelId, alertsPath.modelId) &&
Objects.equals(this.segment, alertsPath.segment) &&
Objects.equals(this.creationTimestamp, alertsPath.creationTimestamp) &&
Objects.equals(this.datasetTimestamp, alertsPath.datasetTimestamp) &&
Objects.equals(this.s3Path, alertsPath.s3Path) &&
Objects.equals(this.etag, alertsPath.etag) &&
Objects.equals(this.version, alertsPath.version);
}
@Override
public int hashCode() {
return Objects.hash(id, orgId, modelId, segment, creationTimestamp, datasetTimestamp, s3Path, etag, version);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AlertsPath {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" segment: ").append(toIndentedString(segment)).append("\n");
sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n");
sb.append(" datasetTimestamp: ").append(toIndentedString(datasetTimestamp)).append("\n");
sb.append(" s3Path: ").append(toIndentedString(s3Path)).append("\n");
sb.append(" etag: ").append(toIndentedString(etag)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/AlertsSummary.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Segment;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Summary of an event entry
*/
@ApiModel(description = "Summary of an event entry")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class AlertsSummary {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_SEGMENT = "segment";
@SerializedName(SERIALIZED_NAME_SEGMENT)
private Segment segment;
public static final String SERIALIZED_NAME_DATASET_TIMESTAMP = "datasetTimestamp";
@SerializedName(SERIALIZED_NAME_DATASET_TIMESTAMP)
private Long datasetTimestamp;
public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp";
@SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP)
private Long creationTimestamp;
public static final String SERIALIZED_NAME_ETAG = "etag";
@SerializedName(SERIALIZED_NAME_ETAG)
private String etag;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private String version;
public AlertsSummary id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public AlertsSummary modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public AlertsSummary segment(Segment segment) {
this.segment = segment;
return this;
}
/**
* Get segment
* @return segment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Segment getSegment() {
return segment;
}
public void setSegment(Segment segment) {
this.segment = segment;
}
public AlertsSummary datasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
return this;
}
/**
* Get datasetTimestamp
* @return datasetTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDatasetTimestamp() {
return datasetTimestamp;
}
public void setDatasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
}
public AlertsSummary creationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
return this;
}
/**
* Get creationTimestamp
* @return creationTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getCreationTimestamp() {
return creationTimestamp;
}
public void setCreationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
}
public AlertsSummary etag(String etag) {
this.etag = etag;
return this;
}
/**
* Get etag
* @return etag
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getEtag() {
return etag;
}
public void setEtag(String etag) {
this.etag = etag;
}
public AlertsSummary version(String version) {
this.version = version;
return this;
}
/**
* Get version
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AlertsSummary alertsSummary = (AlertsSummary) o;
return Objects.equals(this.id, alertsSummary.id) &&
Objects.equals(this.modelId, alertsSummary.modelId) &&
Objects.equals(this.segment, alertsSummary.segment) &&
Objects.equals(this.datasetTimestamp, alertsSummary.datasetTimestamp) &&
Objects.equals(this.creationTimestamp, alertsSummary.creationTimestamp) &&
Objects.equals(this.etag, alertsSummary.etag) &&
Objects.equals(this.version, alertsSummary.version);
}
@Override
public int hashCode() {
return Objects.hash(id, modelId, segment, datasetTimestamp, creationTimestamp, etag, version);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AlertsSummary {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" segment: ").append(toIndentedString(segment)).append("\n");
sb.append(" datasetTimestamp: ").append(toIndentedString(datasetTimestamp)).append("\n");
sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n");
sb.append(" etag: ").append(toIndentedString(etag)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/AsyncLogResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Segment;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response payload for LogAsync.
*/
@ApiModel(description = "Response payload for LogAsync.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class AsyncLogResponse {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_UPLOAD_TIMESTAMP = "uploadTimestamp";
@SerializedName(SERIALIZED_NAME_UPLOAD_TIMESTAMP)
private Long uploadTimestamp;
public static final String SERIALIZED_NAME_UPLOAD_URL = "uploadUrl";
@SerializedName(SERIALIZED_NAME_UPLOAD_URL)
private String uploadUrl;
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private Segment tags;
public AsyncLogResponse id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public AsyncLogResponse modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public AsyncLogResponse uploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
return this;
}
/**
* Get uploadTimestamp
* @return uploadTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getUploadTimestamp() {
return uploadTimestamp;
}
public void setUploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
}
public AsyncLogResponse uploadUrl(String uploadUrl) {
this.uploadUrl = uploadUrl;
return this;
}
/**
* Get uploadUrl
* @return uploadUrl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getUploadUrl() {
return uploadUrl;
}
public void setUploadUrl(String uploadUrl) {
this.uploadUrl = uploadUrl;
}
public AsyncLogResponse tags(Segment tags) {
this.tags = tags;
return this;
}
/**
* Get tags
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Segment getTags() {
return tags;
}
public void setTags(Segment tags) {
this.tags = tags;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AsyncLogResponse asyncLogResponse = (AsyncLogResponse) o;
return Objects.equals(this.id, asyncLogResponse.id) &&
Objects.equals(this.modelId, asyncLogResponse.modelId) &&
Objects.equals(this.uploadTimestamp, asyncLogResponse.uploadTimestamp) &&
Objects.equals(this.uploadUrl, asyncLogResponse.uploadUrl) &&
Objects.equals(this.tags, asyncLogResponse.tags);
}
@Override
public int hashCode() {
return Objects.hash(id, modelId, uploadTimestamp, uploadUrl, tags);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AsyncLogResponse {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" uploadTimestamp: ").append(toIndentedString(uploadTimestamp)).append("\n");
sb.append(" uploadUrl: ").append(toIndentedString(uploadUrl)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/CloseSessionResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response for closing a session
*/
@ApiModel(description = "Response for closing a session")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class CloseSessionResponse {
public static final String SERIALIZED_NAME_WHYLABS_URL = "whylabsUrl";
@SerializedName(SERIALIZED_NAME_WHYLABS_URL)
private String whylabsUrl;
public CloseSessionResponse whylabsUrl(String whylabsUrl) {
this.whylabsUrl = whylabsUrl;
return this;
}
/**
* URL where the session can be viewed.
* @return whylabsUrl
**/
@ApiModelProperty(required = true, value = "URL where the session can be viewed.")
public String getWhylabsUrl() {
return whylabsUrl;
}
public void setWhylabsUrl(String whylabsUrl) {
this.whylabsUrl = whylabsUrl;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloseSessionResponse closeSessionResponse = (CloseSessionResponse) o;
return Objects.equals(this.whylabsUrl, closeSessionResponse.whylabsUrl);
}
@Override
public int hashCode() {
return Objects.hash(whylabsUrl);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloseSessionResponse {\n");
sb.append(" whylabsUrl: ").append(toIndentedString(whylabsUrl)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/CreateSessionResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response for creating sessions
*/
@ApiModel(description = "Response for creating sessions")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class CreateSessionResponse {
public static final String SERIALIZED_NAME_TOKEN = "token";
@SerializedName(SERIALIZED_NAME_TOKEN)
private String token;
public CreateSessionResponse token(String token) {
this.token = token;
return this;
}
/**
* Token for the created session, to be passsed into other session APIs.
* @return token
**/
@ApiModelProperty(required = true, value = "Token for the created session, to be passsed into other session APIs.")
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateSessionResponse createSessionResponse = (CreateSessionResponse) o;
return Objects.equals(this.token, createSessionResponse.token);
}
@Override
public int hashCode() {
return Objects.hash(token);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateSessionResponse {\n");
sb.append(" token: ").append(toIndentedString(token)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/CreateSessionUploadResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response for creating session uploads
*/
@ApiModel(description = "Response for creating session uploads")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class CreateSessionUploadResponse {
public static final String SERIALIZED_NAME_UPLOAD_URL = "uploadUrl";
@SerializedName(SERIALIZED_NAME_UPLOAD_URL)
private String uploadUrl;
public CreateSessionUploadResponse uploadUrl(String uploadUrl) {
this.uploadUrl = uploadUrl;
return this;
}
/**
* Token for the created session, to be passed into other session APIs.
* @return uploadUrl
**/
@ApiModelProperty(required = true, value = "Token for the created session, to be passed into other session APIs.")
public String getUploadUrl() {
return uploadUrl;
}
public void setUploadUrl(String uploadUrl) {
this.uploadUrl = uploadUrl;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateSessionUploadResponse createSessionUploadResponse = (CreateSessionUploadResponse) o;
return Objects.equals(this.uploadUrl, createSessionUploadResponse.uploadUrl);
}
@Override
public int hashCode() {
return Objects.hash(uploadUrl);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateSessionUploadResponse {\n");
sb.append(" uploadUrl: ").append(toIndentedString(uploadUrl)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/CreateUserRequest.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Request for creating a new user
*/
@ApiModel(description = "Request for creating a new user")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class CreateUserRequest {
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
private String email;
public CreateUserRequest email(String email) {
this.email = email;
return this;
}
/**
* The users email address
* @return email
**/
@ApiModelProperty(required = true, value = "The users email address")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateUserRequest createUserRequest = (CreateUserRequest) o;
return Objects.equals(this.email, createUserRequest.email);
}
@Override
public int hashCode() {
return Objects.hash(email);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateUserRequest {\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/EventsPath.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Segment;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Metadata for an event path (might contain multiple events)
*/
@ApiModel(description = "Metadata for an event path (might contain multiple events)")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class EventsPath {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_SEGMENT = "segment";
@SerializedName(SERIALIZED_NAME_SEGMENT)
private Segment segment;
public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp";
@SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP)
private Long creationTimestamp;
public static final String SERIALIZED_NAME_DATASET_TIMESTAMP = "datasetTimestamp";
@SerializedName(SERIALIZED_NAME_DATASET_TIMESTAMP)
private Long datasetTimestamp;
public static final String SERIALIZED_NAME_S3_PATH = "s3Path";
@SerializedName(SERIALIZED_NAME_S3_PATH)
private String s3Path;
public static final String SERIALIZED_NAME_ETAG = "etag";
@SerializedName(SERIALIZED_NAME_ETAG)
private String etag;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private String version;
public EventsPath id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public EventsPath orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public EventsPath modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public EventsPath segment(Segment segment) {
this.segment = segment;
return this;
}
/**
* Get segment
* @return segment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Segment getSegment() {
return segment;
}
public void setSegment(Segment segment) {
this.segment = segment;
}
public EventsPath creationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
return this;
}
/**
* Get creationTimestamp
* @return creationTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getCreationTimestamp() {
return creationTimestamp;
}
public void setCreationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
}
public EventsPath datasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
return this;
}
/**
* Get datasetTimestamp
* @return datasetTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDatasetTimestamp() {
return datasetTimestamp;
}
public void setDatasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
}
public EventsPath s3Path(String s3Path) {
this.s3Path = s3Path;
return this;
}
/**
* Get s3Path
* @return s3Path
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getS3Path() {
return s3Path;
}
public void setS3Path(String s3Path) {
this.s3Path = s3Path;
}
public EventsPath etag(String etag) {
this.etag = etag;
return this;
}
/**
* Get etag
* @return etag
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getEtag() {
return etag;
}
public void setEtag(String etag) {
this.etag = etag;
}
public EventsPath version(String version) {
this.version = version;
return this;
}
/**
* Get version
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EventsPath eventsPath = (EventsPath) o;
return Objects.equals(this.id, eventsPath.id) &&
Objects.equals(this.orgId, eventsPath.orgId) &&
Objects.equals(this.modelId, eventsPath.modelId) &&
Objects.equals(this.segment, eventsPath.segment) &&
Objects.equals(this.creationTimestamp, eventsPath.creationTimestamp) &&
Objects.equals(this.datasetTimestamp, eventsPath.datasetTimestamp) &&
Objects.equals(this.s3Path, eventsPath.s3Path) &&
Objects.equals(this.etag, eventsPath.etag) &&
Objects.equals(this.version, eventsPath.version);
}
@Override
public int hashCode() {
return Objects.hash(id, orgId, modelId, segment, creationTimestamp, datasetTimestamp, s3Path, etag, version);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EventsPath {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" segment: ").append(toIndentedString(segment)).append("\n");
sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n");
sb.append(" datasetTimestamp: ").append(toIndentedString(datasetTimestamp)).append("\n");
sb.append(" s3Path: ").append(toIndentedString(s3Path)).append("\n");
sb.append(" etag: ").append(toIndentedString(etag)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/EventsSummary.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Segment;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Summary of an entry corresponding to multiple events
*/
@ApiModel(description = "Summary of an entry corresponding to multiple events")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class EventsSummary {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_SEGMENT = "segment";
@SerializedName(SERIALIZED_NAME_SEGMENT)
private Segment segment;
public static final String SERIALIZED_NAME_DATASET_TIMESTAMP = "datasetTimestamp";
@SerializedName(SERIALIZED_NAME_DATASET_TIMESTAMP)
private Long datasetTimestamp;
public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp";
@SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP)
private Long creationTimestamp;
public static final String SERIALIZED_NAME_ETAG = "etag";
@SerializedName(SERIALIZED_NAME_ETAG)
private String etag;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private String version;
public EventsSummary id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public EventsSummary modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public EventsSummary segment(Segment segment) {
this.segment = segment;
return this;
}
/**
* Get segment
* @return segment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Segment getSegment() {
return segment;
}
public void setSegment(Segment segment) {
this.segment = segment;
}
public EventsSummary datasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
return this;
}
/**
* Get datasetTimestamp
* @return datasetTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDatasetTimestamp() {
return datasetTimestamp;
}
public void setDatasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
}
public EventsSummary creationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
return this;
}
/**
* Get creationTimestamp
* @return creationTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getCreationTimestamp() {
return creationTimestamp;
}
public void setCreationTimestamp(Long creationTimestamp) {
this.creationTimestamp = creationTimestamp;
}
public EventsSummary etag(String etag) {
this.etag = etag;
return this;
}
/**
* Get etag
* @return etag
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getEtag() {
return etag;
}
public void setEtag(String etag) {
this.etag = etag;
}
public EventsSummary version(String version) {
this.version = version;
return this;
}
/**
* Get version
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EventsSummary eventsSummary = (EventsSummary) o;
return Objects.equals(this.id, eventsSummary.id) &&
Objects.equals(this.modelId, eventsSummary.modelId) &&
Objects.equals(this.segment, eventsSummary.segment) &&
Objects.equals(this.datasetTimestamp, eventsSummary.datasetTimestamp) &&
Objects.equals(this.creationTimestamp, eventsSummary.creationTimestamp) &&
Objects.equals(this.etag, eventsSummary.etag) &&
Objects.equals(this.version, eventsSummary.version);
}
@Override
public int hashCode() {
return Objects.hash(id, modelId, segment, datasetTimestamp, creationTimestamp, etag, version);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EventsSummary {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" segment: ").append(toIndentedString(segment)).append("\n");
sb.append(" datasetTimestamp: ").append(toIndentedString(datasetTimestamp)).append("\n");
sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n");
sb.append(" etag: ").append(toIndentedString(etag)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/GetAlertsPathsResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.AlertsPath;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* GetAlertsPaths API response with a list of alerts
*/
@ApiModel(description = "GetAlertsPaths API response with a list of alerts")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class GetAlertsPathsResponse {
public static final String SERIALIZED_NAME_ITEMS = "items";
@SerializedName(SERIALIZED_NAME_ITEMS)
private List<AlertsPath> items = new ArrayList<>();
public GetAlertsPathsResponse items(List<AlertsPath> items) {
this.items = items;
return this;
}
public GetAlertsPathsResponse addItemsItem(AlertsPath itemsItem) {
this.items.add(itemsItem);
return this;
}
/**
* A list of alerts
* @return items
**/
@ApiModelProperty(required = true, value = "A list of alerts")
public List<AlertsPath> getItems() {
return items;
}
public void setItems(List<AlertsPath> items) {
this.items = items;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetAlertsPathsResponse getAlertsPathsResponse = (GetAlertsPathsResponse) o;
return Objects.equals(this.items, getAlertsPathsResponse.items);
}
@Override
public int hashCode() {
return Objects.hash(items);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetAlertsPathsResponse {\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/GetDefaultMembershipResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Membership;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* GetDefaultMembershipResponse
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class GetDefaultMembershipResponse {
public static final String SERIALIZED_NAME_MEMBERSHIP = "membership";
@SerializedName(SERIALIZED_NAME_MEMBERSHIP)
private Membership membership;
public GetDefaultMembershipResponse membership(Membership membership) {
this.membership = membership;
return this;
}
/**
* Get membership
* @return membership
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Membership getMembership() {
return membership;
}
public void setMembership(Membership membership) {
this.membership = membership;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetDefaultMembershipResponse getDefaultMembershipResponse = (GetDefaultMembershipResponse) o;
return Objects.equals(this.membership, getDefaultMembershipResponse.membership);
}
@Override
public int hashCode() {
return Objects.hash(membership);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetDefaultMembershipResponse {\n");
sb.append(" membership: ").append(toIndentedString(membership)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/GetEventsPathResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.EventsPath;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* BatchGetEvents API response with a list of events
*/
@ApiModel(description = "BatchGetEvents API response with a list of events")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class GetEventsPathResponse {
public static final String SERIALIZED_NAME_ITEMS = "items";
@SerializedName(SERIALIZED_NAME_ITEMS)
private List<EventsPath> items = new ArrayList<>();
public GetEventsPathResponse items(List<EventsPath> items) {
this.items = items;
return this;
}
public GetEventsPathResponse addItemsItem(EventsPath itemsItem) {
this.items.add(itemsItem);
return this;
}
/**
* A list of events
* @return items
**/
@ApiModelProperty(required = true, value = "A list of events")
public List<EventsPath> getItems() {
return items;
}
public void setItems(List<EventsPath> items) {
this.items = items;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetEventsPathResponse getEventsPathResponse = (GetEventsPathResponse) o;
return Objects.equals(this.items, getEventsPathResponse.items);
}
@Override
public int hashCode() {
return Objects.hash(items);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetEventsPathResponse {\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/GetMembershipsResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Membership;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
/**
* Response for the GetMemberships API
*/
@ApiModel(description = "Response for the GetMemberships API")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class GetMembershipsResponse {
public static final String SERIALIZED_NAME_MEMBERSHIPS = "memberships";
@SerializedName(SERIALIZED_NAME_MEMBERSHIPS)
private Set<Membership> memberships = new LinkedHashSet<>();
public GetMembershipsResponse memberships(Set<Membership> memberships) {
this.memberships = memberships;
return this;
}
public GetMembershipsResponse addMembershipsItem(Membership membershipsItem) {
this.memberships.add(membershipsItem);
return this;
}
/**
* A list of all memberships that a user has.
* @return memberships
**/
@ApiModelProperty(required = true, value = "A list of all memberships that a user has.")
public Set<Membership> getMemberships() {
return memberships;
}
public void setMemberships(Set<Membership> memberships) {
this.memberships = memberships;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetMembershipsResponse getMembershipsResponse = (GetMembershipsResponse) o;
return Objects.equals(this.memberships, getMembershipsResponse.memberships);
}
@Override
public int hashCode() {
return Objects.hash(memberships);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetMembershipsResponse {\n");
sb.append(" memberships: ").append(toIndentedString(memberships)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/GetNotificationSettingsResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.NotificationSettings;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response for getting notification settings
*/
@ApiModel(description = "Response for getting notification settings")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class GetNotificationSettingsResponse {
public static final String SERIALIZED_NAME_NOTIFICATION_SETTINGS = "notificationSettings";
@SerializedName(SERIALIZED_NAME_NOTIFICATION_SETTINGS)
private NotificationSettings notificationSettings;
public GetNotificationSettingsResponse notificationSettings(NotificationSettings notificationSettings) {
this.notificationSettings = notificationSettings;
return this;
}
/**
* Get notificationSettings
* @return notificationSettings
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public NotificationSettings getNotificationSettings() {
return notificationSettings;
}
public void setNotificationSettings(NotificationSettings notificationSettings) {
this.notificationSettings = notificationSettings;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetNotificationSettingsResponse getNotificationSettingsResponse = (GetNotificationSettingsResponse) o;
return Objects.equals(this.notificationSettings, getNotificationSettingsResponse.notificationSettings);
}
@Override
public int hashCode() {
return Objects.hash(notificationSettings);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetNotificationSettingsResponse {\n");
sb.append(" notificationSettings: ").append(toIndentedString(notificationSettings)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/GetSessionResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.SessionMetadata;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response for getting sessions.
*/
@ApiModel(description = "Response for getting sessions.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class GetSessionResponse {
public static final String SERIALIZED_NAME_SESSION = "session";
@SerializedName(SERIALIZED_NAME_SESSION)
private SessionMetadata session;
public GetSessionResponse session(SessionMetadata session) {
this.session = session;
return this;
}
/**
* Get session
* @return session
**/
@ApiModelProperty(required = true, value = "")
public SessionMetadata getSession() {
return session;
}
public void setSession(SessionMetadata session) {
this.session = session;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetSessionResponse getSessionResponse = (GetSessionResponse) o;
return Objects.equals(this.session, getSessionResponse.session);
}
@Override
public int hashCode() {
return Objects.hash(session);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetSessionResponse {\n");
sb.append(" session: ").append(toIndentedString(session)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ListModelsResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.ModelMetadata;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
/**
* Response for the ListModels API
*/
@ApiModel(description = "Response for the ListModels API")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ListModelsResponse {
public static final String SERIALIZED_NAME_ITEMS = "items";
@SerializedName(SERIALIZED_NAME_ITEMS)
private Set<ModelMetadata> items = new LinkedHashSet<>();
public ListModelsResponse items(Set<ModelMetadata> items) {
this.items = items;
return this;
}
public ListModelsResponse addItemsItem(ModelMetadata itemsItem) {
this.items.add(itemsItem);
return this;
}
/**
* A list of all known model ids for an organization.
* @return items
**/
@ApiModelProperty(required = true, value = "A list of all known model ids for an organization.")
public Set<ModelMetadata> getItems() {
return items;
}
public void setItems(Set<ModelMetadata> items) {
this.items = items;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ListModelsResponse listModelsResponse = (ListModelsResponse) o;
return Objects.equals(this.items, listModelsResponse.items);
}
@Override
public int hashCode() {
return Objects.hash(items);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListModelsResponse {\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ListSegmentsResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.SegmentSummary;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
/**
* Response for the ListSegments API
*/
@ApiModel(description = "Response for the ListSegments API")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ListSegmentsResponse {
public static final String SERIALIZED_NAME_ITEMS = "items";
@SerializedName(SERIALIZED_NAME_ITEMS)
private Set<SegmentSummary> items = new LinkedHashSet<>();
public ListSegmentsResponse items(Set<SegmentSummary> items) {
this.items = items;
return this;
}
public ListSegmentsResponse addItemsItem(SegmentSummary itemsItem) {
this.items.add(itemsItem);
return this;
}
/**
* A list of segments.
* @return items
**/
@ApiModelProperty(required = true, value = "A list of segments.")
public Set<SegmentSummary> getItems() {
return items;
}
public void setItems(Set<SegmentSummary> items) {
this.items = items;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ListSegmentsResponse listSegmentsResponse = (ListSegmentsResponse) o;
return Objects.equals(this.items, listSegmentsResponse.items);
}
@Override
public int hashCode() {
return Objects.hash(items);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListSegmentsResponse {\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ListUserApiKeys.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.UserApiKey;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
/**
* Response for listing API key metadata
*/
@ApiModel(description = "Response for listing API key metadata")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ListUserApiKeys {
public static final String SERIALIZED_NAME_ITEMS = "items";
@SerializedName(SERIALIZED_NAME_ITEMS)
private Set<UserApiKey> items = new LinkedHashSet<>();
public ListUserApiKeys items(Set<UserApiKey> items) {
this.items = items;
return this;
}
public ListUserApiKeys addItemsItem(UserApiKey itemsItem) {
this.items.add(itemsItem);
return this;
}
/**
* A list of all known API key metadata
* @return items
**/
@ApiModelProperty(required = true, value = "A list of all known API key metadata")
public Set<UserApiKey> getItems() {
return items;
}
public void setItems(Set<UserApiKey> items) {
this.items = items;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ListUserApiKeys listUserApiKeys = (ListUserApiKeys) o;
return Objects.equals(this.items, listUserApiKeys.items);
}
@Override
public int hashCode() {
return Objects.hash(items);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListUserApiKeys {\n");
sb.append(" items: ").append(toIndentedString(items)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/LogAsyncRequest.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.SegmentTag;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Request payload for LogAsync.
*/
@ApiModel(description = "Request payload for LogAsync.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class LogAsyncRequest {
public static final String SERIALIZED_NAME_DATASET_TIMESTAMP = "datasetTimestamp";
@SerializedName(SERIALIZED_NAME_DATASET_TIMESTAMP)
private Long datasetTimestamp;
public static final String SERIALIZED_NAME_SEGMENT_TAGS = "segmentTags";
@SerializedName(SERIALIZED_NAME_SEGMENT_TAGS)
private List<SegmentTag> segmentTags = null;
public LogAsyncRequest datasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
return this;
}
/**
* Get datasetTimestamp
* @return datasetTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDatasetTimestamp() {
return datasetTimestamp;
}
public void setDatasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
}
public LogAsyncRequest segmentTags(List<SegmentTag> segmentTags) {
this.segmentTags = segmentTags;
return this;
}
public LogAsyncRequest addSegmentTagsItem(SegmentTag segmentTagsItem) {
if (this.segmentTags == null) {
this.segmentTags = new ArrayList<>();
}
this.segmentTags.add(segmentTagsItem);
return this;
}
/**
* Get segmentTags
* @return segmentTags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<SegmentTag> getSegmentTags() {
return segmentTags;
}
public void setSegmentTags(List<SegmentTag> segmentTags) {
this.segmentTags = segmentTags;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LogAsyncRequest logAsyncRequest = (LogAsyncRequest) o;
return Objects.equals(this.datasetTimestamp, logAsyncRequest.datasetTimestamp) &&
Objects.equals(this.segmentTags, logAsyncRequest.segmentTags);
}
@Override
public int hashCode() {
return Objects.hash(datasetTimestamp, segmentTags);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LogAsyncRequest {\n");
sb.append(" datasetTimestamp: ").append(toIndentedString(datasetTimestamp)).append("\n");
sb.append(" segmentTags: ").append(toIndentedString(segmentTags)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/LogReferenceRequest.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Request payload for LogReference.
*/
@ApiModel(description = "Request payload for LogReference.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class LogReferenceRequest {
public static final String SERIALIZED_NAME_ALIAS = "alias";
@SerializedName(SERIALIZED_NAME_ALIAS)
private String alias;
public static final String SERIALIZED_NAME_DATASET_TIMESTAMP = "datasetTimestamp";
@SerializedName(SERIALIZED_NAME_DATASET_TIMESTAMP)
private Long datasetTimestamp;
public LogReferenceRequest alias(String alias) {
this.alias = alias;
return this;
}
/**
* Get alias
* @return alias
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public LogReferenceRequest datasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
return this;
}
/**
* Get datasetTimestamp
* @return datasetTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDatasetTimestamp() {
return datasetTimestamp;
}
public void setDatasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LogReferenceRequest logReferenceRequest = (LogReferenceRequest) o;
return Objects.equals(this.alias, logReferenceRequest.alias) &&
Objects.equals(this.datasetTimestamp, logReferenceRequest.datasetTimestamp);
}
@Override
public int hashCode() {
return Objects.hash(alias, datasetTimestamp);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LogReferenceRequest {\n");
sb.append(" alias: ").append(toIndentedString(alias)).append("\n");
sb.append(" datasetTimestamp: ").append(toIndentedString(datasetTimestamp)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/LogReferenceResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response payload for uploading reference profile.
*/
@ApiModel(description = "Response payload for uploading reference profile.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class LogReferenceResponse {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_ALIAS = "alias";
@SerializedName(SERIALIZED_NAME_ALIAS)
private String alias;
public static final String SERIALIZED_NAME_UPLOAD_TIMESTAMP = "uploadTimestamp";
@SerializedName(SERIALIZED_NAME_UPLOAD_TIMESTAMP)
private Long uploadTimestamp;
public static final String SERIALIZED_NAME_UPLOAD_URL = "uploadUrl";
@SerializedName(SERIALIZED_NAME_UPLOAD_URL)
private String uploadUrl;
public LogReferenceResponse id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public LogReferenceResponse modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public LogReferenceResponse alias(String alias) {
this.alias = alias;
return this;
}
/**
* Get alias
* @return alias
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public LogReferenceResponse uploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
return this;
}
/**
* Get uploadTimestamp
* @return uploadTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getUploadTimestamp() {
return uploadTimestamp;
}
public void setUploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
}
public LogReferenceResponse uploadUrl(String uploadUrl) {
this.uploadUrl = uploadUrl;
return this;
}
/**
* Get uploadUrl
* @return uploadUrl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getUploadUrl() {
return uploadUrl;
}
public void setUploadUrl(String uploadUrl) {
this.uploadUrl = uploadUrl;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LogReferenceResponse logReferenceResponse = (LogReferenceResponse) o;
return Objects.equals(this.id, logReferenceResponse.id) &&
Objects.equals(this.modelId, logReferenceResponse.modelId) &&
Objects.equals(this.alias, logReferenceResponse.alias) &&
Objects.equals(this.uploadTimestamp, logReferenceResponse.uploadTimestamp) &&
Objects.equals(this.uploadUrl, logReferenceResponse.uploadUrl);
}
@Override
public int hashCode() {
return Objects.hash(id, modelId, alias, uploadTimestamp, uploadUrl);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LogReferenceResponse {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" alias: ").append(toIndentedString(alias)).append("\n");
sb.append(" uploadTimestamp: ").append(toIndentedString(uploadTimestamp)).append("\n");
sb.append(" uploadUrl: ").append(toIndentedString(uploadUrl)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/LogResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response payload for UploadDatasetProfile.
*/
@ApiModel(description = "Response payload for UploadDatasetProfile.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class LogResponse {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_UPLOAD_TIMESTAMP = "uploadTimestamp";
@SerializedName(SERIALIZED_NAME_UPLOAD_TIMESTAMP)
private Long uploadTimestamp;
public LogResponse id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public LogResponse modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public LogResponse uploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
return this;
}
/**
* Get uploadTimestamp
* @return uploadTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getUploadTimestamp() {
return uploadTimestamp;
}
public void setUploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LogResponse logResponse = (LogResponse) o;
return Objects.equals(this.id, logResponse.id) &&
Objects.equals(this.modelId, logResponse.modelId) &&
Objects.equals(this.uploadTimestamp, logResponse.uploadTimestamp);
}
@Override
public int hashCode() {
return Objects.hash(id, modelId, uploadTimestamp);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LogResponse {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" uploadTimestamp: ").append(toIndentedString(uploadTimestamp)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/Membership.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Role;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Response for the GetMemberships API
*/
@ApiModel(description = "Response for the GetMemberships API")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class Membership {
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_DEFAULT = "default";
@SerializedName(SERIALIZED_NAME_DEFAULT)
private Boolean _default;
public static final String SERIALIZED_NAME_ROLE = "role";
@SerializedName(SERIALIZED_NAME_ROLE)
private Role role;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private String userId;
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
private String email;
public Membership orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@ApiModelProperty(required = true, value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public Membership _default(Boolean _default) {
this._default = _default;
return this;
}
/**
* Get _default
* @return _default
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getDefault() {
return _default;
}
public void setDefault(Boolean _default) {
this._default = _default;
}
public Membership role(Role role) {
this.role = role;
return this;
}
/**
* Get role
* @return role
**/
@ApiModelProperty(required = true, value = "")
public Role getRole() {
return role;
}
public void setRole(Role role) {
this.role = role;
}
public Membership userId(String userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@ApiModelProperty(required = true, value = "")
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public Membership email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
**/
@ApiModelProperty(required = true, value = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Membership membership = (Membership) o;
return Objects.equals(this.orgId, membership.orgId) &&
Objects.equals(this._default, membership._default) &&
Objects.equals(this.role, membership.role) &&
Objects.equals(this.userId, membership.userId) &&
Objects.equals(this.email, membership.email);
}
@Override
public int hashCode() {
return Objects.hash(orgId, _default, role, userId, email);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Membership {\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" _default: ").append(toIndentedString(_default)).append("\n");
sb.append(" role: ").append(toIndentedString(role)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/MembershipMetadata.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Role;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* MembershipMetadata
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class MembershipMetadata {
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_ROLE = "role";
@SerializedName(SERIALIZED_NAME_ROLE)
private Role role;
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private String userId;
public static final String SERIALIZED_NAME_DEFAULT = "default";
@SerializedName(SERIALIZED_NAME_DEFAULT)
private Boolean _default;
public MembershipMetadata orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public MembershipMetadata role(Role role) {
this.role = role;
return this;
}
/**
* Get role
* @return role
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Role getRole() {
return role;
}
public void setRole(Role role) {
this.role = role;
}
public MembershipMetadata userId(String userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public MembershipMetadata _default(Boolean _default) {
this._default = _default;
return this;
}
/**
* Get _default
* @return _default
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getDefault() {
return _default;
}
public void setDefault(Boolean _default) {
this._default = _default;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MembershipMetadata membershipMetadata = (MembershipMetadata) o;
return Objects.equals(this.orgId, membershipMetadata.orgId) &&
Objects.equals(this.role, membershipMetadata.role) &&
Objects.equals(this.userId, membershipMetadata.userId) &&
Objects.equals(this._default, membershipMetadata._default);
}
@Override
public int hashCode() {
return Objects.hash(orgId, role, userId, _default);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MembershipMetadata {\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" role: ").append(toIndentedString(role)).append("\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" _default: ").append(toIndentedString(_default)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/MergeJobCompletionSummary.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* MergeJobCompletionSummary
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class MergeJobCompletionSummary {
public static final String SERIALIZED_NAME_PROCESSED_LOG_ENTRY_COUNT = "processedLogEntryCount";
@SerializedName(SERIALIZED_NAME_PROCESSED_LOG_ENTRY_COUNT)
private Integer processedLogEntryCount;
public static final String SERIALIZED_NAME_PROCESSED_PART_PROFILE_COUNT = "processedPartProfileCount";
@SerializedName(SERIALIZED_NAME_PROCESSED_PART_PROFILE_COUNT)
private Integer processedPartProfileCount;
public static final String SERIALIZED_NAME_UNPROCESSED_ITEMS = "unprocessedItems";
@SerializedName(SERIALIZED_NAME_UNPROCESSED_ITEMS)
private Integer unprocessedItems;
public MergeJobCompletionSummary processedLogEntryCount(Integer processedLogEntryCount) {
this.processedLogEntryCount = processedLogEntryCount;
return this;
}
/**
* Get processedLogEntryCount
* @return processedLogEntryCount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getProcessedLogEntryCount() {
return processedLogEntryCount;
}
public void setProcessedLogEntryCount(Integer processedLogEntryCount) {
this.processedLogEntryCount = processedLogEntryCount;
}
public MergeJobCompletionSummary processedPartProfileCount(Integer processedPartProfileCount) {
this.processedPartProfileCount = processedPartProfileCount;
return this;
}
/**
* Get processedPartProfileCount
* @return processedPartProfileCount
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getProcessedPartProfileCount() {
return processedPartProfileCount;
}
public void setProcessedPartProfileCount(Integer processedPartProfileCount) {
this.processedPartProfileCount = processedPartProfileCount;
}
public MergeJobCompletionSummary unprocessedItems(Integer unprocessedItems) {
this.unprocessedItems = unprocessedItems;
return this;
}
/**
* Get unprocessedItems
* @return unprocessedItems
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Integer getUnprocessedItems() {
return unprocessedItems;
}
public void setUnprocessedItems(Integer unprocessedItems) {
this.unprocessedItems = unprocessedItems;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MergeJobCompletionSummary mergeJobCompletionSummary = (MergeJobCompletionSummary) o;
return Objects.equals(this.processedLogEntryCount, mergeJobCompletionSummary.processedLogEntryCount) &&
Objects.equals(this.processedPartProfileCount, mergeJobCompletionSummary.processedPartProfileCount) &&
Objects.equals(this.unprocessedItems, mergeJobCompletionSummary.unprocessedItems);
}
@Override
public int hashCode() {
return Objects.hash(processedLogEntryCount, processedPartProfileCount, unprocessedItems);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MergeJobCompletionSummary {\n");
sb.append(" processedLogEntryCount: ").append(toIndentedString(processedLogEntryCount)).append("\n");
sb.append(" processedPartProfileCount: ").append(toIndentedString(processedPartProfileCount)).append("\n");
sb.append(" unprocessedItems: ").append(toIndentedString(unprocessedItems)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ModelMetadata.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.ModelType;
import ai.whylabs.service.model.TimePeriod;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Detailed metadata about a model
*/
@ApiModel(description = "Detailed metadata about a model")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ModelMetadata {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CREATION_TIME = "creationTime";
@SerializedName(SERIALIZED_NAME_CREATION_TIME)
private Long creationTime;
public static final String SERIALIZED_NAME_TIME_PERIOD = "timePeriod";
@SerializedName(SERIALIZED_NAME_TIME_PERIOD)
private TimePeriod timePeriod;
public static final String SERIALIZED_NAME_MODEL_TYPE = "modelType";
@SerializedName(SERIALIZED_NAME_MODEL_TYPE)
private ModelType modelType;
public static final String SERIALIZED_NAME_ACTIVE = "active";
@SerializedName(SERIALIZED_NAME_ACTIVE)
private Boolean active;
public ModelMetadata id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(required = true, value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public ModelMetadata orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public ModelMetadata name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@ApiModelProperty(required = true, value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ModelMetadata creationTime(Long creationTime) {
this.creationTime = creationTime;
return this;
}
/**
* Get creationTime
* @return creationTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getCreationTime() {
return creationTime;
}
public void setCreationTime(Long creationTime) {
this.creationTime = creationTime;
}
public ModelMetadata timePeriod(TimePeriod timePeriod) {
this.timePeriod = timePeriod;
return this;
}
/**
* Get timePeriod
* @return timePeriod
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public TimePeriod getTimePeriod() {
return timePeriod;
}
public void setTimePeriod(TimePeriod timePeriod) {
this.timePeriod = timePeriod;
}
public ModelMetadata modelType(ModelType modelType) {
this.modelType = modelType;
return this;
}
/**
* Get modelType
* @return modelType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public ModelType getModelType() {
return modelType;
}
public void setModelType(ModelType modelType) {
this.modelType = modelType;
}
public ModelMetadata active(Boolean active) {
this.active = active;
return this;
}
/**
* Get active
* @return active
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getActive() {
return active;
}
public void setActive(Boolean active) {
this.active = active;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelMetadata modelMetadata = (ModelMetadata) o;
return Objects.equals(this.id, modelMetadata.id) &&
Objects.equals(this.orgId, modelMetadata.orgId) &&
Objects.equals(this.name, modelMetadata.name) &&
Objects.equals(this.creationTime, modelMetadata.creationTime) &&
Objects.equals(this.timePeriod, modelMetadata.timePeriod) &&
Objects.equals(this.modelType, modelMetadata.modelType) &&
Objects.equals(this.active, modelMetadata.active);
}
@Override
public int hashCode() {
return Objects.hash(id, orgId, name, creationTime, timePeriod, modelType, active);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelMetadata {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n");
sb.append(" timePeriod: ").append(toIndentedString(timePeriod)).append("\n");
sb.append(" modelType: ").append(toIndentedString(modelType)).append("\n");
sb.append(" active: ").append(toIndentedString(active)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ModelType.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import io.swagger.annotations.ApiModel;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* The type of model associated with the dataset
*/
@JsonAdapter(ModelType.Adapter.class)
public enum ModelType {
CLASSIFICATION("CLASSIFICATION"),
REGRESSION("REGRESSION"),
EMBEDDINGS("EMBEDDINGS");
private String value;
ModelType(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ModelType fromValue(String value) {
for (ModelType b : ModelType.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<ModelType> {
@Override
public void write(final JsonWriter jsonWriter, final ModelType enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ModelType read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ModelType.fromValue(value);
}
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/MonitorConfig.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Segment;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Object contains serialized monitor config
*/
@ApiModel(description = "Object contains serialized monitor config")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class MonitorConfig {
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_SEGMENT = "segment";
@SerializedName(SERIALIZED_NAME_SEGMENT)
private Segment segment;
public static final String SERIALIZED_NAME_CONFIG = "config";
@SerializedName(SERIALIZED_NAME_CONFIG)
private String config;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private Long version;
public static final String SERIALIZED_NAME_UPDATED_TIME = "updatedTime";
@SerializedName(SERIALIZED_NAME_UPDATED_TIME)
private Long updatedTime;
public MonitorConfig orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public MonitorConfig modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public MonitorConfig segment(Segment segment) {
this.segment = segment;
return this;
}
/**
* Get segment
* @return segment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Segment getSegment() {
return segment;
}
public void setSegment(Segment segment) {
this.segment = segment;
}
public MonitorConfig config(String config) {
this.config = config;
return this;
}
/**
* Get config
* @return config
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getConfig() {
return config;
}
public void setConfig(String config) {
this.config = config;
}
public MonitorConfig version(Long version) {
this.version = version;
return this;
}
/**
* Get version
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
public MonitorConfig updatedTime(Long updatedTime) {
this.updatedTime = updatedTime;
return this;
}
/**
* Get updatedTime
* @return updatedTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Long updatedTime) {
this.updatedTime = updatedTime;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MonitorConfig monitorConfig = (MonitorConfig) o;
return Objects.equals(this.orgId, monitorConfig.orgId) &&
Objects.equals(this.modelId, monitorConfig.modelId) &&
Objects.equals(this.segment, monitorConfig.segment) &&
Objects.equals(this.config, monitorConfig.config) &&
Objects.equals(this.version, monitorConfig.version) &&
Objects.equals(this.updatedTime, monitorConfig.updatedTime);
}
@Override
public int hashCode() {
return Objects.hash(orgId, modelId, segment, config, version, updatedTime);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MonitorConfig {\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" segment: ").append(toIndentedString(segment)).append("\n");
sb.append(" config: ").append(toIndentedString(config)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/NotificationSettings.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.UberNotificationSchedule;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Settings that control how and when notifications are delivered.
*/
@ApiModel(description = "Settings that control how and when notifications are delivered.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class NotificationSettings {
public static final String SERIALIZED_NAME_EMAIL_SETTINGS = "emailSettings";
@SerializedName(SERIALIZED_NAME_EMAIL_SETTINGS)
private UberNotificationSchedule emailSettings;
public static final String SERIALIZED_NAME_SLACK_SETTINGS = "slackSettings";
@SerializedName(SERIALIZED_NAME_SLACK_SETTINGS)
private UberNotificationSchedule slackSettings;
public NotificationSettings emailSettings(UberNotificationSchedule emailSettings) {
this.emailSettings = emailSettings;
return this;
}
/**
* Get emailSettings
* @return emailSettings
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UberNotificationSchedule getEmailSettings() {
return emailSettings;
}
public void setEmailSettings(UberNotificationSchedule emailSettings) {
this.emailSettings = emailSettings;
}
public NotificationSettings slackSettings(UberNotificationSchedule slackSettings) {
this.slackSettings = slackSettings;
return this;
}
/**
* Get slackSettings
* @return slackSettings
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public UberNotificationSchedule getSlackSettings() {
return slackSettings;
}
public void setSlackSettings(UberNotificationSchedule slackSettings) {
this.slackSettings = slackSettings;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NotificationSettings notificationSettings = (NotificationSettings) o;
return Objects.equals(this.emailSettings, notificationSettings.emailSettings) &&
Objects.equals(this.slackSettings, notificationSettings.slackSettings);
}
@Override
public int hashCode() {
return Objects.hash(emailSettings, slackSettings);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NotificationSettings {\n");
sb.append(" emailSettings: ").append(toIndentedString(emailSettings)).append("\n");
sb.append(" slackSettings: ").append(toIndentedString(slackSettings)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/NotificationSettingsDay.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* Gets or Sets NotificationSettingsDay
*/
@JsonAdapter(NotificationSettingsDay.Adapter.class)
public enum NotificationSettingsDay {
SUNDAY("SUNDAY"),
MONDAY("MONDAY"),
TUESDAY("TUESDAY"),
WEDNESDAY("WEDNESDAY"),
THURSDAY("THURSDAY"),
FRIDAY("FRIDAY"),
SATURDAY("SATURDAY");
private String value;
NotificationSettingsDay(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static NotificationSettingsDay fromValue(String value) {
for (NotificationSettingsDay b : NotificationSettingsDay.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<NotificationSettingsDay> {
@Override
public void write(final JsonWriter jsonWriter, final NotificationSettingsDay enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public NotificationSettingsDay read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return NotificationSettingsDay.fromValue(value);
}
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/NotificationSqsMessageCadence.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* Gets or Sets NotificationSqsMessageCadence
*/
@JsonAdapter(NotificationSqsMessageCadence.Adapter.class)
public enum NotificationSqsMessageCadence {
DAILY("DAILY"),
WEEKLY("WEEKLY"),
INDIVIDUAL("INDIVIDUAL");
private String value;
NotificationSqsMessageCadence(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static NotificationSqsMessageCadence fromValue(String value) {
for (NotificationSqsMessageCadence b : NotificationSqsMessageCadence.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<NotificationSqsMessageCadence> {
@Override
public void write(final JsonWriter jsonWriter, final NotificationSqsMessageCadence enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public NotificationSqsMessageCadence read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return NotificationSqsMessageCadence.fromValue(value);
}
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/OrganizationMetadata.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.NotificationSettings;
import ai.whylabs.service.model.SubscriptionTier;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Metadata about an organization
*/
@ApiModel(description = "Metadata about an organization")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class OrganizationMetadata {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_SUBSCRIPTION_TIER = "subscriptionTier";
@SerializedName(SERIALIZED_NAME_SUBSCRIPTION_TIER)
private SubscriptionTier subscriptionTier;
public static final String SERIALIZED_NAME_DOMAIN = "domain";
@SerializedName(SERIALIZED_NAME_DOMAIN)
private String domain;
public static final String SERIALIZED_NAME_OBSERVATORY_URL = "observatoryUrl";
@SerializedName(SERIALIZED_NAME_OBSERVATORY_URL)
private String observatoryUrl;
public static final String SERIALIZED_NAME_NOTIFICATION_EMAIL_ADDRESS = "notificationEmailAddress";
@SerializedName(SERIALIZED_NAME_NOTIFICATION_EMAIL_ADDRESS)
private String notificationEmailAddress;
public static final String SERIALIZED_NAME_SLACK_WEBHOOK = "slackWebhook";
@SerializedName(SERIALIZED_NAME_SLACK_WEBHOOK)
private String slackWebhook;
public static final String SERIALIZED_NAME_CREATION_TIME = "creationTime";
@SerializedName(SERIALIZED_NAME_CREATION_TIME)
private Long creationTime;
public static final String SERIALIZED_NAME_NOTIFICATION_SETTINGS = "notificationSettings";
@SerializedName(SERIALIZED_NAME_NOTIFICATION_SETTINGS)
private NotificationSettings notificationSettings;
public static final String SERIALIZED_NAME_DELETED = "deleted";
@SerializedName(SERIALIZED_NAME_DELETED)
private Boolean deleted;
public OrganizationMetadata id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(required = true, value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public OrganizationMetadata name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public OrganizationMetadata subscriptionTier(SubscriptionTier subscriptionTier) {
this.subscriptionTier = subscriptionTier;
return this;
}
/**
* Get subscriptionTier
* @return subscriptionTier
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public SubscriptionTier getSubscriptionTier() {
return subscriptionTier;
}
public void setSubscriptionTier(SubscriptionTier subscriptionTier) {
this.subscriptionTier = subscriptionTier;
}
public OrganizationMetadata domain(String domain) {
this.domain = domain;
return this;
}
/**
* Get domain
* @return domain
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public OrganizationMetadata observatoryUrl(String observatoryUrl) {
this.observatoryUrl = observatoryUrl;
return this;
}
/**
* Get observatoryUrl
* @return observatoryUrl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getObservatoryUrl() {
return observatoryUrl;
}
public void setObservatoryUrl(String observatoryUrl) {
this.observatoryUrl = observatoryUrl;
}
public OrganizationMetadata notificationEmailAddress(String notificationEmailAddress) {
this.notificationEmailAddress = notificationEmailAddress;
return this;
}
/**
* Get notificationEmailAddress
* @return notificationEmailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getNotificationEmailAddress() {
return notificationEmailAddress;
}
public void setNotificationEmailAddress(String notificationEmailAddress) {
this.notificationEmailAddress = notificationEmailAddress;
}
public OrganizationMetadata slackWebhook(String slackWebhook) {
this.slackWebhook = slackWebhook;
return this;
}
/**
* Get slackWebhook
* @return slackWebhook
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSlackWebhook() {
return slackWebhook;
}
public void setSlackWebhook(String slackWebhook) {
this.slackWebhook = slackWebhook;
}
public OrganizationMetadata creationTime(Long creationTime) {
this.creationTime = creationTime;
return this;
}
/**
* Get creationTime
* @return creationTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getCreationTime() {
return creationTime;
}
public void setCreationTime(Long creationTime) {
this.creationTime = creationTime;
}
public OrganizationMetadata notificationSettings(NotificationSettings notificationSettings) {
this.notificationSettings = notificationSettings;
return this;
}
/**
* Get notificationSettings
* @return notificationSettings
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public NotificationSettings getNotificationSettings() {
return notificationSettings;
}
public void setNotificationSettings(NotificationSettings notificationSettings) {
this.notificationSettings = notificationSettings;
}
public OrganizationMetadata deleted(Boolean deleted) {
this.deleted = deleted;
return this;
}
/**
* Get deleted
* @return deleted
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getDeleted() {
return deleted;
}
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrganizationMetadata organizationMetadata = (OrganizationMetadata) o;
return Objects.equals(this.id, organizationMetadata.id) &&
Objects.equals(this.name, organizationMetadata.name) &&
Objects.equals(this.subscriptionTier, organizationMetadata.subscriptionTier) &&
Objects.equals(this.domain, organizationMetadata.domain) &&
Objects.equals(this.observatoryUrl, organizationMetadata.observatoryUrl) &&
Objects.equals(this.notificationEmailAddress, organizationMetadata.notificationEmailAddress) &&
Objects.equals(this.slackWebhook, organizationMetadata.slackWebhook) &&
Objects.equals(this.creationTime, organizationMetadata.creationTime) &&
Objects.equals(this.notificationSettings, organizationMetadata.notificationSettings) &&
Objects.equals(this.deleted, organizationMetadata.deleted);
}
@Override
public int hashCode() {
return Objects.hash(id, name, subscriptionTier, domain, observatoryUrl, notificationEmailAddress, slackWebhook, creationTime, notificationSettings, deleted);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrganizationMetadata {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" subscriptionTier: ").append(toIndentedString(subscriptionTier)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" observatoryUrl: ").append(toIndentedString(observatoryUrl)).append("\n");
sb.append(" notificationEmailAddress: ").append(toIndentedString(notificationEmailAddress)).append("\n");
sb.append(" slackWebhook: ").append(toIndentedString(slackWebhook)).append("\n");
sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n");
sb.append(" notificationSettings: ").append(toIndentedString(notificationSettings)).append("\n");
sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/OrganizationSummary.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.NotificationSettings;
import ai.whylabs.service.model.SubscriptionTier;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Summary about an organization
*/
@ApiModel(description = "Summary about an organization")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class OrganizationSummary {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_SUBSCRIPTION_TIER = "subscriptionTier";
@SerializedName(SERIALIZED_NAME_SUBSCRIPTION_TIER)
private SubscriptionTier subscriptionTier;
public static final String SERIALIZED_NAME_DOMAIN = "domain";
@SerializedName(SERIALIZED_NAME_DOMAIN)
private String domain;
public static final String SERIALIZED_NAME_OBSERVATORY_URL = "observatoryUrl";
@SerializedName(SERIALIZED_NAME_OBSERVATORY_URL)
private String observatoryUrl;
public static final String SERIALIZED_NAME_NOTIFICATION_EMAIL_ADDRESS = "notificationEmailAddress";
@SerializedName(SERIALIZED_NAME_NOTIFICATION_EMAIL_ADDRESS)
private String notificationEmailAddress;
public static final String SERIALIZED_NAME_SLACK_WEBHOOK = "slackWebhook";
@SerializedName(SERIALIZED_NAME_SLACK_WEBHOOK)
private String slackWebhook;
public static final String SERIALIZED_NAME_NOTIFICATION_SETTINGS = "notificationSettings";
@SerializedName(SERIALIZED_NAME_NOTIFICATION_SETTINGS)
private NotificationSettings notificationSettings;
public OrganizationSummary id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(required = true, value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public OrganizationSummary name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public OrganizationSummary subscriptionTier(SubscriptionTier subscriptionTier) {
this.subscriptionTier = subscriptionTier;
return this;
}
/**
* Get subscriptionTier
* @return subscriptionTier
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public SubscriptionTier getSubscriptionTier() {
return subscriptionTier;
}
public void setSubscriptionTier(SubscriptionTier subscriptionTier) {
this.subscriptionTier = subscriptionTier;
}
public OrganizationSummary domain(String domain) {
this.domain = domain;
return this;
}
/**
* Get domain
* @return domain
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public OrganizationSummary observatoryUrl(String observatoryUrl) {
this.observatoryUrl = observatoryUrl;
return this;
}
/**
* Get observatoryUrl
* @return observatoryUrl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getObservatoryUrl() {
return observatoryUrl;
}
public void setObservatoryUrl(String observatoryUrl) {
this.observatoryUrl = observatoryUrl;
}
public OrganizationSummary notificationEmailAddress(String notificationEmailAddress) {
this.notificationEmailAddress = notificationEmailAddress;
return this;
}
/**
* Get notificationEmailAddress
* @return notificationEmailAddress
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getNotificationEmailAddress() {
return notificationEmailAddress;
}
public void setNotificationEmailAddress(String notificationEmailAddress) {
this.notificationEmailAddress = notificationEmailAddress;
}
public OrganizationSummary slackWebhook(String slackWebhook) {
this.slackWebhook = slackWebhook;
return this;
}
/**
* Get slackWebhook
* @return slackWebhook
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getSlackWebhook() {
return slackWebhook;
}
public void setSlackWebhook(String slackWebhook) {
this.slackWebhook = slackWebhook;
}
public OrganizationSummary notificationSettings(NotificationSettings notificationSettings) {
this.notificationSettings = notificationSettings;
return this;
}
/**
* Get notificationSettings
* @return notificationSettings
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public NotificationSettings getNotificationSettings() {
return notificationSettings;
}
public void setNotificationSettings(NotificationSettings notificationSettings) {
this.notificationSettings = notificationSettings;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrganizationSummary organizationSummary = (OrganizationSummary) o;
return Objects.equals(this.id, organizationSummary.id) &&
Objects.equals(this.name, organizationSummary.name) &&
Objects.equals(this.subscriptionTier, organizationSummary.subscriptionTier) &&
Objects.equals(this.domain, organizationSummary.domain) &&
Objects.equals(this.observatoryUrl, organizationSummary.observatoryUrl) &&
Objects.equals(this.notificationEmailAddress, organizationSummary.notificationEmailAddress) &&
Objects.equals(this.slackWebhook, organizationSummary.slackWebhook) &&
Objects.equals(this.notificationSettings, organizationSummary.notificationSettings);
}
@Override
public int hashCode() {
return Objects.hash(id, name, subscriptionTier, domain, observatoryUrl, notificationEmailAddress, slackWebhook, notificationSettings);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrganizationSummary {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" subscriptionTier: ").append(toIndentedString(subscriptionTier)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" observatoryUrl: ").append(toIndentedString(observatoryUrl)).append("\n");
sb.append(" notificationEmailAddress: ").append(toIndentedString(notificationEmailAddress)).append("\n");
sb.append(" slackWebhook: ").append(toIndentedString(slackWebhook)).append("\n");
sb.append(" notificationSettings: ").append(toIndentedString(notificationSettings)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ProvidedConfig.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.Segment;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Information about WhyLabs Provide Config
*/
@ApiModel(description = "Information about WhyLabs Provide Config")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ProvidedConfig {
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_SEGMENT = "segment";
@SerializedName(SERIALIZED_NAME_SEGMENT)
private Segment segment;
public static final String SERIALIZED_NAME_CONFIG = "config";
@SerializedName(SERIALIZED_NAME_CONFIG)
private String config;
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private Long version;
public static final String SERIALIZED_NAME_UPDATED_TIME = "updatedTime";
@SerializedName(SERIALIZED_NAME_UPDATED_TIME)
private Long updatedTime;
public ProvidedConfig orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public ProvidedConfig modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public ProvidedConfig segment(Segment segment) {
this.segment = segment;
return this;
}
/**
* Get segment
* @return segment
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Segment getSegment() {
return segment;
}
public void setSegment(Segment segment) {
this.segment = segment;
}
public ProvidedConfig config(String config) {
this.config = config;
return this;
}
/**
* Get config
* @return config
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getConfig() {
return config;
}
public void setConfig(String config) {
this.config = config;
}
public ProvidedConfig version(Long version) {
this.version = version;
return this;
}
/**
* Get version
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
public ProvidedConfig updatedTime(Long updatedTime) {
this.updatedTime = updatedTime;
return this;
}
/**
* Get updatedTime
* @return updatedTime
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Long updatedTime) {
this.updatedTime = updatedTime;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ProvidedConfig providedConfig = (ProvidedConfig) o;
return Objects.equals(this.orgId, providedConfig.orgId) &&
Objects.equals(this.modelId, providedConfig.modelId) &&
Objects.equals(this.segment, providedConfig.segment) &&
Objects.equals(this.config, providedConfig.config) &&
Objects.equals(this.version, providedConfig.version) &&
Objects.equals(this.updatedTime, providedConfig.updatedTime);
}
@Override
public int hashCode() {
return Objects.hash(orgId, modelId, segment, config, version, updatedTime);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ProvidedConfig {\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" segment: ").append(toIndentedString(segment)).append("\n");
sb.append(" config: ").append(toIndentedString(config)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ProvisionNewUserRequest.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.SubscriptionTier;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* ProvisionNewUserRequest
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ProvisionNewUserRequest {
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
private String email;
public static final String SERIALIZED_NAME_ORG_NAME = "orgName";
@SerializedName(SERIALIZED_NAME_ORG_NAME)
private String orgName;
public static final String SERIALIZED_NAME_MODEL_NAME = "modelName";
@SerializedName(SERIALIZED_NAME_MODEL_NAME)
private String modelName;
public static final String SERIALIZED_NAME_SUBSCRIPTION_TIER = "subscriptionTier";
@SerializedName(SERIALIZED_NAME_SUBSCRIPTION_TIER)
private SubscriptionTier subscriptionTier;
public static final String SERIALIZED_NAME_EXPECT_EXISTING = "expectExisting";
@SerializedName(SERIALIZED_NAME_EXPECT_EXISTING)
private Boolean expectExisting;
public ProvisionNewUserRequest email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
**/
@ApiModelProperty(required = true, value = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public ProvisionNewUserRequest orgName(String orgName) {
this.orgName = orgName;
return this;
}
/**
* Get orgName
* @return orgName
**/
@ApiModelProperty(required = true, value = "")
public String getOrgName() {
return orgName;
}
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public ProvisionNewUserRequest modelName(String modelName) {
this.modelName = modelName;
return this;
}
/**
* Get modelName
* @return modelName
**/
@ApiModelProperty(required = true, value = "")
public String getModelName() {
return modelName;
}
public void setModelName(String modelName) {
this.modelName = modelName;
}
public ProvisionNewUserRequest subscriptionTier(SubscriptionTier subscriptionTier) {
this.subscriptionTier = subscriptionTier;
return this;
}
/**
* Get subscriptionTier
* @return subscriptionTier
**/
@ApiModelProperty(required = true, value = "")
public SubscriptionTier getSubscriptionTier() {
return subscriptionTier;
}
public void setSubscriptionTier(SubscriptionTier subscriptionTier) {
this.subscriptionTier = subscriptionTier;
}
public ProvisionNewUserRequest expectExisting(Boolean expectExisting) {
this.expectExisting = expectExisting;
return this;
}
/**
* Get expectExisting
* @return expectExisting
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Boolean getExpectExisting() {
return expectExisting;
}
public void setExpectExisting(Boolean expectExisting) {
this.expectExisting = expectExisting;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ProvisionNewUserRequest provisionNewUserRequest = (ProvisionNewUserRequest) o;
return Objects.equals(this.email, provisionNewUserRequest.email) &&
Objects.equals(this.orgName, provisionNewUserRequest.orgName) &&
Objects.equals(this.modelName, provisionNewUserRequest.modelName) &&
Objects.equals(this.subscriptionTier, provisionNewUserRequest.subscriptionTier) &&
Objects.equals(this.expectExisting, provisionNewUserRequest.expectExisting);
}
@Override
public int hashCode() {
return Objects.hash(email, orgName, modelName, subscriptionTier, expectExisting);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ProvisionNewUserRequest {\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" orgName: ").append(toIndentedString(orgName)).append("\n");
sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n");
sb.append(" subscriptionTier: ").append(toIndentedString(subscriptionTier)).append("\n");
sb.append(" expectExisting: ").append(toIndentedString(expectExisting)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ProvisionNewUserResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* ProvisionNewUserResponse
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ProvisionNewUserResponse {
public static final String SERIALIZED_NAME_USER_ID = "userId";
@SerializedName(SERIALIZED_NAME_USER_ID)
private String userId;
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public ProvisionNewUserResponse userId(String userId) {
this.userId = userId;
return this;
}
/**
* Get userId
* @return userId
**/
@ApiModelProperty(required = true, value = "")
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public ProvisionNewUserResponse orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@ApiModelProperty(required = true, value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public ProvisionNewUserResponse modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@ApiModelProperty(required = true, value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ProvisionNewUserResponse provisionNewUserResponse = (ProvisionNewUserResponse) o;
return Objects.equals(this.userId, provisionNewUserResponse.userId) &&
Objects.equals(this.orgId, provisionNewUserResponse.orgId) &&
Objects.equals(this.modelId, provisionNewUserResponse.modelId);
}
@Override
public int hashCode() {
return Objects.hash(userId, orgId, modelId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ProvisionNewUserResponse {\n");
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/ReferenceProfileItemResponse.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* A single reference item response.
*/
@ApiModel(description = "A single reference item response.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class ReferenceProfileItemResponse {
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_MODEL_ID = "modelId";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
private String modelId;
public static final String SERIALIZED_NAME_ALIAS = "alias";
@SerializedName(SERIALIZED_NAME_ALIAS)
private String alias;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_UPLOAD_TIMESTAMP = "uploadTimestamp";
@SerializedName(SERIALIZED_NAME_UPLOAD_TIMESTAMP)
private Long uploadTimestamp;
public static final String SERIALIZED_NAME_DATASET_TIMESTAMP = "datasetTimestamp";
@SerializedName(SERIALIZED_NAME_DATASET_TIMESTAMP)
private Long datasetTimestamp;
public static final String SERIALIZED_NAME_PATH = "path";
@SerializedName(SERIALIZED_NAME_PATH)
private String path;
public ReferenceProfileItemResponse orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public ReferenceProfileItemResponse modelId(String modelId) {
this.modelId = modelId;
return this;
}
/**
* Get modelId
* @return modelId
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getModelId() {
return modelId;
}
public void setModelId(String modelId) {
this.modelId = modelId;
}
public ReferenceProfileItemResponse alias(String alias) {
this.alias = alias;
return this;
}
/**
* Get alias
* @return alias
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public ReferenceProfileItemResponse id(String id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public ReferenceProfileItemResponse uploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
return this;
}
/**
* Get uploadTimestamp
* @return uploadTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getUploadTimestamp() {
return uploadTimestamp;
}
public void setUploadTimestamp(Long uploadTimestamp) {
this.uploadTimestamp = uploadTimestamp;
}
public ReferenceProfileItemResponse datasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
return this;
}
/**
* Get datasetTimestamp
* @return datasetTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Long getDatasetTimestamp() {
return datasetTimestamp;
}
public void setDatasetTimestamp(Long datasetTimestamp) {
this.datasetTimestamp = datasetTimestamp;
}
public ReferenceProfileItemResponse path(String path) {
this.path = path;
return this;
}
/**
* Get path
* @return path
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ReferenceProfileItemResponse referenceProfileItemResponse = (ReferenceProfileItemResponse) o;
return Objects.equals(this.orgId, referenceProfileItemResponse.orgId) &&
Objects.equals(this.modelId, referenceProfileItemResponse.modelId) &&
Objects.equals(this.alias, referenceProfileItemResponse.alias) &&
Objects.equals(this.id, referenceProfileItemResponse.id) &&
Objects.equals(this.uploadTimestamp, referenceProfileItemResponse.uploadTimestamp) &&
Objects.equals(this.datasetTimestamp, referenceProfileItemResponse.datasetTimestamp) &&
Objects.equals(this.path, referenceProfileItemResponse.path);
}
@Override
public int hashCode() {
return Objects.hash(orgId, modelId, alias, id, uploadTimestamp, datasetTimestamp, path);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ReferenceProfileItemResponse {\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" alias: ").append(toIndentedString(alias)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" uploadTimestamp: ").append(toIndentedString(uploadTimestamp)).append("\n");
sb.append(" datasetTimestamp: ").append(toIndentedString(datasetTimestamp)).append("\n");
sb.append(" path: ").append(toIndentedString(path)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/RemoveMembershipRequest.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* RemoveMembershipRequest
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class RemoveMembershipRequest {
public static final String SERIALIZED_NAME_ORG_ID = "orgId";
@SerializedName(SERIALIZED_NAME_ORG_ID)
private String orgId;
public static final String SERIALIZED_NAME_EMAIL = "email";
@SerializedName(SERIALIZED_NAME_EMAIL)
private String email;
public RemoveMembershipRequest orgId(String orgId) {
this.orgId = orgId;
return this;
}
/**
* Get orgId
* @return orgId
**/
@ApiModelProperty(required = true, value = "")
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public RemoveMembershipRequest email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
**/
@ApiModelProperty(required = true, value = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RemoveMembershipRequest removeMembershipRequest = (RemoveMembershipRequest) o;
return Objects.equals(this.orgId, removeMembershipRequest.orgId) &&
Objects.equals(this.email, removeMembershipRequest.email);
}
@Override
public int hashCode() {
return Objects.hash(orgId, email);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RemoveMembershipRequest {\n");
sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/Role.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* Gets or Sets Role
*/
@JsonAdapter(Role.Adapter.class)
public enum Role {
ADMIN("ADMIN"),
MEMBER("MEMBER");
private String value;
Role(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static Role fromValue(String value) {
for (Role b : Role.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<Role> {
@Override
public void write(final JsonWriter jsonWriter, final Role enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public Role read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return Role.fromValue(value);
}
}
}
|
0 | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service | java-sources/ai/whylabs/whylabs-api-client/0.1.8/ai/whylabs/service/model/Segment.java | /*
* WhyLabs API client
* WhyLabs API that enables end-to-end AI observability
*
* The version of the OpenAPI document: 0.1
* Contact: support@whylabs.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package ai.whylabs.service.model;
import java.util.Objects;
import java.util.Arrays;
import ai.whylabs.service.model.SegmentTag;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Segment
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-10-06T09:52:04.507863-07:00[America/Los_Angeles]")
public class Segment {
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<SegmentTag> tags = null;
public Segment tags(List<SegmentTag> tags) {
this.tags = tags;
return this;
}
public Segment addTagsItem(SegmentTag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Get tags
* @return tags
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public List<SegmentTag> getTags() {
return tags;
}
public void setTags(List<SegmentTag> tags) {
this.tags = tags;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Segment segment = (Segment) o;
return Objects.equals(this.tags, segment.tags);
}
@Override
public int hashCode() {
return Objects.hash(tags);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Segment {\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.