Class BetaFallbackCreditUsage.Status
-
- All Implemented Interfaces:
public final class BetaFallbackCreditUsage.StatusWhether the fallback-credit reprice was applied to this response's billing.
A union discriminated on
type.redeemed: the retry is billed as if the conversation had been on the retry model all along — including when the resulting shift is zero because there was nothing to move.not_applied: no reprice was applied; the arm'sreasonsays why.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaFallbackCreditUsage.Status.VisitorAn interface that defines how to map each variant of Status to a value of type T.
public final classBetaFallbackCreditUsage.Status.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaFallbackCreditRedeemed>redeemed()The reprice was applied: the retry is billed as if the conversation had been on the retry model all along. final Optional<BetaFallbackCreditNotApplied>notApplied()No reprice was applied; `reason`says why.final Optional<JsonValue>_json()final BetaFallbackCreditUsage.Status.Typetype()final BooleanisRedeemed()final BooleanisNotApplied()final BetaFallbackCreditRedeemedasRedeemed()The reprice was applied: the retry is billed as if the conversation had been on the retry model all along. final BetaFallbackCreditNotAppliedasNotApplied()No reprice was applied; `reason`says why.final <T extends Any> Taccept(BetaFallbackCreditUsage.Status.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaFallbackCreditUsage.Statusvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaFallbackCreditUsage.StatusofRedeemed(BetaFallbackCreditRedeemed redeemed)The reprice was applied: the retry is billed as if the conversation had been on the retry model all along. final static BetaFallbackCreditUsage.StatusofNotApplied(BetaFallbackCreditNotApplied notApplied)No reprice was applied; `reason`says why.final static BetaFallbackCreditUsage.StatusofNotApplied(BetaFallbackCreditNotApplied.Reason reason)Returns an immutable instance of Status whose ofNotApplied variant is built from the given required reason. -
-
Method Detail
-
redeemed
final Optional<BetaFallbackCreditRedeemed> redeemed()
The reprice was applied: the retry is billed as if the conversation had been on the retry model all along.
-
notApplied
final Optional<BetaFallbackCreditNotApplied> notApplied()
No reprice was applied;
`reason`says why.
-
type
final BetaFallbackCreditUsage.Status.Type type()
-
isRedeemed
final Boolean isRedeemed()
-
isNotApplied
final Boolean isNotApplied()
-
asRedeemed
final BetaFallbackCreditRedeemed asRedeemed()
The reprice was applied: the retry is billed as if the conversation had been on the retry model all along.
-
asNotApplied
final BetaFallbackCreditNotApplied asNotApplied()
No reprice was applied;
`reason`says why.
-
accept
final <T extends Any> T accept(BetaFallbackCreditUsage.Status.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 = status.accept(new Status.Visitor<Optional<String>>() { @Override public Optional<String> visitRedeemed(BetaFallbackCreditRedeemed redeemed) { return Optional.of(redeemed.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaFallbackCreditUsage.Status 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.
-
ofRedeemed
final static BetaFallbackCreditUsage.Status ofRedeemed(BetaFallbackCreditRedeemed redeemed)
The reprice was applied: the retry is billed as if the conversation had been on the retry model all along.
-
ofNotApplied
final static BetaFallbackCreditUsage.Status ofNotApplied(BetaFallbackCreditNotApplied notApplied)
No reprice was applied;
`reason`says why.
-
ofNotApplied
final static BetaFallbackCreditUsage.Status ofNotApplied(BetaFallbackCreditNotApplied.Reason reason)
Returns an immutable instance of Status whose ofNotApplied variant is built from the given required reason.
-
-
-
-