Class BetaBrowserStateChange
-
- All Implemented Interfaces:
public final class BetaBrowserStateChange
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaBrowserStateChange.VisitorAn interface that defines how to map each variant of BetaBrowserStateChange to a value of type T.
public final classBetaBrowserStateChange.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaBrowserStateChangeTabOpened>tabOpened()A tab this call's execution opened that remains open at its end — the creation delta of the tabsinventory, not an event log.final Optional<BetaBrowserStateChangeDownloadStarted>downloadStarted()A file download that started during this call. final Optional<BetaBrowserStateChangeDownloadCompleted>downloadCompleted()A file download that finished during this call, reported with the same download_idas itsdownload_started— or without a priordownload_started, when the download finished during the call that started it (at most one state change perdownload_idper result).final Optional<BetaBrowserStateChangeDownloadFailed>downloadFailed()A file download that failed — or was cancelled — during this call. final Optional<JsonValue>_json()final BetaBrowserStateChange.Typetype()final Optional<String>downloadId()final Optional<String>url()final BooleanisTabOpened()final BooleanisDownloadStarted()final BooleanisDownloadCompleted()final BooleanisDownloadFailed()final BetaBrowserStateChangeTabOpenedasTabOpened()A tab this call's execution opened that remains open at its end — the creation delta of the tabsinventory, not an event log.final BetaBrowserStateChangeDownloadStartedasDownloadStarted()A file download that started during this call. final BetaBrowserStateChangeDownloadCompletedasDownloadCompleted()A file download that finished during this call, reported with the same download_idas itsdownload_started— or without a priordownload_started, when the download finished during the call that started it (at most one state change perdownload_idper result).final BetaBrowserStateChangeDownloadFailedasDownloadFailed()A file download that failed — or was cancelled — during this call. final <T extends Any> Taccept(BetaBrowserStateChange.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaBrowserStateChangevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaBrowserStateChangeofTabOpened(BetaBrowserStateChangeTabOpened tabOpened)A tab this call's execution opened that remains open at its end — the creation delta of the tabsinventory, not an event log.final static BetaBrowserStateChangeofTabOpened(String tabId)Returns an immutable instance of BetaBrowserStateChange whose ofTabOpened variant is built from the given required tabId. final static BetaBrowserStateChangeofDownloadStarted(BetaBrowserStateChangeDownloadStarted downloadStarted)A file download that started during this call. final static BetaBrowserStateChangeofDownloadCompleted(BetaBrowserStateChangeDownloadCompleted downloadCompleted)A file download that finished during this call, reported with the same download_idas itsdownload_started— or without a priordownload_started, when the download finished during the call that started it (at most one state change perdownload_idper result).final static BetaBrowserStateChangeofDownloadFailed(BetaBrowserStateChangeDownloadFailed downloadFailed)A file download that failed — or was cancelled — during this call. -
-
Method Detail
-
tabOpened
final Optional<BetaBrowserStateChangeTabOpened> tabOpened()
A tab this call's execution opened that remains open at its end — the creation delta of the
tabsinventory, not an event log.Carries only the
tab_id; the tab'stitleandurllive on itstabsentry, which must include the sametab_id. A tab opened during a failed call gets no deferredtab_opened; it simply appears in the next result'stabsinventory.
-
downloadStarted
final Optional<BetaBrowserStateChangeDownloadStarted> downloadStarted()
A file download that started during this call.
-
downloadCompleted
final Optional<BetaBrowserStateChangeDownloadCompleted> downloadCompleted()
A file download that finished during this call, reported with the same
download_idas itsdownload_started— or without a priordownload_started, when the download finished during the call that started it (at most one state change perdownload_idper result).
-
downloadFailed
final Optional<BetaBrowserStateChangeDownloadFailed> downloadFailed()
A file download that failed — or was cancelled — during this call.
-
type
final BetaBrowserStateChange.Type type()
-
downloadId
final Optional<String> downloadId()
-
isTabOpened
final Boolean isTabOpened()
-
isDownloadStarted
final Boolean isDownloadStarted()
-
isDownloadCompleted
final Boolean isDownloadCompleted()
-
isDownloadFailed
final Boolean isDownloadFailed()
-
asTabOpened
final BetaBrowserStateChangeTabOpened asTabOpened()
A tab this call's execution opened that remains open at its end — the creation delta of the
tabsinventory, not an event log.Carries only the
tab_id; the tab'stitleandurllive on itstabsentry, which must include the sametab_id. A tab opened during a failed call gets no deferredtab_opened; it simply appears in the next result'stabsinventory.
-
asDownloadStarted
final BetaBrowserStateChangeDownloadStarted asDownloadStarted()
A file download that started during this call.
-
asDownloadCompleted
final BetaBrowserStateChangeDownloadCompleted asDownloadCompleted()
A file download that finished during this call, reported with the same
download_idas itsdownload_started— or without a priordownload_started, when the download finished during the call that started it (at most one state change perdownload_idper result).
-
asDownloadFailed
final BetaBrowserStateChangeDownloadFailed asDownloadFailed()
A file download that failed — or was cancelled — during this call.
-
accept
final <T extends Any> T accept(BetaBrowserStateChange.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 = betaBrowserStateChange.accept(new BetaBrowserStateChange.Visitor<Optional<String>>() { @Override public Optional<String> visitTabOpened(BetaBrowserStateChangeTabOpened tabOpened) { return Optional.of(tabOpened.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaBrowserStateChange 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.
-
ofTabOpened
final static BetaBrowserStateChange ofTabOpened(BetaBrowserStateChangeTabOpened tabOpened)
A tab this call's execution opened that remains open at its end — the creation delta of the
tabsinventory, not an event log.Carries only the
tab_id; the tab'stitleandurllive on itstabsentry, which must include the sametab_id. A tab opened during a failed call gets no deferredtab_opened; it simply appears in the next result'stabsinventory.
-
ofTabOpened
final static BetaBrowserStateChange ofTabOpened(String tabId)
Returns an immutable instance of BetaBrowserStateChange whose ofTabOpened variant is built from the given required tabId.
-
ofDownloadStarted
final static BetaBrowserStateChange ofDownloadStarted(BetaBrowserStateChangeDownloadStarted downloadStarted)
A file download that started during this call.
-
ofDownloadCompleted
final static BetaBrowserStateChange ofDownloadCompleted(BetaBrowserStateChangeDownloadCompleted downloadCompleted)
A file download that finished during this call, reported with the same
download_idas itsdownload_started— or without a priordownload_started, when the download finished during the call that started it (at most one state change perdownload_idper result).
-
ofDownloadFailed
final static BetaBrowserStateChange ofDownloadFailed(BetaBrowserStateChangeDownloadFailed downloadFailed)
A file download that failed — or was cancelled — during this call.
-
-
-
-