getOperation
Metody asynchroniczne interfejsu API zwracają wynik przed zakończeniem przetwarzania. Użyj funkcji getOperation
, aby pobrać stan operacji asynchronicznej za pomocą jej identyfikatora operationId
.
podpis metody,
public Operation getOperation( GetOperationRequest request) throws CommonException;
GetOperationRequest
Nazwa usługi |
Wartość |
Wymagane |
Opis |
operationId |
string |
Tak |
Identyfikator operacji. |
Zachowanie w przypadku błędu
Jeśli wystąpi błąd, biblioteka zwróci błąd CommonException
zawierający jeden z tych kodów błędu:
Kod błędu |
AUTHORIZATION_FAIL (jeśli operacja nie należy do sprzedawcy) |
INTERNAL_SERVER_ERROR |
INVALID_OPERATION_ID |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-11-09 UTC.
[null,null,["Ostatnia aktualizacja: 2024-11-09 UTC."],[[["Asynchronous API methods use `getOperation` to check the status of an operation."],["The `getOperation` method requires the `operationId` as a string in the `GetOperationRequest`."],["`CommonException` is thrown if an error occurs during the operation."],["Possible error codes include `AUTHORIZATION_FAIL`, `INTERNAL_SERVER_ERROR`, and `INVALID_OPERATION_ID`."]]],["Asynchronous operations are tracked using `getOperation`, which requires an `operationId` to check their status. The `getOperation` method, part of the API, takes a `GetOperationRequest` and can throw a `CommonException`. Possible errors include `AUTHORIZATION_FAIL` (if the caller lacks ownership), `INTERNAL_SERVER_ERROR`, and `INVALID_OPERATION_ID`. The method returns before the operation is completed, allowing users to periodically retrieve updates via `getOperation`.\n"]]