Skip to content

update_content async

update_content(
    knowledge_base_id: UuidOrArn,
    content_id: UuidOrArn,
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    revision_id: Optional[NonEmptyString] = None,
    title: Optional[ContentTitle] = None,
    override_link_out_uri: Optional[Uri] = None,
    remove_override_link_out_uri: Optional[bool] = None,
    metadata: Optional[ContentMetadata] = None,
    upload_id: Optional[UploadId] = None,
) -> UpdateContentResponse

Updates information about the content.

Parameters:

  • knowledge_base_id (UuidOrArn) –

    The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN

  • content_id (UuidOrArn) –

    The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • revision_id (Optional[NonEmptyString], default: None ) –

    The revisionId of the content resource to update, taken from an earlier call to GetContent, GetContentSummary, SearchContent, or ListContents. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a PreconditionFailedException.

  • title (Optional[ContentTitle], default: None ) –

    The title of the content.

  • override_link_out_uri (Optional[Uri], default: None ) –

    The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing overrideLinkOurUri, exclude this argument and set removeOverrideLinkOutUri to true.

  • remove_override_link_out_uri (Optional[bool], default: None ) –

    Unset the existing overrideLinkOutUri if it exists.

  • metadata (Optional[ContentMetadata], default: None ) –

    A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Wisdom, you can store an external version identifier as metadata to utilize for determining drift.

  • upload_id (Optional[UploadId], default: None ) –

    A pointer to the uploaded asset. This value is returned by StartContentUpload.

Raises:

Source code in docs_src/capo_wisdom/_services/async_wisdom.py
async def update_content(
    self,
    knowledge_base_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
    content_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    revision_id: Optional[
        "capo_wisdom.types.non_empty_string.NonEmptyString"
    ] = None,
    title: Optional["capo_wisdom.types.content_title.ContentTitle"] = None,
    override_link_out_uri: Optional["capo_wisdom.types.uri.Uri"] = None,
    remove_override_link_out_uri: Optional[bool] = None,
    metadata: Optional["capo_wisdom.types.content_metadata.ContentMetadata"] = None,
    upload_id: Optional["capo_wisdom.types.upload_id.UploadId"] = None,
) -> "capo_wisdom.types.update_content_response.UpdateContentResponse":
    """<p>Updates information about the content.</p>

    Args:
        knowledge_base_id: <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base if you're storing Wisdom Content resource to it. Can be either the ID or the ARN</p>
        content_id: <p>The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        revision_id: <p>The <code>revisionId</code> of the content resource to update, taken from an earlier call to <code>GetContent</code>, <code>GetContentSummary</code>, <code>SearchContent</code>, or <code>ListContents</code>. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a <code>PreconditionFailedException</code>.</p>
        title: <p>The title of the content.</p>
        override_link_out_uri: <p>The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing <code>overrideLinkOurUri</code>, exclude this argument and set <code>removeOverrideLinkOutUri</code> to true.</p>
        remove_override_link_out_uri: <p>Unset the existing <code>overrideLinkOutUri</code> if it exists.</p>
        metadata: <p>A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Wisdom, you can store an external version identifier as metadata to utilize for determining drift.</p>
        upload_id: <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>. </p>

    Raises:
        capo_wisdom.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_wisdom.errors.precondition_failed_exception.PreconditionFailedException: <p>The provided <code>revisionId</code> does not match, indicating the content has been modified since it was last read.</p>
        capo_wisdom.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_wisdom.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_wisdom.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wisdom.types.update_content_request.UpdateContentRequest]",
    ) -> AsyncOperationResponse[
        "capo_wisdom.types.update_content_response.UpdateContentResponse"
    ]:
        import capo_wisdom._operations.wisdom_service.update_content

        (
            output,
            http_response,
        ) = await capo_wisdom._operations.wisdom_service.update_content.async_update_content(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_wisdom.types.update_content_response.UpdateContentResponse",
    ) -> dict[str, Any]:
        import capo_wisdom.types.update_content_response

        return capo_wisdom.types.update_content_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateContent", redact_output=_redact_output),
    )
    input_: capo_wisdom.types.update_content_request.UpdateContentRequest = {
        "knowledge_base_id": knowledge_base_id,
        "content_id": content_id,
    }
    if revision_id is not None:
        input_["revision_id"] = revision_id
    if title is not None:
        input_["title"] = title
    if override_link_out_uri is not None:
        input_["override_link_out_uri"] = override_link_out_uri
    if remove_override_link_out_uri is not None:
        input_["remove_override_link_out_uri"] = remove_override_link_out_uri
    if metadata is not None:
        input_["metadata"] = metadata
    if upload_id is not None:
        input_["upload_id"] = upload_id

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