Datastore/src/DatastoreClient.php
public function allocateId(Key $key, array $options = [])
    {
        $res = $this->allocateIds([$key], $options);
        return $res[0];
    }
public function allocateId(Key $key, array $options = [])
    {
        $res = $this->allocateIds([$key], $options);
        return $res[0];
    }
public function allocateId ( Key $ key , array $ options = [ ] ) { $ res = $ this -> allocateIds ( [ $ key ] , $ options ) ; return $ res [ 0 ] ; }
Allocates an available ID to a given incomplete key

Key MUST be in an incomplete state (i.e. including a kind but not an ID
or name in its final pathElement).

This method will execute a service request.

Example:
```
$key = $datastore->key('Person');
$keyWithAllocatedId = $datastore->allocateId($key);
```

@see https://cloud.google.com/datastore/reference/rest/v1/projects/allocateIds allocateIds

@param Key $key The incomplete key.
@param array $options [optional] Configuration options.
@return Key
Allocates an available ID to a given incomplete key