com.dominodatalab.api.model.DominoGruzApiContainerNetworkingConfig Maven / Gradle / Ivy
/*
* Domino Data Lab API v4
* This API is going to provide access to all the Domino functions available in the user interface. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key.
*
* The version of the OpenAPI document: 4.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.dominodatalab.api.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.api.model.DominoGruzApiCustomHostnameMapping;
import com.dominodatalab.api.model.DominoGruzApiExecutorHostnameMapping;
import com.dominodatalab.api.model.DominoGruzApiPortsRange;
import com.dominodatalab.api.model.DominoGruzApiVerbatimBoundPort;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* DominoGruzApiContainerNetworkingConfig
*/
@JsonPropertyOrder({
DominoGruzApiContainerNetworkingConfig.JSON_PROPERTY_HTTP_PROXY_PORT,
DominoGruzApiContainerNetworkingConfig.JSON_PROPERTY_AUTO_BOUND_PORTS,
DominoGruzApiContainerNetworkingConfig.JSON_PROPERTY_VERBATIM_BOUND_PORTS,
DominoGruzApiContainerNetworkingConfig.JSON_PROPERTY_ALLOWED_VERBATIM_PORTS_RANGE,
DominoGruzApiContainerNetworkingConfig.JSON_PROPERTY_EXECUTOR_HOSTNAME_MAPPING,
DominoGruzApiContainerNetworkingConfig.JSON_PROPERTY_CUSTOM_HOSTNAME_MAPPINGS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoGruzApiContainerNetworkingConfig {
public static final String JSON_PROPERTY_HTTP_PROXY_PORT = "httpProxyPort";
private Integer httpProxyPort;
public static final String JSON_PROPERTY_AUTO_BOUND_PORTS = "autoBoundPorts";
private List autoBoundPorts = new ArrayList<>();
public static final String JSON_PROPERTY_VERBATIM_BOUND_PORTS = "verbatimBoundPorts";
private List verbatimBoundPorts = new ArrayList<>();
public static final String JSON_PROPERTY_ALLOWED_VERBATIM_PORTS_RANGE = "allowedVerbatimPortsRange";
private DominoGruzApiPortsRange allowedVerbatimPortsRange;
public static final String JSON_PROPERTY_EXECUTOR_HOSTNAME_MAPPING = "executorHostnameMapping";
private DominoGruzApiExecutorHostnameMapping executorHostnameMapping;
public static final String JSON_PROPERTY_CUSTOM_HOSTNAME_MAPPINGS = "customHostnameMappings";
private List customHostnameMappings = new ArrayList<>();
public DominoGruzApiContainerNetworkingConfig() {
}
public DominoGruzApiContainerNetworkingConfig httpProxyPort(Integer httpProxyPort) {
this.httpProxyPort = httpProxyPort;
return this;
}
/**
* Get httpProxyPort
* @return httpProxyPort
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_HTTP_PROXY_PORT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Integer getHttpProxyPort() {
return httpProxyPort;
}
@JsonProperty(JSON_PROPERTY_HTTP_PROXY_PORT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setHttpProxyPort(Integer httpProxyPort) {
this.httpProxyPort = httpProxyPort;
}
public DominoGruzApiContainerNetworkingConfig autoBoundPorts(List autoBoundPorts) {
this.autoBoundPorts = autoBoundPorts;
return this;
}
public DominoGruzApiContainerNetworkingConfig addAutoBoundPortsItem(Integer autoBoundPortsItem) {
if (this.autoBoundPorts == null) {
this.autoBoundPorts = new ArrayList<>();
}
this.autoBoundPorts.add(autoBoundPortsItem);
return this;
}
/**
* Get autoBoundPorts
* @return autoBoundPorts
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_AUTO_BOUND_PORTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getAutoBoundPorts() {
return autoBoundPorts;
}
@JsonProperty(JSON_PROPERTY_AUTO_BOUND_PORTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setAutoBoundPorts(List autoBoundPorts) {
this.autoBoundPorts = autoBoundPorts;
}
public DominoGruzApiContainerNetworkingConfig verbatimBoundPorts(List verbatimBoundPorts) {
this.verbatimBoundPorts = verbatimBoundPorts;
return this;
}
public DominoGruzApiContainerNetworkingConfig addVerbatimBoundPortsItem(DominoGruzApiVerbatimBoundPort verbatimBoundPortsItem) {
if (this.verbatimBoundPorts == null) {
this.verbatimBoundPorts = new ArrayList<>();
}
this.verbatimBoundPorts.add(verbatimBoundPortsItem);
return this;
}
/**
* Get verbatimBoundPorts
* @return verbatimBoundPorts
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_VERBATIM_BOUND_PORTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getVerbatimBoundPorts() {
return verbatimBoundPorts;
}
@JsonProperty(JSON_PROPERTY_VERBATIM_BOUND_PORTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setVerbatimBoundPorts(List verbatimBoundPorts) {
this.verbatimBoundPorts = verbatimBoundPorts;
}
public DominoGruzApiContainerNetworkingConfig allowedVerbatimPortsRange(DominoGruzApiPortsRange allowedVerbatimPortsRange) {
this.allowedVerbatimPortsRange = allowedVerbatimPortsRange;
return this;
}
/**
* Get allowedVerbatimPortsRange
* @return allowedVerbatimPortsRange
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ALLOWED_VERBATIM_PORTS_RANGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public DominoGruzApiPortsRange getAllowedVerbatimPortsRange() {
return allowedVerbatimPortsRange;
}
@JsonProperty(JSON_PROPERTY_ALLOWED_VERBATIM_PORTS_RANGE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setAllowedVerbatimPortsRange(DominoGruzApiPortsRange allowedVerbatimPortsRange) {
this.allowedVerbatimPortsRange = allowedVerbatimPortsRange;
}
public DominoGruzApiContainerNetworkingConfig executorHostnameMapping(DominoGruzApiExecutorHostnameMapping executorHostnameMapping) {
this.executorHostnameMapping = executorHostnameMapping;
return this;
}
/**
* Get executorHostnameMapping
* @return executorHostnameMapping
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_EXECUTOR_HOSTNAME_MAPPING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public DominoGruzApiExecutorHostnameMapping getExecutorHostnameMapping() {
return executorHostnameMapping;
}
@JsonProperty(JSON_PROPERTY_EXECUTOR_HOSTNAME_MAPPING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setExecutorHostnameMapping(DominoGruzApiExecutorHostnameMapping executorHostnameMapping) {
this.executorHostnameMapping = executorHostnameMapping;
}
public DominoGruzApiContainerNetworkingConfig customHostnameMappings(List customHostnameMappings) {
this.customHostnameMappings = customHostnameMappings;
return this;
}
public DominoGruzApiContainerNetworkingConfig addCustomHostnameMappingsItem(DominoGruzApiCustomHostnameMapping customHostnameMappingsItem) {
if (this.customHostnameMappings == null) {
this.customHostnameMappings = new ArrayList<>();
}
this.customHostnameMappings.add(customHostnameMappingsItem);
return this;
}
/**
* Get customHostnameMappings
* @return customHostnameMappings
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_CUSTOM_HOSTNAME_MAPPINGS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getCustomHostnameMappings() {
return customHostnameMappings;
}
@JsonProperty(JSON_PROPERTY_CUSTOM_HOSTNAME_MAPPINGS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setCustomHostnameMappings(List customHostnameMappings) {
this.customHostnameMappings = customHostnameMappings;
}
/**
* Return true if this domino.gruz.api.ContainerNetworkingConfig object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DominoGruzApiContainerNetworkingConfig dominoGruzApiContainerNetworkingConfig = (DominoGruzApiContainerNetworkingConfig) o;
return Objects.equals(this.httpProxyPort, dominoGruzApiContainerNetworkingConfig.httpProxyPort) &&
Objects.equals(this.autoBoundPorts, dominoGruzApiContainerNetworkingConfig.autoBoundPorts) &&
Objects.equals(this.verbatimBoundPorts, dominoGruzApiContainerNetworkingConfig.verbatimBoundPorts) &&
Objects.equals(this.allowedVerbatimPortsRange, dominoGruzApiContainerNetworkingConfig.allowedVerbatimPortsRange) &&
Objects.equals(this.executorHostnameMapping, dominoGruzApiContainerNetworkingConfig.executorHostnameMapping) &&
Objects.equals(this.customHostnameMappings, dominoGruzApiContainerNetworkingConfig.customHostnameMappings);
}
@Override
public int hashCode() {
return Objects.hash(httpProxyPort, autoBoundPorts, verbatimBoundPorts, allowedVerbatimPortsRange, executorHostnameMapping, customHostnameMappings);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DominoGruzApiContainerNetworkingConfig {\n");
sb.append(" httpProxyPort: ").append(toIndentedString(httpProxyPort)).append("\n");
sb.append(" autoBoundPorts: ").append(toIndentedString(autoBoundPorts)).append("\n");
sb.append(" verbatimBoundPorts: ").append(toIndentedString(verbatimBoundPorts)).append("\n");
sb.append(" allowedVerbatimPortsRange: ").append(toIndentedString(allowedVerbatimPortsRange)).append("\n");
sb.append(" executorHostnameMapping: ").append(toIndentedString(executorHostnameMapping)).append("\n");
sb.append(" customHostnameMappings: ").append(toIndentedString(customHostnameMappings)).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 `httpProxyPort` to the URL query string
if (getHttpProxyPort() != null) {
joiner.add(String.format("%shttpProxyPort%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHttpProxyPort()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `autoBoundPorts` to the URL query string
if (getAutoBoundPorts() != null) {
for (int i = 0; i < getAutoBoundPorts().size(); i++) {
joiner.add(String.format("%sautoBoundPorts%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
URLEncoder.encode(String.valueOf(getAutoBoundPorts().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
}
// add `verbatimBoundPorts` to the URL query string
if (getVerbatimBoundPorts() != null) {
for (int i = 0; i < getVerbatimBoundPorts().size(); i++) {
if (getVerbatimBoundPorts().get(i) != null) {
joiner.add(getVerbatimBoundPorts().get(i).toUrlQueryString(String.format("%sverbatimBoundPorts%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
// add `allowedVerbatimPortsRange` to the URL query string
if (getAllowedVerbatimPortsRange() != null) {
joiner.add(getAllowedVerbatimPortsRange().toUrlQueryString(prefix + "allowedVerbatimPortsRange" + suffix));
}
// add `executorHostnameMapping` to the URL query string
if (getExecutorHostnameMapping() != null) {
joiner.add(getExecutorHostnameMapping().toUrlQueryString(prefix + "executorHostnameMapping" + suffix));
}
// add `customHostnameMappings` to the URL query string
if (getCustomHostnameMappings() != null) {
for (int i = 0; i < getCustomHostnameMappings().size(); i++) {
if (getCustomHostnameMappings().get(i) != null) {
joiner.add(getCustomHostnameMappings().get(i).toUrlQueryString(String.format("%scustomHostnameMappings%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
return joiner.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy