generateRecallPlayGroupingApiToken method

Future<GenerateRecallPlayGroupingApiTokenResponse> generateRecallPlayGroupingApiToken({
  1. String? packageName,
  2. String? persona,
  3. String? recallSessionId,
  4. String? $fields,
})

Generates a Play Grouping API token for the PGS user identified by the Recall session ID provided in the request.

Request parameters:

packageName - Required. App package name to generate the token for (e.g. com.example.mygame).

persona - Required. Persona to associate with the token. Persona is a developer-provided stable identifier of the user. Must be deterministically generated (e.g. as a one-way hash) from the user account ID and user profile ID (if the app has the concept), according to the developer's own user identity system.

recallSessionId - Required. Opaque server-generated string that encodes all the necessary information to identify the PGS player / Google user and application. See https://developer.android.com/games/pgs/recall/recall-setup on how to integrate with Recall and get session ID.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GenerateRecallPlayGroupingApiTokenResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GenerateRecallPlayGroupingApiTokenResponse>
    generateRecallPlayGroupingApiToken({
  core.String? packageName,
  core.String? persona,
  core.String? recallSessionId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (packageName != null) 'packageName': [packageName],
    if (persona != null) 'persona': [persona],
    if (recallSessionId != null) 'recallSessionId': [recallSessionId],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'games/v1/accesstokens/generateRecallPlayGroupingApiToken';

  final response_ = await _requester.request(
    url_,
    'POST',
    queryParams: queryParams_,
  );
  return GenerateRecallPlayGroupingApiTokenResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}