# ArVpsAvailabilityFuture

An asynchronous operation checking VPS availability.

The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy. See `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync` for more details.

## Summary

| ### Enumerations ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailability{ https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#ar_vps_availability_unknown = 0, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#ar_vps_availability_available = 1, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#ar_vps_availability_unavailable = 2, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#ar_vps_availability_error_internal = -1, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#ar_vps_availability_error_network_connection = -2, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#ar_vps_availability_error_not_authorized = -3, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#ar_vps_availability_error_resource_exhausted = -4 }` | enumThe result of `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`, obtained by `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture_getresult` or from an invocation of an `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback`. |

| ### Typedefs ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#archeckvpsavailabilitycallback` | typedef `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback` **[Deprecated.](https://developers.google.com/ar/reference/c/deprecated/deprecated)** Deprecated in release 1.37.0. Use `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback` instead. Deprecated alias of `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback`. |
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback)(void *context, ArVpsAvailability availability)` | typedef `void(*` Callback definition for `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`. |
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture` | typedef `struct ArVpsAvailabilityFuture_` Handle to an asynchronous operation launched by `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`. |

| ### Functions ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture_cancel(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture *future, int32_t *out_was_cancelled)` | `void` Tries to cancel execution of this operation. |
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture_getresult(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture *future, https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailability *out_result_availability)` | `void` Returns the result of an asynchronous operation. |
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture_getstate(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture *future, https://developers.google.com/ar/reference/c/group/ar-future#arfuturestate *out_state)` | `void` Gets the state of an asynchronous operation. |
| `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture_release(https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture *future)` | `void` Releases a reference to a future. |

## Enumerations

### ArVpsAvailability

```
 ArVpsAvailability
```
The result of `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`, obtained by `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilityfuture_getresult` or from an invocation of an `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback`.

| Properties ||
|---|---|
| `AR_VPS_AVAILABILITY_AVAILABLE` | VPS is available at the requested location. |
| `AR_VPS_AVAILABILITY_ERROR_INTERNAL` | An internal error occurred while determining availability. |
| `AR_VPS_AVAILABILITY_ERROR_NETWORK_CONNECTION` | The external service could not be reached due to a network connection error. |
| `AR_VPS_AVAILABILITY_ERROR_NOT_AUTHORIZED` | An authorization error occurred when communicating with the Google Cloud ARCore API. See [Enable the Geospatial API](https://developers.google.com/ar/develop/c/geospatial/enable) for troubleshooting steps. |
| `AR_VPS_AVAILABILITY_ERROR_RESOURCE_EXHAUSTED` | Too many requests were sent. |
| `AR_VPS_AVAILABILITY_UNAVAILABLE` | VPS is not available at the requested location. |
| `AR_VPS_AVAILABILITY_UNKNOWN` | The request to the remote service is not yet completed, so the availability is not yet known. |

## Typedefs

### ArCheckVpsAvailabilityCallback

```
ArVpsAvailabilityCallback ArCheckVpsAvailabilityCallback
```
Deprecated alias of `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback`.

**[Deprecated.](https://developers.google.com/ar/reference/c/deprecated/deprecated)** Deprecated in release 1.37.0. Use `https://developers.google.com/ar/reference/c/group/ar-vps-availability-future#arvpsavailabilitycallback` instead.

### ArVpsAvailabilityCallback

```
void(* ArVpsAvailabilityCallback)(void *context, ArVpsAvailability availability)
```
Callback definition for `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`.

The `context` argument will be the same as that passed to `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`. The `availability` argument will be the same as the result obtained from the future returned by `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`.

It is a best practice to free `context` memory provided to `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync` at the end of the callback implementation.

### ArVpsAvailabilityFuture

```
struct ArVpsAvailabilityFuture_ ArVpsAvailabilityFuture
```
Handle to an asynchronous operation launched by `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`.

Release with `https://developers.google.com/ar/reference/c/group/ar-future#arfuture_release`. ([reference type, long-lived](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)).

## Functions

### ArVpsAvailabilityFuture_cancel

```
void ArVpsAvailabilityFuture_cancel(
  const ArSession *session,
  ArVpsAvailabilityFuture *future,
  int32_t *out_was_cancelled
)
```
Tries to cancel execution of this operation.

`out_was_cancelled` will be set to 1 if the operation was cancelled by this invocation, and in that case it is a best practice to free `context` memory provided to `https://developers.google.com/ar/reference/c/group/ar-session#arsession_checkvpsavailabilityasync`.


Details Parameters `session` The ARCore session. `future` The handle for the asynchronous operation. `out_was_cancelled` Set to 1 if this invocation successfully cancelled the operation, 0 otherwise. This may be null.

### ArVpsAvailabilityFuture_getResult

```
void ArVpsAvailabilityFuture_getResult(
  const ArSession *session,
  const ArVpsAvailabilityFuture *future,
  ArVpsAvailability *out_result_availability
)
```
Returns the result of an asynchronous operation.

The returned result is only valid when `https://developers.google.com/ar/reference/c/group/ar-future#arfuture_getstate` returns `https://developers.google.com/ar/reference/c/group/ar-future#ar_future_state_done`.


Details Parameters `session` The ARCore session. `future` The handle for the asynchronous operation. `out_result_availability` The result of the operation, if the Future's state is `https://developers.google.com/ar/reference/c/group/ar-future#ar_future_state_done`.

### ArVpsAvailabilityFuture_getState

```
void ArVpsAvailabilityFuture_getState(
  const ArSession *session,
  const ArVpsAvailabilityFuture *future,
  ArFutureState *out_state
)
```
Gets the state of an asynchronous operation.


Details Parameters `session` The ARCore session. `future` The handle for the asynchronous operation. `out_state` The state of the operation.

### ArVpsAvailabilityFuture_release

```
void ArVpsAvailabilityFuture_release(
  ArVpsAvailabilityFuture *future
)
```
Releases a reference to a future.

This does not mean that the operation will be terminated - see `https://developers.google.com/ar/reference/c/group/ar-future#arfuture_cancel`.

This function may safely be called with `NULL` - it will do nothing.