lookup method

Future<GoogleAppsCloudidentityDevicesV1LookupSelfDeviceUsersResponse> lookup(
  1. String parent, {
  2. String? androidId,
  3. int? pageSize,
  4. String? pageToken,
  5. String? rawResourceId,
  6. String? userId,
  7. String? $fields,
})

Looks up resource names of the DeviceUsers associated with the caller's credentials, as well as the properties provided in the request.

This method must be called with end-user credentials with the scope: https://www.googleapis.com/auth/cloud-identity.devices.lookup If multiple properties are provided, only DeviceUsers having all of these properties are considered as matches - i.e. the query behaves like an AND. Different platforms require different amounts of information from the caller to ensure that the DeviceUser is uniquely identified. - iOS: No properties need to be passed, the caller's credentials are sufficient to identify the corresponding DeviceUser. - Android: Specifying the 'android_id' field is required. - Desktop: Specifying the 'raw_resource_id' field is required.

Request parameters:

parent - Must be set to "devices/-/deviceUsers" to search across all DeviceUser belonging to the user. Value must have pattern ^devices/\[^/\]+/deviceUsers$.

androidId - Android Id returned by [Settings.Secure#ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID).

pageSize - The maximum number of DeviceUsers to return. If unspecified, at most 20 DeviceUsers will be returned. The maximum value is 20; values above 20 will be coerced to 20.

pageToken - A page token, received from a previous LookupDeviceUsers call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to LookupDeviceUsers must match the call that provided the page token.

rawResourceId - Raw Resource Id used by Google Endpoint Verification. If the user is enrolled into Google Endpoint Verification, this id will be saved as the 'device_resource_id' field in the following platform dependent files. * macOS: ~/.secureConnect/context_aware_config.json * Windows: %USERPROFILE%\AppData\Local\Google\Endpoint Verification\accounts.json * Linux: ~/.secureConnect/context_aware_config.json

userId - The user whose DeviceUser's resource name will be fetched. Must be set to 'me' to fetch the DeviceUser's resource name for the calling user.

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

Completes with a GoogleAppsCloudidentityDevicesV1LookupSelfDeviceUsersResponse.

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<GoogleAppsCloudidentityDevicesV1LookupSelfDeviceUsersResponse>
    lookup(
  core.String parent, {
  core.String? androidId,
  core.int? pageSize,
  core.String? pageToken,
  core.String? rawResourceId,
  core.String? userId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (androidId != null) 'androidId': [androidId],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (rawResourceId != null) 'rawResourceId': [rawResourceId],
    if (userId != null) 'userId': [userId],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + ':lookup';

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