com.pulumi.docker.outputs.ServiceEndpointSpec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docker Show documentation
Show all versions of docker Show documentation
A Pulumi package for interacting with Docker in Pulumi programs
// *** 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;
}
}
}