searchDataItems method

Future<GoogleCloudAiplatformV1SearchDataItemsResponse> searchDataItems(
  1. String dataset, {
  2. List<String>? annotationFilters,
  3. String? annotationsFilter,
  4. int? annotationsLimit,
  5. String? dataItemFilter,
  6. String? dataLabelingJob,
  7. String? fieldMask,
  8. String? orderBy,
  9. String? orderByAnnotation_orderBy,
  10. String? orderByAnnotation_savedQuery,
  11. String? orderByDataItem,
  12. int? pageSize,
  13. String? pageToken,
  14. String? savedQuery,
  15. String? $fields,
})

Searches DataItems in a Dataset.

Request parameters:

dataset - Required. The resource name of the Dataset from which to search DataItems. Format: projects/{project}/locations/{location}/datasets/{dataset} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/datasets/\[^/\]+$.

annotationFilters - An expression that specifies what Annotations will be returned per DataItem. Annotations satisfied either of the conditions will be returned. * annotation_spec_id - for = or !=. Must specify saved_query_id= - saved query id that annotations should belong to.

annotationsFilter - An expression for filtering the Annotations that will be returned per DataItem. * annotation_spec_id - for = or !=.

annotationsLimit - If set, only up to this many of Annotations will be returned per DataItemView. The maximum value is 1000. If not set, the maximum value will be used.

dataItemFilter - An expression for filtering the DataItem that will be returned. * data_item_id - for = or !=. * labeled - for = or !=. * has_annotation(ANNOTATION_SPEC_ID) - true only for DataItem that have at least one annotation with annotation_spec_id = ANNOTATION_SPEC_ID in the context of SavedQuery or DataLabelingJob. For example: * data_item=1 * has_annotation(5)

dataLabelingJob - The resource name of a DataLabelingJob. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job} If this field is set, all of the search will be done in the context of this DataLabelingJob.

fieldMask - Mask specifying which fields of DataItemView to read.

orderBy - A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending.

orderByAnnotation_orderBy - A comma-separated list of annotation fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Must also specify saved_query.

orderByAnnotation_savedQuery - Required. Saved query of the Annotation. Only Annotations belong to this saved query will be considered for ordering.

orderByDataItem - A comma-separated list of data item fields to order by, sorted in ascending order. Use "desc" after a field name for descending.

pageSize - Requested page size. Server may return fewer results than requested. Default and maximum page size is 100.

pageToken - A token identifying a page of results for the server to return Typically obtained via SearchDataItemsResponse.next_page_token of the previous DatasetService.SearchDataItems call.

savedQuery - The resource name of a SavedQuery(annotation set in UI). Format: projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query} All of the search will be done in the context of this SavedQuery.

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

Completes with a GoogleCloudAiplatformV1SearchDataItemsResponse.

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<GoogleCloudAiplatformV1SearchDataItemsResponse> searchDataItems(
  core.String dataset, {
  core.List<core.String>? annotationFilters,
  core.String? annotationsFilter,
  core.int? annotationsLimit,
  core.String? dataItemFilter,
  core.String? dataLabelingJob,
  core.String? fieldMask,
  core.String? orderBy,
  core.String? orderByAnnotation_orderBy,
  core.String? orderByAnnotation_savedQuery,
  core.String? orderByDataItem,
  core.int? pageSize,
  core.String? pageToken,
  core.String? savedQuery,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (annotationFilters != null) 'annotationFilters': annotationFilters,
    if (annotationsFilter != null) 'annotationsFilter': [annotationsFilter],
    if (annotationsLimit != null) 'annotationsLimit': ['${annotationsLimit}'],
    if (dataItemFilter != null) 'dataItemFilter': [dataItemFilter],
    if (dataLabelingJob != null) 'dataLabelingJob': [dataLabelingJob],
    if (fieldMask != null) 'fieldMask': [fieldMask],
    if (orderBy != null) 'orderBy': [orderBy],
    if (orderByAnnotation_orderBy != null)
      'orderByAnnotation.orderBy': [orderByAnnotation_orderBy],
    if (orderByAnnotation_savedQuery != null)
      'orderByAnnotation.savedQuery': [orderByAnnotation_savedQuery],
    if (orderByDataItem != null) 'orderByDataItem': [orderByDataItem],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (savedQuery != null) 'savedQuery': [savedQuery],
    if ($fields != null) 'fields': [$fields],
  };

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

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