Skip to content

describe_document_versions

describe_document_versions(
    document_id: ResourceIdType,
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    marker: Optional[PageMarkerType] = None,
    limit: Optional[LimitType] = None,
    include: Optional[FieldNamesType] = None,
    fields: Optional[FieldNamesType] = None,
) -> DescribeDocumentVersionsResponse

Retrieves the document versions for the specified document.

By default, only active versions are returned.

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 (ResourceIdType) –

    The ID of the document.

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

    The marker for the next set of results. (You received this marker from a previous call.)

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

    The maximum number of versions to return with this call.

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

    A comma-separated list of values. Specify "INITIALIZED" to include incomplete versions.

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

    Specify "SOURCE" to include initialized versions and a URL for the source document.

Raises:

Source code in docs_src/capo_workdocs/_services/work_docs.py
def describe_document_versions(
    self,
    document_id: "capo_workdocs.types.resource_id_type.ResourceIdType",
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    marker: Optional["capo_workdocs.types.page_marker_type.PageMarkerType"] = None,
    limit: Optional["capo_workdocs.types.limit_type.LimitType"] = None,
    include: Optional["capo_workdocs.types.field_names_type.FieldNamesType"] = None,
    fields: Optional["capo_workdocs.types.field_names_type.FieldNamesType"] = None,
) -> "capo_workdocs.types.describe_document_versions_response.DescribeDocumentVersionsResponse":
    """<p>Retrieves the document versions for the specified document.</p> <p>By default, only active versions are returned.</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>
        marker: <p>The marker for the next set of results. (You received this marker from a previous call.)</p>
        limit: <p>The maximum number of versions to return with this call.</p>
        include: <p>A comma-separated list of values. Specify "INITIALIZED" to include incomplete versions.</p>
        fields: <p>Specify "SOURCE" to include initialized versions and a URL for the source document.</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.invalid_argument_exception.InvalidArgumentException: <p>The pagination marker or limit fields are not valid.</p>
        capo_workdocs.errors.invalid_password_exception.InvalidPasswordException: <p>The password is invalid.</p>
        capo_workdocs.errors.prohibited_state_exception.ProhibitedStateException: <p>The specified document version is not in the INITIALIZED state.</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.describe_document_versions_request.DescribeDocumentVersionsRequest]",
    ) -> OperationResponse[
        "capo_workdocs.types.describe_document_versions_response.DescribeDocumentVersionsResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.describe_document_versions

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

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

        return (
            capo_workdocs.types.describe_document_versions_request.redact_sensitive(
                input_
            )
        )

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

        return capo_workdocs.types.describe_document_versions_response.redact_sensitive(
            output
        )

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

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