Class BetaTelemetryDestinationTestResult
-
- All Implemented Interfaces:
public final class BetaTelemetryDestinationTestResultThe outcome of a test:
success, orfailurewith the reason.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaTelemetryDestinationTestResult.VisitorAn interface that defines how to map each variant of BetaTelemetryDestinationTestResult to a value of type T.
public final classBetaTelemetryDestinationTestResult.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaTelemetryDestinationTestSuccess>success()The destination answered the test span with a 2xx status. final Optional<BetaTelemetryDestinationTestFailure>failure()The test span was not delivered. final Optional<JsonValue>_json()final BetaTelemetryDestinationTestResult.Typetype()final BooleanisSuccess()final BooleanisFailure()final BetaTelemetryDestinationTestSuccessasSuccess()The destination answered the test span with a 2xx status. final BetaTelemetryDestinationTestFailureasFailure()The test span was not delivered. final <T extends Any> Taccept(BetaTelemetryDestinationTestResult.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaTelemetryDestinationTestResultvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaTelemetryDestinationTestResultofSuccess(BetaTelemetryDestinationTestSuccess success)The destination answered the test span with a 2xx status. final static BetaTelemetryDestinationTestResultofFailure(BetaTelemetryDestinationTestFailure failure)The test span was not delivered. final static BetaTelemetryDestinationTestResultofFailure(String error)Returns an immutable instance of BetaTelemetryDestinationTestResult whose ofFailure variant is built from the given required error. -
-
Method Detail
-
success
final Optional<BetaTelemetryDestinationTestSuccess> success()
The destination answered the test span with a 2xx status.
-
failure
final Optional<BetaTelemetryDestinationTestFailure> failure()
The test span was not delivered.
-
type
final BetaTelemetryDestinationTestResult.Type type()
-
asSuccess
final BetaTelemetryDestinationTestSuccess asSuccess()
The destination answered the test span with a 2xx status.
-
asFailure
final BetaTelemetryDestinationTestFailure asFailure()
The test span was not delivered.
-
accept
final <T extends Any> T accept(BetaTelemetryDestinationTestResult.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 = betaTelemetryDestinationTestResult.accept(new BetaTelemetryDestinationTestResult.Visitor<Optional<String>>() { @Override public Optional<String> visitSuccess(BetaTelemetryDestinationTestSuccess success) { return Optional.of(success.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaTelemetryDestinationTestResult 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.
-
ofSuccess
final static BetaTelemetryDestinationTestResult ofSuccess(BetaTelemetryDestinationTestSuccess success)
The destination answered the test span with a 2xx status.
-
ofFailure
final static BetaTelemetryDestinationTestResult ofFailure(BetaTelemetryDestinationTestFailure failure)
The test span was not delivered.
-
ofFailure
final static BetaTelemetryDestinationTestResult ofFailure(String error)
Returns an immutable instance of BetaTelemetryDestinationTestResult whose ofFailure variant is built from the given required error.
-
-
-
-