queryAccessibleData method

Future<Operation> queryAccessibleData(
  1. QueryAccessibleDataRequest request,
  2. String consentStore, {
  3. String? $fields,
})

Queries all data_ids that are consented for a specified use in the given consent store and writes them to a specified destination.

The returned Operation includes a progress counter for the number of User data mappings processed. If the request is successful, a detailed response is returned of type QueryAccessibleDataResponse, contained in the response field when the operation finishes. The metadata field type is OperationMetadata. Errors are logged to Cloud Logging (see Viewing error logs in Cloud Logging). For example, the following sample log entry shows a failed to evaluate consent policy error that occurred during a QueryAccessibleData call to consent store projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}.

"type.googleapis.com/google.cloud.healthcare.logging.QueryAccessibleDataLogEntry"
error: { code: 9 message: "failed to evaluate consent policy" }
resourceName:
"projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}"
} logName:
"projects/{project_id}/logs/healthcare.googleapis.com%2Fquery_accessible_data"
operation: { id:
"projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/operations/{operation_id}"
producer: "healthcare.googleapis.com/QueryAccessibleData" }
receiveTimestamp: "TIMESTAMP" resource: { labels: { consent_store_id:
"{consent_store_id}" dataset_id: "{dataset_id}" location: "{location_id}"
project_id: "{project_id}" } type: "healthcare_consent_store" } severity:
"ERROR" timestamp: "TIMESTAMP" ```

[request] - The metadata request object.

Request parameters:

[consentStore] - Required. Name of the consent store to retrieve User data
mappings from.
Value must have pattern
`^projects/\[^/\]+/locations/\[^/\]+/datasets/\[^/\]+/consentStores/\[^/\]+$`.

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

Completes with a [Operation].

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<Operation> queryAccessibleData(
  QueryAccessibleDataRequest request,
  core.String consentStore, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

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

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