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

com.pulumi.docker.outputs.ServiceEndpointSpec Maven / Gradle / Ivy

There is a newer version: 4.7.0-alpha.1705607229+34a07055
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.docker.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.docker.outputs.ServiceEndpointSpecPort;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ServiceEndpointSpec {
    /**
     * @return The mode of resolution to use for internal load balancing between tasks
     * 
     */
    private @Nullable String mode;
    /**
     * @return List of exposed ports that this service is accessible on from the outside. Ports can only be provided if 'vip' resolution mode is used
     * 
     */
    private @Nullable List ports;

    private ServiceEndpointSpec() {}
    /**
     * @return The mode of resolution to use for internal load balancing between tasks
     * 
     */
    public Optional mode() {
        return Optional.ofNullable(this.mode);
    }
    /**
     * @return List of exposed ports that this service is accessible on from the outside. Ports can only be provided if 'vip' resolution mode is used
     * 
     */
    public List ports() {
        return this.ports == null ? List.of() : this.ports;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(ServiceEndpointSpec defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String mode;
        private @Nullable List ports;
        public Builder() {}
        public Builder(ServiceEndpointSpec defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.mode = defaults.mode;
    	      this.ports = defaults.ports;
        }

        @CustomType.Setter
        public Builder mode(@Nullable String mode) {

            this.mode = mode;
            return this;
        }
        @CustomType.Setter
        public Builder ports(@Nullable List ports) {

            this.ports = ports;
            return this;
        }
        public Builder ports(ServiceEndpointSpecPort... ports) {
            return ports(List.of(ports));
        }
        public ServiceEndpointSpec build() {
            final var _resultValue = new ServiceEndpointSpec();
            _resultValue.mode = mode;
            _resultValue.ports = ports;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy