Skip to content

delete_comment

delete_comment(
    document_id: ResourceIdType,
    version_id: DocumentVersionIdType,
    comment_id: CommentIdType,
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
) -> None

Deletes the specified comment from the document version.

Parameters:

Raises:

Source code in docs_src/capo_workdocs/_services/work_docs.py
def delete_comment(
    self,
    document_id: "capo_workdocs.types.resource_id_type.ResourceIdType",
    version_id: "capo_workdocs.types.document_version_id_type.DocumentVersionIdType",
    comment_id: "capo_workdocs.types.comment_id_type.CommentIdType",
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
) -> None:
    """<p>Deletes the specified comment from the document version.</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>
        version_id: <p>The ID of the document version.</p>
        comment_id: <p>The ID of the comment.</p>

    Raises:
        capo_workdocs.errors.document_locked_for_comments_exception.DocumentLockedForCommentsException: <p>This exception is thrown when the document is locked for comments and user tries to create or delete a comment on that document.</p>
        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.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.delete_comment_request.DeleteCommentRequest]",
    ) -> OperationResponse[None]:
        import capo_workdocs._operations.aws_gorilla_boy_service.delete_comment

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

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

        return capo_workdocs.types.delete_comment_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DeleteComment", redact_input=_redact_input),
    )
    input_: capo_workdocs.types.delete_comment_request.DeleteCommentRequest = {
        "document_id": document_id,
        "version_id": version_id,
        "comment_id": comment_id,
    }
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token

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