Skip to content

get_document_path async

get_document_path(
    document_id: IdType,
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    limit: Optional[LimitType] = None,
    fields: Optional[FieldNamesType] = None,
    marker: Optional[PageMarkerType] = None,
) -> GetDocumentPathResponse

Retrieves the path information (the hierarchy from the root folder) for the requested document.

By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested document and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the names of the parent folders.

Parameters:

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

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

  • document_id (IdType) –

    The ID of the document.

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

    The maximum number of levels in the hierarchy to return.

  • fields (Optional[FieldNamesType], default: None ) –

    A comma-separated list of values. Specify NAME to include the names of the parent folders.

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

    This value is not supported.

Raises:

Source code in docs_src/capo_workdocs/_services/async_work_docs.py
async def get_document_path(
    self,
    document_id: "capo_workdocs.types.id_type.IdType",
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    limit: Optional["capo_workdocs.types.limit_type.LimitType"] = None,
    fields: Optional["capo_workdocs.types.field_names_type.FieldNamesType"] = None,
    marker: Optional["capo_workdocs.types.page_marker_type.PageMarkerType"] = None,
) -> "capo_workdocs.types.get_document_path_response.GetDocumentPathResponse":
    """<p>Retrieves the path information (the hierarchy from the root folder) for the requested document.</p> <p>By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested document and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the names of the parent folders.</p>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        document_id: <p>The ID of the document.</p>
        limit: <p>The maximum number of levels in the hierarchy to return.</p>
        fields: <p>A comma-separated list of values. Specify <code>NAME</code> to include the names of the parent folders.</p>
        marker: <p>This value is not supported.</p>

    Raises:
        capo_workdocs.errors.entity_not_exists_exception.EntityNotExistsException: <p>The resource does not exist.</p>
        capo_workdocs.errors.failed_dependency_exception.FailedDependencyException: <p>The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workdocs.types.get_document_path_request.GetDocumentPathRequest]",
    ) -> AsyncOperationResponse[
        "capo_workdocs.types.get_document_path_response.GetDocumentPathResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.get_document_path

        (
            output,
            http_response,
        ) = await capo_workdocs._operations.aws_gorilla_boy_service.get_document_path.async_get_document_path(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

        return capo_workdocs.types.get_document_path_request.redact_sensitive(
            input_
        )

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

        return capo_workdocs.types.get_document_path_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetDocumentPath",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_workdocs.types.get_document_path_request.GetDocumentPathRequest = {
        "document_id": document_id
    }
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if limit is not None:
        input_["limit"] = limit
    if fields is not None:
        input_["fields"] = fields
    if marker is not None:
        input_["marker"] = marker

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output