getIdentity method

Future<Identity> getIdentity(
  1. String name, {
  2. String? $fields,
})

Gets the user's identity.

It includes the legacy Fitbit user ID and the Google user ID and it can be used by migrating clients to map identifiers between the two systems.

Request parameters:

name - Required. The resource name of the Identity. Format: users/me/identity Value must have pattern ^users/\[^/\]+/identity$.

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

Completes with a Identity.

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<Identity> getIdentity(
  core.String name, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ = 'v4/' + core.Uri.encodeFull('$name');

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