getOperation
روشهای API ناهمزمان قبل از تکمیل پردازش، نتیجه را برمیگردانند. از getOperation
برای بازیابی وضعیت یک عملیات ناهمزمان با استفاده از operationId
آن استفاده کنید.
امضای روش
public Operation getOperation( GetOperationRequest request) throws CommonException;
GetOperationRequest
نام ملک | ارزش | مورد نیاز | توضیحات |
---|
operationId | string | بله | شناسه عملیات |
رفتار خطا
اگر خطایی رخ دهد، کتابخانه یک CommonException
حاوی یکی از کدهای خطای زیر میفرستد:
کد خطا |
---|
AUTHORIZATION_FAIL (اگر فروشنده مالک عملیات نباشد) |
INTERNAL_SERVER_ERROR |
INVALID_OPERATION_ID |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-11-14 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-11-14 بهوقت ساعت هماهنگ جهانی."],[[["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"]]