searchResources method

Future<SearchResourcesResponse> searchResources({
  1. List<AdditionalResponseFieldType>? additionalResponseFields,
  2. String? authenticationToken,
  3. Filters? filters,
  4. int? limit,
  5. String? marker,
  6. List<SearchSortResult>? orderBy,
  7. String? organizationId,
  8. List<SearchQueryScopeType>? queryScopes,
  9. String? queryText,
})

Searches metadata and the content of folders, documents, document versions, and comments.

May throw InvalidArgumentException. May throw ServiceUnavailableException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException.

Parameter additionalResponseFields : A list of attributes to include in the response. Used to request fields that are not normally returned in a standard response.

Parameter authenticationToken : WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

Parameter filters : Filters results based on entity metadata.

Parameter limit : Max results count per page.

Parameter marker : The marker for the next set of results.

Parameter orderBy : Order by results in one or more categories.

Parameter organizationId : Filters based on the resource owner OrgId. This is a mandatory parameter when using Admin SigV4 credentials.

Parameter queryScopes : Filter based on the text field type. A Folder has only a name and no content. A Comment has only content and no name. A Document or Document Version has a name and content

Parameter queryText : The String to search for. Searches across different text fields based on request parameters. Use double quotes around the query string for exact phrase matches.

Implementation

Future<SearchResourcesResponse> searchResources({
  List<AdditionalResponseFieldType>? additionalResponseFields,
  String? authenticationToken,
  Filters? filters,
  int? limit,
  String? marker,
  List<SearchSortResult>? orderBy,
  String? organizationId,
  List<SearchQueryScopeType>? queryScopes,
  String? queryText,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    100,
  );
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $payload = <String, dynamic>{
    if (additionalResponseFields != null)
      'AdditionalResponseFields':
          additionalResponseFields.map((e) => e.value).toList(),
    if (filters != null) 'Filters': filters,
    if (limit != null) 'Limit': limit,
    if (marker != null) 'Marker': marker,
    if (orderBy != null) 'OrderBy': orderBy,
    if (organizationId != null) 'OrganizationId': organizationId,
    if (queryScopes != null)
      'QueryScopes': queryScopes.map((e) => e.value).toList(),
    if (queryText != null) 'QueryText': queryText,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/api/v1/search',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return SearchResourcesResponse.fromJson(response);
}