Class BetaTelemetryDestinationState
-
- All Implemented Interfaces:
public final class BetaTelemetryDestinationStateWhether a telemetry destination receives deliveries.
A caller can set either state. The API also disables an enabled destination on its own in some cases. The
reasonof the disabled state says whether a caller or the API disabled the destination and, when the API did, why.See the OpenTelemetry export guide to learn when the API disables a destination.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaTelemetryDestinationState.VisitorAn interface that defines how to map each variant of BetaTelemetryDestinationState to a value of type T.
public final classBetaTelemetryDestinationState.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaTelemetryDestinationStateEnabled>enabled()The telemetry destination receives the spans of the workspaces that it covers. final Optional<BetaTelemetryDestinationStateDisabled>disabled()The API doesn't deliver anything to the telemetry destination. final Optional<JsonValue>_json()final BetaTelemetryDestinationState.Typetype()final BooleanisEnabled()final BooleanisDisabled()final BetaTelemetryDestinationStateEnabledasEnabled()The telemetry destination receives the spans of the workspaces that it covers. final BetaTelemetryDestinationStateDisabledasDisabled()The API doesn't deliver anything to the telemetry destination. final <T extends Any> Taccept(BetaTelemetryDestinationState.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaTelemetryDestinationStatevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaTelemetryDestinationStateofEnabled(BetaTelemetryDestinationStateEnabled enabled)The telemetry destination receives the spans of the workspaces that it covers. final static BetaTelemetryDestinationStateofDisabled(BetaTelemetryDestinationStateDisabled disabled)The API doesn't deliver anything to the telemetry destination. final static BetaTelemetryDestinationStateofDisabled(BetaTelemetryDestinationDisabledReason reason)Returns an immutable instance of BetaTelemetryDestinationState whose ofDisabled variant is built from the given required reason. final static BetaTelemetryDestinationStateofDisabled(BetaTelemetryDestinationDisabledReasonCaller caller)Alias for calling ofDisabled with BetaTelemetryDestinationDisabledReason.ofCaller(caller).final static BetaTelemetryDestinationStateofDisabled(BetaTelemetryDestinationDisabledReasonSustainedFailure sustainedFailure)Alias for calling ofDisabled with BetaTelemetryDestinationDisabledReason.ofSustainedFailure(sustainedFailure).final static BetaTelemetryDestinationStateofDisabled(BetaTelemetryDestinationDisabledReasonInvalidAddress invalidAddress)Alias for calling ofDisabled with BetaTelemetryDestinationDisabledReason.ofInvalidAddress(invalidAddress).final static BetaTelemetryDestinationStateofDisabled(BetaTelemetryDestinationDisabledReasonRedirect redirect)Alias for calling ofDisabled with BetaTelemetryDestinationDisabledReason.ofRedirect(redirect).-
-
Method Detail
-
enabled
final Optional<BetaTelemetryDestinationStateEnabled> enabled()
The telemetry destination receives the spans of the workspaces that it covers.
-
disabled
final Optional<BetaTelemetryDestinationStateDisabled> disabled()
The API doesn't deliver anything to the telemetry destination.
Spans produced while it is disabled aren't delivered later.
-
type
final BetaTelemetryDestinationState.Type type()
-
isDisabled
final Boolean isDisabled()
-
asEnabled
final BetaTelemetryDestinationStateEnabled asEnabled()
The telemetry destination receives the spans of the workspaces that it covers.
-
asDisabled
final BetaTelemetryDestinationStateDisabled asDisabled()
The API doesn't deliver anything to the telemetry destination.
Spans produced while it is disabled aren't delivered later.
-
accept
final <T extends Any> T accept(BetaTelemetryDestinationState.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = betaTelemetryDestinationState.accept(new BetaTelemetryDestinationState.Visitor<Optional<String>>() { @Override public Optional<String> visitEnabled(BetaTelemetryDestinationStateEnabled enabled) { return Optional.of(enabled.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaTelemetryDestinationState validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofEnabled
final static BetaTelemetryDestinationState ofEnabled(BetaTelemetryDestinationStateEnabled enabled)
The telemetry destination receives the spans of the workspaces that it covers.
-
ofDisabled
final static BetaTelemetryDestinationState ofDisabled(BetaTelemetryDestinationStateDisabled disabled)
The API doesn't deliver anything to the telemetry destination.
Spans produced while it is disabled aren't delivered later.
-
ofDisabled
final static BetaTelemetryDestinationState ofDisabled(BetaTelemetryDestinationDisabledReason reason)
Returns an immutable instance of BetaTelemetryDestinationState whose ofDisabled variant is built from the given required reason.
-
ofDisabled
final static BetaTelemetryDestinationState ofDisabled(BetaTelemetryDestinationDisabledReasonCaller caller)
Alias for calling ofDisabled with
BetaTelemetryDestinationDisabledReason.ofCaller(caller).
-
ofDisabled
final static BetaTelemetryDestinationState ofDisabled(BetaTelemetryDestinationDisabledReasonSustainedFailure sustainedFailure)
Alias for calling ofDisabled with
BetaTelemetryDestinationDisabledReason.ofSustainedFailure(sustainedFailure).
-
ofDisabled
final static BetaTelemetryDestinationState ofDisabled(BetaTelemetryDestinationDisabledReasonInvalidAddress invalidAddress)
Alias for calling ofDisabled with
BetaTelemetryDestinationDisabledReason.ofInvalidAddress(invalidAddress).
-
ofDisabled
final static BetaTelemetryDestinationState ofDisabled(BetaTelemetryDestinationDisabledReasonRedirect redirect)
Alias for calling ofDisabled with
BetaTelemetryDestinationDisabledReason.ofRedirect(redirect).
-
-
-
-