com.pulumi.consul.outputs.GetCatalogServicesQueryOption Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of consul Show documentation
Show all versions of consul Show documentation
A Pulumi package for creating and managing consul resources.
// *** 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.consul.outputs;
import com.pulumi.core.annotations.CustomType;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class GetCatalogServicesQueryOption {
/**
* @return When `true`, the default, allow responses from
* Consul servers that are followers.
*
*/
private @Nullable Boolean allowStale;
/**
* @return The Consul datacenter to query. Defaults to the
* same value found in `query_options` parameter specified below, or if that is
* empty, the `datacenter` value found in the Consul agent that this provider is
* configured to talk to.
*
*/
private @Nullable String datacenter;
/**
* @return The namespace to lookup the services.
*
*/
private @Nullable String namespace;
private @Nullable String near;
private @Nullable Map nodeMeta;
private @Nullable String partition;
/**
* @return When `true` force the client to perform a
* read on at least quorum servers and verify the result is the same. Defaults
* to `false`.
*
*/
private @Nullable Boolean requireConsistent;
/**
* @return Specify the Consul ACL token to use when performing the
* request. This defaults to the same API token configured by the `consul`
* provider but may be overridden if necessary.
*
*/
private @Nullable String token;
/**
* @return Index number used to enable blocking queries.
*
*/
private @Nullable Integer waitIndex;
/**
* @return Max time the client should wait for a blocking query
* to return.
*
*/
private @Nullable String waitTime;
private GetCatalogServicesQueryOption() {}
/**
* @return When `true`, the default, allow responses from
* Consul servers that are followers.
*
*/
public Optional allowStale() {
return Optional.ofNullable(this.allowStale);
}
/**
* @return The Consul datacenter to query. Defaults to the
* same value found in `query_options` parameter specified below, or if that is
* empty, the `datacenter` value found in the Consul agent that this provider is
* configured to talk to.
*
*/
public Optional datacenter() {
return Optional.ofNullable(this.datacenter);
}
/**
* @return The namespace to lookup the services.
*
*/
public Optional namespace() {
return Optional.ofNullable(this.namespace);
}
public Optional near() {
return Optional.ofNullable(this.near);
}
public Map nodeMeta() {
return this.nodeMeta == null ? Map.of() : this.nodeMeta;
}
public Optional partition() {
return Optional.ofNullable(this.partition);
}
/**
* @return When `true` force the client to perform a
* read on at least quorum servers and verify the result is the same. Defaults
* to `false`.
*
*/
public Optional requireConsistent() {
return Optional.ofNullable(this.requireConsistent);
}
/**
* @return Specify the Consul ACL token to use when performing the
* request. This defaults to the same API token configured by the `consul`
* provider but may be overridden if necessary.
*
*/
public Optional token() {
return Optional.ofNullable(this.token);
}
/**
* @return Index number used to enable blocking queries.
*
*/
public Optional waitIndex() {
return Optional.ofNullable(this.waitIndex);
}
/**
* @return Max time the client should wait for a blocking query
* to return.
*
*/
public Optional waitTime() {
return Optional.ofNullable(this.waitTime);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(GetCatalogServicesQueryOption defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable Boolean allowStale;
private @Nullable String datacenter;
private @Nullable String namespace;
private @Nullable String near;
private @Nullable Map nodeMeta;
private @Nullable String partition;
private @Nullable Boolean requireConsistent;
private @Nullable String token;
private @Nullable Integer waitIndex;
private @Nullable String waitTime;
public Builder() {}
public Builder(GetCatalogServicesQueryOption defaults) {
Objects.requireNonNull(defaults);
this.allowStale = defaults.allowStale;
this.datacenter = defaults.datacenter;
this.namespace = defaults.namespace;
this.near = defaults.near;
this.nodeMeta = defaults.nodeMeta;
this.partition = defaults.partition;
this.requireConsistent = defaults.requireConsistent;
this.token = defaults.token;
this.waitIndex = defaults.waitIndex;
this.waitTime = defaults.waitTime;
}
@CustomType.Setter
public Builder allowStale(@Nullable Boolean allowStale) {
this.allowStale = allowStale;
return this;
}
@CustomType.Setter
public Builder datacenter(@Nullable String datacenter) {
this.datacenter = datacenter;
return this;
}
@CustomType.Setter
public Builder namespace(@Nullable String namespace) {
this.namespace = namespace;
return this;
}
@CustomType.Setter
public Builder near(@Nullable String near) {
this.near = near;
return this;
}
@CustomType.Setter
public Builder nodeMeta(@Nullable Map nodeMeta) {
this.nodeMeta = nodeMeta;
return this;
}
@CustomType.Setter
public Builder partition(@Nullable String partition) {
this.partition = partition;
return this;
}
@CustomType.Setter
public Builder requireConsistent(@Nullable Boolean requireConsistent) {
this.requireConsistent = requireConsistent;
return this;
}
@CustomType.Setter
public Builder token(@Nullable String token) {
this.token = token;
return this;
}
@CustomType.Setter
public Builder waitIndex(@Nullable Integer waitIndex) {
this.waitIndex = waitIndex;
return this;
}
@CustomType.Setter
public Builder waitTime(@Nullable String waitTime) {
this.waitTime = waitTime;
return this;
}
public GetCatalogServicesQueryOption build() {
final var _resultValue = new GetCatalogServicesQueryOption();
_resultValue.allowStale = allowStale;
_resultValue.datacenter = datacenter;
_resultValue.namespace = namespace;
_resultValue.near = near;
_resultValue.nodeMeta = nodeMeta;
_resultValue.partition = partition;
_resultValue.requireConsistent = requireConsistent;
_resultValue.token = token;
_resultValue.waitIndex = waitIndex;
_resultValue.waitTime = waitTime;
return _resultValue;
}
}
}