
com.dominodatalab.pub.model.NewEndpointV1 Maven / Gradle / Ivy
/*
* Domino Public API
* Domino Public API Endpoints
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.dominodatalab.pub.model;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.dominodatalab.pub.model.EndpointPermissionsDtoV1;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.dominodatalab.pub.invoker.ApiClient;
/**
* NewEndpointV1
*/
@JsonPropertyOrder({
NewEndpointV1.JSON_PROPERTY_ENDPOINT_NAME,
NewEndpointV1.JSON_PROPERTY_ENDPOINT_PERMISSIONS,
NewEndpointV1.JSON_PROPERTY_ENDPOINT_TYPE,
NewEndpointV1.JSON_PROPERTY_MODEL_CONFIG,
NewEndpointV1.JSON_PROPERTY_MODEL_NAME,
NewEndpointV1.JSON_PROPERTY_MODEL_PROVIDER
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T16:37:28.765500600-04:00[America/New_York]", comments = "Generator version: 7.8.0")
public class NewEndpointV1 {
public static final String JSON_PROPERTY_ENDPOINT_NAME = "endpointName";
private String endpointName;
public static final String JSON_PROPERTY_ENDPOINT_PERMISSIONS = "endpointPermissions";
private EndpointPermissionsDtoV1 endpointPermissions;
public static final String JSON_PROPERTY_ENDPOINT_TYPE = "endpointType";
private String endpointType;
public static final String JSON_PROPERTY_MODEL_CONFIG = "modelConfig";
private Map modelConfig = new HashMap<>();
public static final String JSON_PROPERTY_MODEL_NAME = "modelName";
private String modelName;
public static final String JSON_PROPERTY_MODEL_PROVIDER = "modelProvider";
private String modelProvider;
public NewEndpointV1() {
}
public NewEndpointV1 endpointName(String endpointName) {
this.endpointName = endpointName;
return this;
}
/**
* Valid name of the endpoint
* @return endpointName
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_ENDPOINT_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getEndpointName() {
return endpointName;
}
@JsonProperty(JSON_PROPERTY_ENDPOINT_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setEndpointName(String endpointName) {
this.endpointName = endpointName;
}
public NewEndpointV1 endpointPermissions(EndpointPermissionsDtoV1 endpointPermissions) {
this.endpointPermissions = endpointPermissions;
return this;
}
/**
* Get endpointPermissions
* @return endpointPermissions
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_ENDPOINT_PERMISSIONS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public EndpointPermissionsDtoV1 getEndpointPermissions() {
return endpointPermissions;
}
@JsonProperty(JSON_PROPERTY_ENDPOINT_PERMISSIONS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setEndpointPermissions(EndpointPermissionsDtoV1 endpointPermissions) {
this.endpointPermissions = endpointPermissions;
}
public NewEndpointV1 endpointType(String endpointType) {
this.endpointType = endpointType;
return this;
}
/**
* Type of the endpoint
* @return endpointType
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_ENDPOINT_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getEndpointType() {
return endpointType;
}
@JsonProperty(JSON_PROPERTY_ENDPOINT_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setEndpointType(String endpointType) {
this.endpointType = endpointType;
}
public NewEndpointV1 modelConfig(Map modelConfig) {
this.modelConfig = modelConfig;
return this;
}
public NewEndpointV1 putModelConfigItem(String key, String modelConfigItem) {
if (this.modelConfig == null) {
this.modelConfig = new HashMap<>();
}
this.modelConfig.put(key, modelConfigItem);
return this;
}
/**
* Configuration for the model
* @return modelConfig
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_MODEL_CONFIG)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Map getModelConfig() {
return modelConfig;
}
@JsonProperty(JSON_PROPERTY_MODEL_CONFIG)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setModelConfig(Map modelConfig) {
this.modelConfig = modelConfig;
}
public NewEndpointV1 modelName(String modelName) {
this.modelName = modelName;
return this;
}
/**
* Name of the model
* @return modelName
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_MODEL_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getModelName() {
return modelName;
}
@JsonProperty(JSON_PROPERTY_MODEL_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setModelName(String modelName) {
this.modelName = modelName;
}
public NewEndpointV1 modelProvider(String modelProvider) {
this.modelProvider = modelProvider;
return this;
}
/**
* Provider of the model
* @return modelProvider
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_MODEL_PROVIDER)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getModelProvider() {
return modelProvider;
}
@JsonProperty(JSON_PROPERTY_MODEL_PROVIDER)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setModelProvider(String modelProvider) {
this.modelProvider = modelProvider;
}
/**
* Return true if this NewEndpointV1 object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NewEndpointV1 newEndpointV1 = (NewEndpointV1) o;
return Objects.equals(this.endpointName, newEndpointV1.endpointName) &&
Objects.equals(this.endpointPermissions, newEndpointV1.endpointPermissions) &&
Objects.equals(this.endpointType, newEndpointV1.endpointType) &&
Objects.equals(this.modelConfig, newEndpointV1.modelConfig) &&
Objects.equals(this.modelName, newEndpointV1.modelName) &&
Objects.equals(this.modelProvider, newEndpointV1.modelProvider);
}
@Override
public int hashCode() {
return Objects.hash(endpointName, endpointPermissions, endpointType, modelConfig, modelName, modelProvider);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NewEndpointV1 {\n");
sb.append(" endpointName: ").append(toIndentedString(endpointName)).append("\n");
sb.append(" endpointPermissions: ").append(toIndentedString(endpointPermissions)).append("\n");
sb.append(" endpointType: ").append(toIndentedString(endpointType)).append("\n");
sb.append(" modelConfig: ").append(toIndentedString(modelConfig)).append("\n");
sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n");
sb.append(" modelProvider: ").append(toIndentedString(modelProvider)).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 ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `endpointName` to the URL query string
if (getEndpointName() != null) {
joiner.add(String.format("%sendpointName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEndpointName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `endpointPermissions` to the URL query string
if (getEndpointPermissions() != null) {
joiner.add(getEndpointPermissions().toUrlQueryString(prefix + "endpointPermissions" + suffix));
}
// add `endpointType` to the URL query string
if (getEndpointType() != null) {
joiner.add(String.format("%sendpointType%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getEndpointType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `modelConfig` to the URL query string
if (getModelConfig() != null) {
for (String _key : getModelConfig().keySet()) {
joiner.add(String.format("%smodelConfig%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
getModelConfig().get(_key), URLEncoder.encode(ApiClient.valueToString(getModelConfig().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
}
// add `modelName` to the URL query string
if (getModelName() != null) {
joiner.add(String.format("%smodelName%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getModelName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `modelProvider` to the URL query string
if (getModelProvider() != null) {
joiner.add(String.format("%smodelProvider%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getModelProvider()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy