All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fabric8.kubernetes.api.model.Service Maven / Gradle / Ivy


package io.fabric8.kubernetes.api.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import io.fabric8.kubernetes.api.model.util.IntOrString;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/**
 * 
 * 
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
    "annotations",
    "apiVersion",
    "containerPort",
    "createExternalLoadBalancer",
    "creationTimestamp",
    "deletionTimestamp",
    "generateName",
    "id",
    "kind",
    "labels",
    "namespace",
    "port",
    "portName",
    "portalIP",
    "ports",
    "protocol",
    "proxyPort",
    "publicIPs",
    "resourceVersion",
    "selector",
    "selfLink",
    "sessionAffinity",
    "uid"
})
public class Service {

    /**
     * map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about the object
     * 
     */
    @JsonProperty("annotations")
    @Valid
    private Map annotations;
    /**
     * 
     * (Required)
     * 
     */
    @JsonProperty("apiVersion")
    @NotNull
    private Service.ApiVersion apiVersion = Service.ApiVersion.fromValue("v1beta2");
    /**
     * 
     * 
     */
    @JsonProperty("containerPort")
    @Valid
    private IntOrString containerPort;
    /**
     * set up a cloud-provider-specific load balancer on an external IP
     * 
     */
    @JsonProperty("createExternalLoadBalancer")
    private Boolean createExternalLoadBalancer;
    /**
     * RFC 3339 date and time at which the object was created; populated by the system
     * 
     */
    @JsonProperty("creationTimestamp")
    private java.lang.String creationTimestamp;
    /**
     * RFC 3339 date and time at which the object will be deleted; populated by the system when a graceful deletion is requested
     * 
     */
    @JsonProperty("deletionTimestamp")
    private java.lang.String deletionTimestamp;
    /**
     * an optional prefix to use to generate a unique name; has the same validation rules as name; optional
     * 
     */
    @JsonProperty("generateName")
    private java.lang.String generateName;
    /**
     * name of the object; must be a DNS_SUBDOMAIN and unique among all objects of the same kind within the same namespace; used in resource URLs; cannot be updated
     * 
     */
    @JsonProperty("id")
    @Pattern(regexp = "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$")
    @Size(max = 253)
    private java.lang.String id;
    /**
     * 
     * (Required)
     * 
     */
    @JsonProperty("kind")
    @NotNull
    private java.lang.String kind = "Service";
    /**
     * map of string keys and values that can be used to organize and categorize services
     * 
     */
    @JsonProperty("labels")
    @Valid
    private Map labels;
    /**
     * namespace to which the object belongs; must be a DNS_SUBDOMAIN; 'default' by default; cannot be updated
     * 
     */
    @JsonProperty("namespace")
    @Pattern(regexp = "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$")
    @Size(max = 253)
    private java.lang.String namespace;
    /**
     * port exposed by the service
     * 
     */
    @JsonProperty("port")
    private Integer port;
    /**
     * the name of the first port; optional
     * 
     */
    @JsonProperty("portName")
    private java.lang.String portName;
    /**
     * IP address of the service; usually assigned by the system; if specified
     * 
     */
    @JsonProperty("portalIP")
    private java.lang.String portalIP;
    /**
     * ports to be exposed on the service; if this field is specified
     * 
     */
    @JsonProperty("ports")
    @Valid
    private List ports = new ArrayList();
    /**
     * protocol for port; must be UDP or TCP; TCP if unspecified
     * 
     */
    @JsonProperty("protocol")
    private java.lang.String protocol;
    /**
     * if non-zero
     * 
     */
    @JsonProperty("proxyPort")
    private Integer proxyPort;
    /**
     * externally visible IPs (e.g. load balancers) that should be proxied to this service
     * 
     */
    @JsonProperty("publicIPs")
    @Valid
    private List publicIPs = new ArrayList();
    /**
     * string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system
     * 
     */
    @JsonProperty("resourceVersion")
    private Integer resourceVersion;
    /**
     * label keys and values that must match in order to receive traffic for this service; if empty
     * 
     */
    @JsonProperty("selector")
    @Valid
    private Map selector;
    /**
     * URL for the object; populated by the system
     * 
     */
    @JsonProperty("selfLink")
    private java.lang.String selfLink;
    /**
     * enable client IP based session affinity; must be ClientIP or None; defaults to None
     * 
     */
    @JsonProperty("sessionAffinity")
    private java.lang.String sessionAffinity;
    /**
     * unique UUID across space and time; populated by the system
     * 
     */
    @JsonProperty("uid")
    private java.lang.String uid;
    @JsonIgnore
    private Map additionalProperties = new HashMap();

    /**
     * No args constructor for use in serialization
     * 
     */
    public Service() {
    }

    /**
     * 
     * @param uid
     * @param selector
     * @param publicIPs
     * @param apiVersion
     * @param deletionTimestamp
     * @param port
     * @param protocol
     * @param generateName
     * @param labels
     * @param selfLink
     * @param proxyPort
     * @param containerPort
     * @param kind
     * @param namespace
     * @param id
     * @param ports
     * @param portalIP
     * @param resourceVersion
     * @param sessionAffinity
     * @param annotations
     * @param creationTimestamp
     * @param portName
     * @param createExternalLoadBalancer
     */
    public Service(Map annotations, Service.ApiVersion apiVersion, IntOrString containerPort, Boolean createExternalLoadBalancer, java.lang.String creationTimestamp, java.lang.String deletionTimestamp, java.lang.String generateName, java.lang.String id, java.lang.String kind, Map labels, java.lang.String namespace, Integer port, java.lang.String portName, java.lang.String portalIP, List ports, java.lang.String protocol, Integer proxyPort, List publicIPs, Integer resourceVersion, Map selector, java.lang.String selfLink, java.lang.String sessionAffinity, java.lang.String uid) {
        this.annotations = annotations;
        this.apiVersion = apiVersion;
        this.containerPort = containerPort;
        this.createExternalLoadBalancer = createExternalLoadBalancer;
        this.creationTimestamp = creationTimestamp;
        this.deletionTimestamp = deletionTimestamp;
        this.generateName = generateName;
        this.id = id;
        this.kind = kind;
        this.labels = labels;
        this.namespace = namespace;
        this.port = port;
        this.portName = portName;
        this.portalIP = portalIP;
        this.ports = ports;
        this.protocol = protocol;
        this.proxyPort = proxyPort;
        this.publicIPs = publicIPs;
        this.resourceVersion = resourceVersion;
        this.selector = selector;
        this.selfLink = selfLink;
        this.sessionAffinity = sessionAffinity;
        this.uid = uid;
    }

    /**
     * map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about the object
     * 
     * @return
     *     The annotations
     */
    @JsonProperty("annotations")
    public Map getAnnotations() {
        return annotations;
    }

    /**
     * map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about the object
     * 
     * @param annotations
     *     The annotations
     */
    @JsonProperty("annotations")
    public void setAnnotations(Map annotations) {
        this.annotations = annotations;
    }

    /**
     * 
     * (Required)
     * 
     * @return
     *     The apiVersion
     */
    @JsonProperty("apiVersion")
    public Service.ApiVersion getApiVersion() {
        return apiVersion;
    }

    /**
     * 
     * (Required)
     * 
     * @param apiVersion
     *     The apiVersion
     */
    @JsonProperty("apiVersion")
    public void setApiVersion(Service.ApiVersion apiVersion) {
        this.apiVersion = apiVersion;
    }

    /**
     * 
     * 
     * @return
     *     The containerPort
     */
    @JsonProperty("containerPort")
    public IntOrString getContainerPort() {
        return containerPort;
    }

    /**
     * 
     * 
     * @param containerPort
     *     The containerPort
     */
    @JsonProperty("containerPort")
    public void setContainerPort(IntOrString containerPort) {
        this.containerPort = containerPort;
    }

    /**
     * set up a cloud-provider-specific load balancer on an external IP
     * 
     * @return
     *     The createExternalLoadBalancer
     */
    @JsonProperty("createExternalLoadBalancer")
    public Boolean getCreateExternalLoadBalancer() {
        return createExternalLoadBalancer;
    }

    /**
     * set up a cloud-provider-specific load balancer on an external IP
     * 
     * @param createExternalLoadBalancer
     *     The createExternalLoadBalancer
     */
    @JsonProperty("createExternalLoadBalancer")
    public void setCreateExternalLoadBalancer(Boolean createExternalLoadBalancer) {
        this.createExternalLoadBalancer = createExternalLoadBalancer;
    }

    /**
     * RFC 3339 date and time at which the object was created; populated by the system
     * 
     * @return
     *     The creationTimestamp
     */
    @JsonProperty("creationTimestamp")
    public java.lang.String getCreationTimestamp() {
        return creationTimestamp;
    }

    /**
     * RFC 3339 date and time at which the object was created; populated by the system
     * 
     * @param creationTimestamp
     *     The creationTimestamp
     */
    @JsonProperty("creationTimestamp")
    public void setCreationTimestamp(java.lang.String creationTimestamp) {
        this.creationTimestamp = creationTimestamp;
    }

    /**
     * RFC 3339 date and time at which the object will be deleted; populated by the system when a graceful deletion is requested
     * 
     * @return
     *     The deletionTimestamp
     */
    @JsonProperty("deletionTimestamp")
    public java.lang.String getDeletionTimestamp() {
        return deletionTimestamp;
    }

    /**
     * RFC 3339 date and time at which the object will be deleted; populated by the system when a graceful deletion is requested
     * 
     * @param deletionTimestamp
     *     The deletionTimestamp
     */
    @JsonProperty("deletionTimestamp")
    public void setDeletionTimestamp(java.lang.String deletionTimestamp) {
        this.deletionTimestamp = deletionTimestamp;
    }

    /**
     * an optional prefix to use to generate a unique name; has the same validation rules as name; optional
     * 
     * @return
     *     The generateName
     */
    @JsonProperty("generateName")
    public java.lang.String getGenerateName() {
        return generateName;
    }

    /**
     * an optional prefix to use to generate a unique name; has the same validation rules as name; optional
     * 
     * @param generateName
     *     The generateName
     */
    @JsonProperty("generateName")
    public void setGenerateName(java.lang.String generateName) {
        this.generateName = generateName;
    }

    /**
     * name of the object; must be a DNS_SUBDOMAIN and unique among all objects of the same kind within the same namespace; used in resource URLs; cannot be updated
     * 
     * @return
     *     The id
     */
    @JsonProperty("id")
    public java.lang.String getId() {
        return id;
    }

    /**
     * name of the object; must be a DNS_SUBDOMAIN and unique among all objects of the same kind within the same namespace; used in resource URLs; cannot be updated
     * 
     * @param id
     *     The id
     */
    @JsonProperty("id")
    public void setId(java.lang.String id) {
        this.id = id;
    }

    /**
     * 
     * (Required)
     * 
     * @return
     *     The kind
     */
    @JsonProperty("kind")
    public java.lang.String getKind() {
        return kind;
    }

    /**
     * 
     * (Required)
     * 
     * @param kind
     *     The kind
     */
    @JsonProperty("kind")
    public void setKind(java.lang.String kind) {
        this.kind = kind;
    }

    /**
     * map of string keys and values that can be used to organize and categorize services
     * 
     * @return
     *     The labels
     */
    @JsonProperty("labels")
    public Map getLabels() {
        return labels;
    }

    /**
     * map of string keys and values that can be used to organize and categorize services
     * 
     * @param labels
     *     The labels
     */
    @JsonProperty("labels")
    public void setLabels(Map labels) {
        this.labels = labels;
    }

    /**
     * namespace to which the object belongs; must be a DNS_SUBDOMAIN; 'default' by default; cannot be updated
     * 
     * @return
     *     The namespace
     */
    @JsonProperty("namespace")
    public java.lang.String getNamespace() {
        return namespace;
    }

    /**
     * namespace to which the object belongs; must be a DNS_SUBDOMAIN; 'default' by default; cannot be updated
     * 
     * @param namespace
     *     The namespace
     */
    @JsonProperty("namespace")
    public void setNamespace(java.lang.String namespace) {
        this.namespace = namespace;
    }

    /**
     * port exposed by the service
     * 
     * @return
     *     The port
     */
    @JsonProperty("port")
    public Integer getPort() {
        return port;
    }

    /**
     * port exposed by the service
     * 
     * @param port
     *     The port
     */
    @JsonProperty("port")
    public void setPort(Integer port) {
        this.port = port;
    }

    /**
     * the name of the first port; optional
     * 
     * @return
     *     The portName
     */
    @JsonProperty("portName")
    public java.lang.String getPortName() {
        return portName;
    }

    /**
     * the name of the first port; optional
     * 
     * @param portName
     *     The portName
     */
    @JsonProperty("portName")
    public void setPortName(java.lang.String portName) {
        this.portName = portName;
    }

    /**
     * IP address of the service; usually assigned by the system; if specified
     * 
     * @return
     *     The portalIP
     */
    @JsonProperty("portalIP")
    public java.lang.String getPortalIP() {
        return portalIP;
    }

    /**
     * IP address of the service; usually assigned by the system; if specified
     * 
     * @param portalIP
     *     The portalIP
     */
    @JsonProperty("portalIP")
    public void setPortalIP(java.lang.String portalIP) {
        this.portalIP = portalIP;
    }

    /**
     * ports to be exposed on the service; if this field is specified
     * 
     * @return
     *     The ports
     */
    @JsonProperty("ports")
    public List getPorts() {
        return ports;
    }

    /**
     * ports to be exposed on the service; if this field is specified
     * 
     * @param ports
     *     The ports
     */
    @JsonProperty("ports")
    public void setPorts(List ports) {
        this.ports = ports;
    }

    /**
     * protocol for port; must be UDP or TCP; TCP if unspecified
     * 
     * @return
     *     The protocol
     */
    @JsonProperty("protocol")
    public java.lang.String getProtocol() {
        return protocol;
    }

    /**
     * protocol for port; must be UDP or TCP; TCP if unspecified
     * 
     * @param protocol
     *     The protocol
     */
    @JsonProperty("protocol")
    public void setProtocol(java.lang.String protocol) {
        this.protocol = protocol;
    }

    /**
     * if non-zero
     * 
     * @return
     *     The proxyPort
     */
    @JsonProperty("proxyPort")
    public Integer getProxyPort() {
        return proxyPort;
    }

    /**
     * if non-zero
     * 
     * @param proxyPort
     *     The proxyPort
     */
    @JsonProperty("proxyPort")
    public void setProxyPort(Integer proxyPort) {
        this.proxyPort = proxyPort;
    }

    /**
     * externally visible IPs (e.g. load balancers) that should be proxied to this service
     * 
     * @return
     *     The publicIPs
     */
    @JsonProperty("publicIPs")
    public List getPublicIPs() {
        return publicIPs;
    }

    /**
     * externally visible IPs (e.g. load balancers) that should be proxied to this service
     * 
     * @param publicIPs
     *     The publicIPs
     */
    @JsonProperty("publicIPs")
    public void setPublicIPs(List publicIPs) {
        this.publicIPs = publicIPs;
    }

    /**
     * string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system
     * 
     * @return
     *     The resourceVersion
     */
    @JsonProperty("resourceVersion")
    public Integer getResourceVersion() {
        return resourceVersion;
    }

    /**
     * string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system
     * 
     * @param resourceVersion
     *     The resourceVersion
     */
    @JsonProperty("resourceVersion")
    public void setResourceVersion(Integer resourceVersion) {
        this.resourceVersion = resourceVersion;
    }

    /**
     * label keys and values that must match in order to receive traffic for this service; if empty
     * 
     * @return
     *     The selector
     */
    @JsonProperty("selector")
    public Map getSelector() {
        return selector;
    }

    /**
     * label keys and values that must match in order to receive traffic for this service; if empty
     * 
     * @param selector
     *     The selector
     */
    @JsonProperty("selector")
    public void setSelector(Map selector) {
        this.selector = selector;
    }

    /**
     * URL for the object; populated by the system
     * 
     * @return
     *     The selfLink
     */
    @JsonProperty("selfLink")
    public java.lang.String getSelfLink() {
        return selfLink;
    }

    /**
     * URL for the object; populated by the system
     * 
     * @param selfLink
     *     The selfLink
     */
    @JsonProperty("selfLink")
    public void setSelfLink(java.lang.String selfLink) {
        this.selfLink = selfLink;
    }

    /**
     * enable client IP based session affinity; must be ClientIP or None; defaults to None
     * 
     * @return
     *     The sessionAffinity
     */
    @JsonProperty("sessionAffinity")
    public java.lang.String getSessionAffinity() {
        return sessionAffinity;
    }

    /**
     * enable client IP based session affinity; must be ClientIP or None; defaults to None
     * 
     * @param sessionAffinity
     *     The sessionAffinity
     */
    @JsonProperty("sessionAffinity")
    public void setSessionAffinity(java.lang.String sessionAffinity) {
        this.sessionAffinity = sessionAffinity;
    }

    /**
     * unique UUID across space and time; populated by the system
     * 
     * @return
     *     The uid
     */
    @JsonProperty("uid")
    public java.lang.String getUid() {
        return uid;
    }

    /**
     * unique UUID across space and time; populated by the system
     * 
     * @param uid
     *     The uid
     */
    @JsonProperty("uid")
    public void setUid(java.lang.String uid) {
        this.uid = uid;
    }

    @Override
    public java.lang.String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    @JsonAnyGetter
    public Map getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(java.lang.String name, Object value) {
        this.additionalProperties.put(name, value);
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(annotations).append(apiVersion).append(containerPort).append(createExternalLoadBalancer).append(creationTimestamp).append(deletionTimestamp).append(generateName).append(id).append(kind).append(labels).append(namespace).append(port).append(portName).append(portalIP).append(ports).append(protocol).append(proxyPort).append(publicIPs).append(resourceVersion).append(selector).append(selfLink).append(sessionAffinity).append(uid).append(additionalProperties).toHashCode();
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if ((other instanceof Service) == false) {
            return false;
        }
        Service rhs = ((Service) other);
        return new EqualsBuilder().append(annotations, rhs.annotations).append(apiVersion, rhs.apiVersion).append(containerPort, rhs.containerPort).append(createExternalLoadBalancer, rhs.createExternalLoadBalancer).append(creationTimestamp, rhs.creationTimestamp).append(deletionTimestamp, rhs.deletionTimestamp).append(generateName, rhs.generateName).append(id, rhs.id).append(kind, rhs.kind).append(labels, rhs.labels).append(namespace, rhs.namespace).append(port, rhs.port).append(portName, rhs.portName).append(portalIP, rhs.portalIP).append(ports, rhs.ports).append(protocol, rhs.protocol).append(proxyPort, rhs.proxyPort).append(publicIPs, rhs.publicIPs).append(resourceVersion, rhs.resourceVersion).append(selector, rhs.selector).append(selfLink, rhs.selfLink).append(sessionAffinity, rhs.sessionAffinity).append(uid, rhs.uid).append(additionalProperties, rhs.additionalProperties).isEquals();
    }

    @Generated("org.jsonschema2pojo")
    public static enum ApiVersion {

        V_1_BETA_1("v1beta1"),
        V_1_BETA_2("v1beta2"),
        V_1_BETA_3("v1beta3");
        private final java.lang.String value;
        private static Map constants = new HashMap();

        static {
            for (Service.ApiVersion c: values()) {
                constants.put(c.value, c);
            }
        }

        private ApiVersion(java.lang.String value) {
            this.value = value;
        }

        @JsonValue
        @Override
        public java.lang.String toString() {
            return this.value;
        }

        @JsonCreator
        public static Service.ApiVersion fromValue(java.lang.String value) {
            Service.ApiVersion constant = constants.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy