Skip to content

search_resources

search_resources(
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    query_text: Optional[SearchQueryType] = None,
    query_scopes: Optional[SearchQueryScopeTypeList] = None,
    organization_id: Optional[IdType] = None,
    additional_response_fields: Optional[AdditionalResponseFieldsList] = None,
    filters: Optional[Filters] = None,
    order_by: Optional[SearchResultSortList] = None,
    limit: Optional[SearchResultsLimitType] = None,
    marker: Optional[NextMarkerType] = None,
) -> SearchResourcesResponse

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

Parameters:

  • authentication_token (Optional[AuthenticationHeaderType], default: None ) –

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

  • query_text (Optional[SearchQueryType], default: None ) –

    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.

  • query_scopes (Optional[SearchQueryScopeTypeList], default: None ) –

    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

  • organization_id (Optional[IdType], default: None ) –

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

  • additional_response_fields (Optional[AdditionalResponseFieldsList], default: None ) –

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

  • filters (Optional[Filters], default: None ) –

    Filters results based on entity metadata.

  • order_by (Optional[SearchResultSortList], default: None ) –

    Order by results in one or more categories.

  • limit (Optional[SearchResultsLimitType], default: None ) –

    Max results count per page.

  • marker (Optional[NextMarkerType], default: None ) –

    The marker for the next set of results.

Raises:

Source code in docs_src/capo_workdocs/_services/work_docs.py
def search_resources(
    self,
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    query_text: Optional[
        "capo_workdocs.types.search_query_type.SearchQueryType"
    ] = None,
    query_scopes: Optional[
        "capo_workdocs.types.search_query_scope_type_list.SearchQueryScopeTypeList"
    ] = None,
    organization_id: Optional["capo_workdocs.types.id_type.IdType"] = None,
    additional_response_fields: Optional[
        "capo_workdocs.types.additional_response_fields_list.AdditionalResponseFieldsList"
    ] = None,
    filters: Optional["capo_workdocs.types.filters.Filters"] = None,
    order_by: Optional[
        "capo_workdocs.types.search_result_sort_list.SearchResultSortList"
    ] = None,
    limit: Optional[
        "capo_workdocs.types.search_results_limit_type.SearchResultsLimitType"
    ] = None,
    marker: Optional["capo_workdocs.types.next_marker_type.NextMarkerType"] = None,
) -> "capo_workdocs.types.search_resources_response.SearchResourcesResponse":
    """<p>Searches metadata and the content of folders, documents, document versions, and comments.</p>

    Args:
        authentication_token: <p>WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        query_text: <p>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.</p>
        query_scopes: <p>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</p>
        organization_id: <p>Filters based on the resource owner OrgId. This is a mandatory parameter when using Admin SigV4 credentials.</p>
        additional_response_fields: <p>A list of attributes to include in the response. Used to request fields that are not normally returned in a standard response.</p>
        filters: <p>Filters results based on entity metadata.</p>
        order_by: <p>Order by results in one or more categories.</p>
        limit: <p>Max results count per page.</p>
        marker: <p>The marker for the next set of results.</p>

    Raises:
        capo_workdocs.errors.invalid_argument_exception.InvalidArgumentException: <p>The pagination marker or limit fields are not valid.</p>
        capo_workdocs.errors.service_unavailable_exception.ServiceUnavailableException: <p>One or more of the dependencies is unavailable.</p>
        capo_workdocs.errors.unauthorized_operation_exception.UnauthorizedOperationException: <p>The operation is not permitted.</p>
        capo_workdocs.errors.unauthorized_resource_access_exception.UnauthorizedResourceAccessException: <p>The caller does not have access to perform the action on the resource.</p>
        capo_workdocs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workdocs.types.search_resources_request.SearchResourcesRequest]",
    ) -> OperationResponse[
        "capo_workdocs.types.search_resources_response.SearchResourcesResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.search_resources

        output, http_response = (
            capo_workdocs._operations.aws_gorilla_boy_service.search_resources.search_resources(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workdocs.types.search_resources_request.SearchResourcesRequest",
    ) -> dict[str, Any]:
        import capo_workdocs.types.search_resources_request

        return capo_workdocs.types.search_resources_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_workdocs.types.search_resources_response.SearchResourcesResponse",
    ) -> dict[str, Any]:
        import capo_workdocs.types.search_resources_response

        return capo_workdocs.types.search_resources_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "SearchResources",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_workdocs.types.search_resources_request.SearchResourcesRequest = {}
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if query_text is not None:
        input_["query_text"] = query_text
    if query_scopes is not None:
        input_["query_scopes"] = query_scopes
    if organization_id is not None:
        input_["organization_id"] = organization_id
    if additional_response_fields is not None:
        input_["additional_response_fields"] = additional_response_fields
    if filters is not None:
        input_["filters"] = filters
    if order_by is not None:
        input_["order_by"] = order_by
    if limit is not None:
        input_["limit"] = limit
    if marker is not None:
        input_["marker"] = marker

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output