# Google.Play.Common.PlayAsyncOperation\< TResult, TError \>

**This is an abstract class.**   

Represents an asynchronous operation that produces a result upon completion.

## Summary

<br />

Details Template Parameters `TResult` The type of the result of the operation. `TError` The type of error that can be encountered during this operation.

### Inheritance

Inherits from: CustomYieldInstruction

| ### Properties ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a5cd822567ca55c213e28a5af785a13c2` | `TError` The error that prevented this operation from completing successfully. |
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a157c9bb04489f5d6c767879cbaa4dcec` | `bool` Whether or not the operation has finished. |
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1af8601dc325a0b1fc4f4ce8a1388e4b88` | `abstract bool` Whether or not the operation completed without error. |
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aadacbd7f1e9bec59d24a6a1e92f5b4e4` | `override bool` Implements the [CustomYieldInstruction.keepWaiting](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction-keepWaiting.html) property so that this request can be yielded on in a coroutine. |

| ### Events ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aa51286b27eae60ca169d3fa0d4030988 = delegate { }` | `Action< PlayAsyncOperation< TResult, TError > >` Event that is invoked upon operation completion. |

| ### Public functions ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a09e7c53341bf01e55ce4cba485105d2e()` | `TResult` Gets the result, if the operation is done. |

| ### Protected functions ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a2b8607686e7676a0df29dd291fdc0456()` | `virtual abstract TResult` Returns the operation result. |
| `https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a2c5b22257a3e936815e158c625d5e7bb()` | `void` Invokes the [Completed](https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aa51286b27eae60ca169d3fa0d4030988) event. |

## Properties

### Error

```c#
TError Error
```
The error that prevented this operation from completing successfully.

In the case of a successful operation, this value can be ignored.

### IsDone

```c#
bool IsDone
```
Whether or not the operation has finished.

### IsSuccessful

```c#
abstract bool IsSuccessful
```
Whether or not the operation completed without error.

### keepWaiting

```c#
override bool keepWaiting
```
Implements the [CustomYieldInstruction.keepWaiting](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction-keepWaiting.html) property so that this request can be yielded on in a coroutine.

## Events

### Completed

```c#
Action< PlayAsyncOperation< TResult, TError > > Completed = delegate { }
```
Event that is invoked upon operation completion.

If an event handler is registered after the operation has completed, and thus after this event has been invoked, then the handler will be called synchronously.

## Public functions

### GetResult

```c#
TResult GetResult()
```
Gets the result, if the operation is done.

<br />

Details Exceptions `InvalidOperationException` Throws if GetResult is called before the operation is done, or if an error occured during the operation.

## Protected functions

### GetResultImpl

```c#
virtual abstract TResult GetResultImpl()
```
Returns the operation result.

<br />

| Details ||
|---|---|
| **Returns** | The result of the operation. |

### InvokeCompletedEvent

```c#
void InvokeCompletedEvent()
```
Invokes the [Completed](https://developer.android.com/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aa51286b27eae60ca169d3fa0d4030988) event.