lookup method

Future<GoogleAppsCloudidentityDevicesV1LookupSelfDeviceUsersResponse> lookup(
  1. String parent, {
  2. String? androidId,
  3. String? iosDeviceId,
  4. int? pageSize,
  5. String? pageToken,
  6. String? partner,
  7. String? rawResourceId,
  8. String? userId,
  9. 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: Specifying the 'partner' and 'ios_device_id' fields is required. - 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).

iosDeviceId - Optional. The partner-specified device identifier assigned to the iOS device that initiated the Lookup API call. This string must match the value of the iosDeviceId key in the app config dictionary provided to Google Workspace apps.

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.

partner - Optional. The partner ID of the calling iOS app. This string must match the value of the partner key within the app configuration dictionary provided to Google Workspace apps.

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. Mac: ~/.secureConnect/context_aware_config.json Windows: C:\Users%USERPROFILE%.secureConnect\context_aware_config.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.String? iosDeviceId,
  core.int? pageSize,
  core.String? pageToken,
  core.String? partner,
  core.String? rawResourceId,
  core.String? userId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (androidId != null) 'androidId': [androidId],
    if (iosDeviceId != null) 'iosDeviceId': [iosDeviceId],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (partner != null) 'partner': [partner],
    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>,
  );
}