generatePlayGroupingApiToken method

Future<GeneratePlayGroupingApiTokenResponse> generatePlayGroupingApiToken({
  1. String? packageName,
  2. String? persona,
  3. String? $fields,
})

Generates a Play Grouping API token for the PGS user identified by the attached credential.

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.

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

Completes with a GeneratePlayGroupingApiTokenResponse.

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<GeneratePlayGroupingApiTokenResponse>
    generatePlayGroupingApiToken({
  core.String? packageName,
  core.String? persona,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (packageName != null) 'packageName': [packageName],
    if (persona != null) 'persona': [persona],
    if ($fields != null) 'fields': [$fields],
  };

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

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